tests: Make sure that current_grp is initialized
authorAndreas Schneider <asn@samba.org>
Mon, 17 Feb 2020 08:34:31 +0000 (09:34 +0100)
committerAndreas Schneider <asn@samba.org>
Mon, 17 Feb 2020 08:34:31 +0000 (09:34 +0100)
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Isaac Boukris <iboukris@samba.org>
tests/testsuite.c

index a423c55af06e33ba0f85c522064cf2f5c07bc35c..bf678fd39729f9b2c3bf22cbde551ae74138ce65 100644 (file)
@@ -812,8 +812,10 @@ static bool test_nwrap_membership_user(const struct passwd *pwd,
                struct group grp = grp_array[i];
 
                if (test_nwrap_user_in_group(pwd, &grp)) {
+                       struct group current_grp = {
+                               .gr_name = NULL,
+                       };
 
-                       struct group current_grp;
                        num_user_groups_from_enum++;
 
                        test_nwrap_getgrnam(grp.gr_name, &current_grp);