From ee8ccb18c74a47203ab3fa9d219b912429278941 Mon Sep 17 00:00:00 2001 From: Sascha Kruse Date: Thu, 3 Jan 2013 20:48:45 +0100 Subject: [PATCH] fix memory corruption --- container.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/container.c b/container.c index 2db3e80..a6d469d 100644 --- a/container.c +++ b/container.c @@ -152,7 +152,7 @@ void str_array_append(str_array *a, char *str) if (!a) return; a->count++; - a->strs = realloc(a->strs, a->count); + a->strs = realloc(a->strs, a->count * sizeof(char *)); (a->strs)[a->count-1] = str; }