__libc_dynarray_emplace_enlarge: Add missing else
authorFlorian Weimer <fweimer@redhat.com>
Wed, 6 Sep 2017 09:25:14 +0000 (11:25 +0200)
committerFlorian Weimer <fweimer@redhat.com>
Wed, 6 Sep 2017 14:03:28 +0000 (16:03 +0200)
Before, arrays of small elements received a starting allocation size of
8, not 16.

ChangeLog
malloc/dynarray_emplace_enlarge.c

index 6150ba1..815c8fd 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,10 @@
 2017-09-06  Florian Weimer  <fweimer@redhat.com>
 
+       * malloc/dynarray_emplace_enlarge.c
+       (__libc_dynarray_emplace_enlarge): Add missing else.
+
+2017-09-06  Florian Weimer  <fweimer@redhat.com>
+
        [BZ #22096]
        * resolv/resolv_conf.c (__resolv_conf_attach): Do not free conf in
        case of failure to obtain the global conf object.
index 0fb0327..a15245f 100644 (file)
@@ -33,7 +33,7 @@ __libc_dynarray_emplace_enlarge (struct dynarray_header *list,
          size.  */
       if (element_size < 4)
         new_allocated = 16;
-      if (element_size < 8)
+      else if (element_size < 8)
         new_allocated = 8;
       else
         new_allocated = 4;