diff options
author | Karel Zak | 2016-10-05 11:20:26 +0200 |
---|---|---|
committer | Karel Zak | 2016-10-05 11:20:26 +0200 |
commit | eeea7ef59035f22e049b2cb1b295f44ef7e236ea (patch) | |
tree | 9efff14b4b748e6166c39c5ce32e0b030f4dd139 /sys-utils/swapoff.c | |
parent | setarch: let's keep analyzer happy [coverity scan] (diff) | |
download | kernel-qcow2-util-linux-eeea7ef59035f22e049b2cb1b295f44ef7e236ea.tar.gz kernel-qcow2-util-linux-eeea7ef59035f22e049b2cb1b295f44ef7e236ea.tar.xz kernel-qcow2-util-linux-eeea7ef59035f22e049b2cb1b295f44ef7e236ea.zip |
swapoff: fix mem leak [coverity scan]
Diffstat (limited to 'sys-utils/swapoff.c')
-rw-r--r-- | sys-utils/swapoff.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/sys-utils/swapoff.c b/sys-utils/swapoff.c index 562b24f33..dd3bf05fc 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); } |