From: Alejandro Colomar Date: Sat, 7 Dec 2024 00:34:41 +0000 (+0100) Subject: lib/sgetgrent.c: list(): Explicitly free(3) at the start of the function X-Git-Tag: 4.18.0-rc1~5 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e7a8c2b0e580b9445b2f390a21bb07251a04b30c;p=thirdparty%2Fshadow.git lib/sgetgrent.c: list(): Explicitly free(3) at the start of the function This makes it clear we wipe anything that was in the buffer. Signed-off-by: Alejandro Colomar --- diff --git a/lib/sgetgrent.c b/lib/sgetgrent.c index 8737cebb6..20048502a 100644 --- a/lib/sgetgrent.c +++ b/lib/sgetgrent.c @@ -43,6 +43,9 @@ list(char *s) static size_t size = 0; /* max members + 1 */ size_t i; + free(members); + members = NULL; + i = 0; for (;;) { /* check if there is room for another pointer (to a group