From: Baptiste Daroussin Date: Fri, 17 Dec 2021 11:19:56 +0000 (+0100) Subject: ctrlvalues: fix initialisation of the string list X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c9bd375694c2c026edd643a05a96db1fd9fdf37e;p=thirdparty%2Fmlmmj.git ctrlvalues: fix initialisation of the string list --- diff --git a/src/controls.c b/src/controls.c index b042d5cf..daba3c83 100644 --- a/src/controls.c +++ b/src/controls.c @@ -147,8 +147,7 @@ ctrlvalues(struct mlmmj_list *list, const char *ctrlstr) return (NULL); } - ret = xmalloc(sizeof(struct strlist)); - ret->count = 0; + ret = xcalloc(1, sizeof(struct strlist)); while ((buflen = getline(&buf, &bufcap, fp)) > 0) { chomp(buf);