From e7a8c2b0e580b9445b2f390a21bb07251a04b30c Mon Sep 17 00:00:00 2001 From: Alejandro Colomar Date: Sat, 7 Dec 2024 01:34:41 +0100 Subject: [PATCH] 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 --- lib/sgetgrent.c | 3 +++ 1 file changed, 3 insertions(+) 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 -- 2.47.3