diff --git a/src/nnn.c b/src/nnn.c index 98069fb6..b31418cf 100644 --- a/src/nnn.c +++ b/src/nnn.c @@ -2918,7 +2918,7 @@ static bool parsekvpair(kv **arr, char **envcpy, const uchar id, ushort *items) if (!maxitems) return FALSE; - *arr = malloc(maxitems * sizeof(kv)); + *arr = calloc(maxitems, sizeof(kv)); if (!arr) { xerror(); return FALSE;