diff --git a/libs/util/quakefs.c b/libs/util/quakefs.c index 7987bf451..715929a4f 100644 --- a/libs/util/quakefs.c +++ b/libs/util/quakefs.c @@ -1168,7 +1168,7 @@ QFS_Init (const char *game) if (gamedirs[j] == ',') count++; - list = malloc (count * sizeof (char *)); + list = calloc (count + 1, sizeof (char *)); j = 0; where = strtok (gamedirs, ",");