mirror of
https://gitlab.freedesktop.org/libbsd/libbsd.git
synced 2025-01-08 11:02:24 +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);
|
assert(uname != NULL);
|
||||||
|
|
||||||
gr = getgrgid(0);
|
gr = getgrgid(0);
|
||||||
if (gr == NULL)
|
if (gr == NULL) {
|
||||||
|
free(uname);
|
||||||
return TEST_SKIP;
|
return TEST_SKIP;
|
||||||
|
}
|
||||||
gname = strdup(gr->gr_name);
|
gname = strdup(gr->gr_name);
|
||||||
assert(gname != NULL);
|
assert(gname != NULL);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user