]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
setpwnam: fix memory leak
authorSami Kerola <kerolasa@iki.fi>
Sun, 3 Apr 2016 16:39:41 +0000 (17:39 +0100)
committerKarel Zak <kzak@redhat.com>
Tue, 14 Jun 2016 09:21:04 +0000 (11:21 +0200)
Found with scan-build.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
login-utils/setpwnam.c

index 9f39d018129a34d8ca0fa71be6ce72b420e2905a..0616c7923655b5192c2f10d9e46e0bc3466b80aa 100644 (file)
@@ -166,6 +166,7 @@ int setpwnam(struct passwd *pwd, const char *prefix)
                goto fail;
        /* finally:  success */
        ulckpwdf();
+       free(linebuf);
        return 0;
 
  fail: