From: Karel Zak Date: Wed, 17 May 2017 10:38:16 +0000 (+0200) Subject: libmount: fix memory leak [coverity scan] X-Git-Tag: v2.30-rc2~20 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=fdaba3eb62b6e7760006119cd9a3765bdb9ff084;p=thirdparty%2Futil-linux.git libmount: fix memory leak [coverity scan] Signed-off-by: Karel Zak --- diff --git a/libmount/src/context_umount.c b/libmount/src/context_umount.c index a2bba8060f..e663a703cc 100644 --- a/libmount/src/context_umount.c +++ b/libmount/src/context_umount.c @@ -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; } /*