test: Fix short-lived memory leak Warned-by: cppcheck
diff --git a/test/pwcache.c b/test/pwcache.c
index ac1e67b..458903f 100644
--- a/test/pwcache.c
+++ b/test/pwcache.c
@@ -50,8 +50,10 @@ main(int argc, char **argv)
assert(uname != NULL);
gr = getgrgid(0);
- if (gr == NULL)
+ if (gr == NULL) {
+ free(uname);
return TEST_SKIP;
+ }
gname = strdup(gr->gr_name);
assert(gname != NULL);