]> err.no Git - util-linux/commitdiff
libblkid: fix memory leak
authorIgor Bazhitov <igor.bazhitov@gmail.com>
Sat, 9 Oct 2010 18:54:31 +0000 (22:54 +0400)
committerKarel Zak <kzak@redhat.com>
Thu, 21 Oct 2010 07:45:05 +0000 (09:45 +0200)
search_type and search_handle fields of blkid_dev_iterate iterator are
not being freed after usage.
Add cleanup code.

Signed-off-by: Igor Bazhitov <igor.bazhitov@gmail.com>
shlibs/blkid/src/dev.c

index 24d989ddc938ee8f3dd1fe22dbfbad87d6a8f4fa..791a6c18112ece2a177124610ac5916998a0900b 100644 (file)
@@ -193,6 +193,8 @@ extern void blkid_dev_iterate_end(blkid_dev_iterate iter)
        if (!iter || iter->magic != DEV_ITERATE_MAGIC)
                return;
        iter->magic = 0;
+       free(iter->search_type);
+       free(iter->search_value);
        free(iter);
 }