While commit 960bb238 fixed one memory leak, it created another.

Fixes: 960bb238 ("kpartx: Fix memory leak of uuid found by coverity")
Signed-off-by: Benjamin Marzinski <bmarz...@redhat.com>
---
 kpartx/devmapper.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/kpartx/devmapper.c b/kpartx/devmapper.c
index 8db1eb5..3aa4988 100644
--- a/kpartx/devmapper.c
+++ b/kpartx/devmapper.c
@@ -690,6 +690,7 @@ int dm_find_part(const char *parent, const char *delim, int 
part,
 
        r = dm_rename(tmp, name);
        if (r == 1) {
+               free(tmp);
                *part_uuid = uuid;
                return 1;
        }
-- 
2.7.4

--
dm-devel mailing list
dm-devel@redhat.com
https://www.redhat.com/mailman/listinfo/dm-devel

Reply via email to