test: Fix short-lived memory leak

Warned-by: cppcheck
This commit is contained in:
Guillem Jover 2023-11-14 19:08:15 +01:00
parent 3f5ca0aae4
commit a44f885cd4

View File

@ -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);