diff options
author | Karel Zak <kzak@redhat.com> | 2016-10-05 11:20:26 +0200 |
---|---|---|
committer | Karel Zak <kzak@redhat.com> | 2016-10-05 11:20:26 +0200 |
commit | eeea7ef59035f22e049b2cb1b295f44ef7e236ea (patch) | |
tree | 9efff14b4b748e6166c39c5ce32e0b030f4dd139 | |
parent | 9a8fada18bf81e820c649f0c56a57959ecf59484 (diff) | |
download | util-linux-eeea7ef59035f22e049b2cb1b295f44ef7e236ea.tar.gz |
swapoff: fix mem leak [coverity scan]
-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 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); } |