diff --git a/src/array.c b/src/array.c index 64fdb5c..16c2592 100644 --- a/src/array.c +++ b/src/array.c @@ -44,7 +44,10 @@ int array_init(struct array **array) out->elements = 0; out->buf = calloc(out->capacity, sizeof(void *)); if (out->buf == NULL) + { + free(out); return (-1); + } *array = out; return (0);