]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
libmount: fix type pointer usage
authorKarel Zak <kzak@redhat.com>
Tue, 3 Feb 2015 13:05:05 +0000 (14:05 +0100)
committerKarel Zak <kzak@redhat.com>
Tue, 3 Feb 2015 13:05:05 +0000 (14:05 +0100)
Signed-off-by: Karel Zak <kzak@redhat.com>
libmount/src/context.c

index dff7a47fd57fe4a9da817c581c363df1d14c0131..c902f396e0d76cd8ab320200d7bc84b6bc51c8a6 100644 (file)
@@ -1718,8 +1718,8 @@ int mnt_context_guess_fstype(struct libmnt_context *cxt)
        rc = mnt_context_guess_srcpath_fstype(cxt, &type);
        if (rc == 0 && type)
                __mnt_fs_set_fstype_ptr(cxt->fs, type);
-
-       free(type);
+       else
+               free(type);
 done:
        DBG(CXT, ul_debugobj(cxt, "FS type: %s [rc=%d]",
                                mnt_fs_get_fstype(cxt->fs), rc));