]> git.ipfire.org Git - thirdparty/util-linux.git/blobdiff - sys-utils/swapoff.c
swapoff: fix mem leak [coverity scan]
[thirdparty/util-linux.git] / sys-utils / swapoff.c
index 562b24f337cdbd30a777515f7307f08d65c7502f..dd3bf05fc14037431d5901024b788fcf63255cfb 100644 (file)
@@ -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);
        }