From: Guillem Jover Date: Tue, 14 Nov 2023 18:08:15 +0000 (+0100) Subject: test: Fix short-lived memory leak X-Git-Tag: 0.11.8~6 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a44f885cd476faee2154cbae1a1dc47bdeaea727;p=thirdparty%2Flibbsd.git 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);