summaryrefslogtreecommitdiffhomepage
path: root/src/nxt_array.c
diff options
context:
space:
mode:
authorAndrei Belov <defan@nginx.com>2020-08-13 19:28:27 +0300
committerAndrei Belov <defan@nginx.com>2020-08-13 19:28:27 +0300
commitaff76e4f90b4e948c327ce2b021dc3203c33cbcd (patch)
tree5bd6ac3aa92683777548472984c209bf26d8a971 /src/nxt_array.c
parent04ce9f997e0e49e57ce4b5fc4aa98134232a1974 (diff)
parent6473d4b65a99aa10d509220fb99d8c4f65631ed0 (diff)
downloadunit-1.19.0-1.tar.gz
unit-1.19.0-1.tar.bz2
Merged with the default branch.1.19.0-1
Diffstat (limited to '')
-rw-r--r--src/nxt_array.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/nxt_array.c b/src/nxt_array.c
index 6fe9ad6a..1e13c22a 100644
--- a/src/nxt_array.c
+++ b/src/nxt_array.c
@@ -51,7 +51,7 @@ nxt_array_add(nxt_array_t *array)
if (nalloc < 16) {
/* Allocate new array twice larger than current. */
- new_alloc = nalloc * 2;
+ new_alloc = (nalloc == 0) ? 4 : nalloc * 2;
} else {
/* Allocate new array 1.5 times larger than current. */