]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
libmount: fix memory leak [coverity scan]
authorKarel Zak <kzak@redhat.com>
Wed, 17 May 2017 10:38:16 +0000 (12:38 +0200)
committerKarel Zak <kzak@redhat.com>
Wed, 17 May 2017 10:38:16 +0000 (12:38 +0200)
Signed-off-by: Karel Zak <kzak@redhat.com>
libmount/src/context_umount.c

index a2bba8060fc98026cd7ace7b40c3d06894d813bf..e663a703cca013e72d8eb86ffe0647af2fda2b2b 100644 (file)
@@ -337,6 +337,7 @@ static int prepare_helper_from_options(struct libmnt_context *cxt,
        char *suffix = NULL;
        const char *opts;
        size_t valsz;
+       int rc;
 
        if (mnt_context_is_nohelpers(cxt))
                return 0;
@@ -354,7 +355,10 @@ static int prepare_helper_from_options(struct libmnt_context *cxt,
 
        DBG(CXT, ul_debugobj(cxt, "umount: umount.%s %s requested", suffix, name));
 
-       return mnt_context_prepare_helper(cxt, "umount", suffix);
+       rc = mnt_context_prepare_helper(cxt, "umount", suffix);
+       free(suffix);
+
+       return rc;
 }
 
 /*