]> git.ipfire.org Git - thirdparty/shadow.git/commitdiff
lib/gshadow.c: Remove redundant variables
authorAlejandro Colomar <alx@kernel.org>
Tue, 5 Nov 2024 14:30:41 +0000 (15:30 +0100)
committerSerge Hallyn <serge@hallyn.com>
Fri, 6 Dec 2024 03:20:59 +0000 (21:20 -0600)
Signed-off-by: Alejandro Colomar <alx@kernel.org>
lib/gshadow.c

index 1cd4566e1c3c8c712e58e2bf25e8469f27f55ec2..304c66c44eb3846d8fe51d4151adb87ae6b6cd04 100644 (file)
@@ -28,9 +28,7 @@
 
 
 static /*@null@*/FILE *shadow;
-static /*@null@*//*@only@*/char **members = NULL;
-static /*@null@*//*@only@*/char **admins = NULL;
-static struct sgrp sgroup;
+static struct sgrp  sgroup = {};
 
 #define        FIELDS  4
 
@@ -115,11 +113,11 @@ sgetsgent(const char *string)
        sgroup.sg_name = fields[0];
        sgroup.sg_passwd = fields[1];
 
-       free (admins);
-       free (members);
+       free(sgroup.sg_adm);
+       free(sgroup.sg_mem);
 
-       sgroup.sg_adm = admins  = build_list(fields[2]);
-       sgroup.sg_mem = members = build_list(fields[3]);
+       sgroup.sg_adm = build_list(fields[2]);
+       sgroup.sg_mem = build_list(fields[3]);
 
        return &sgroup;
 }