fix memory corruption

This commit is contained in:
Sascha Kruse 2013-01-03 20:48:45 +01:00
parent a51f564037
commit ee8ccb18c7

View File

@ -152,7 +152,7 @@ void str_array_append(str_array *a, char *str)
if (!a) if (!a)
return; return;
a->count++; a->count++;
a->strs = realloc(a->strs, a->count); a->strs = realloc(a->strs, a->count * sizeof(char *));
(a->strs)[a->count-1] = str; (a->strs)[a->count-1] = str;
} }