]> git.ipfire.org Git - thirdparty/shadow.git/commitdiff
lib/sgetgrent.c: list(): Explicitly free(3) at the start of the function
authorAlejandro Colomar <alx@kernel.org>
Sat, 7 Dec 2024 00:34:41 +0000 (01:34 +0100)
committerAlejandro Colomar <foss+github@alejandro-colomar.es>
Sat, 7 Jun 2025 14:52:03 +0000 (16:52 +0200)
This makes it clear we wipe anything that was in the buffer.

Signed-off-by: Alejandro Colomar <alx@kernel.org>
lib/sgetgrent.c

index 8737cebb6e341ab1f780fd553e40f416c1fe1467..20048502ab42e5b326dc00fe9e147f3dd39c464b 100644 (file)
@@ -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