mirror of
https://gitlab.freedesktop.org/libbsd/libbsd.git
synced 2025-01-07 17:52:34 +01:00
test: Fix short-lived memory leak
Warned-by: cppcheck
This commit is contained in:
parent
3f5ca0aae4
commit
a44f885cd4
@ -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);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user