From: Karel Zak Date: Wed, 5 Oct 2016 09:20:26 +0000 (+0200) Subject: swapoff: fix mem leak [coverity scan] X-Git-Tag: v2.29-rc2~21 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=eeea7ef59035f22e049b2cb1b295f44ef7e236ea;p=thirdparty%2Futil-linux.git swapoff: fix mem leak [coverity scan] --- diff --git a/sys-utils/swapoff.c b/sys-utils/swapoff.c index 562b24f337..dd3bf05fc1 100644 --- a/sys-utils/swapoff.c +++ b/sys-utils/swapoff.c @@ -89,8 +89,11 @@ static int do_swapoff(const char *orig_special, int quiet, int canonic) char *n, *v; special = mnt_resolve_spec(orig_special, mntcache); - if (!special && blkid_parse_tag_string(orig_special, &n, &v) == 0) + if (!special && blkid_parse_tag_string(orig_special, &n, &v) == 0) { special = swapoff_resolve_tag(n, v, mntcache); + free(n); + free(v); + } if (!special) return cannot_find(orig_special); }