From: Tobias Brunner Date: Mon, 29 Jul 2013 16:05:33 +0000 (+0200) Subject: array: Allocate initial data properly if esize is 0 X-Git-Tag: 5.2.0dr4~1^2~26 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8069b3b14b1906bf98811a0d5fa2ca068e947933;p=thirdparty%2Fstrongswan.git array: Allocate initial data properly if esize is 0 --- diff --git a/src/libstrongswan/collections/array.c b/src/libstrongswan/collections/array.c index 75efb85bf6..8d619116a7 100644 --- a/src/libstrongswan/collections/array.c +++ b/src/libstrongswan/collections/array.c @@ -168,7 +168,7 @@ array_t *array_create(u_int esize, u_int8_t reserve) ); if (array->tail) { - array->data = malloc(array->tail * array->esize); + array->data = malloc(get_size(array, array->tail)); } return array; }