[PATCH 2/2] kpartx: fix new memory leak in dm_find_part

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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 <bmarzins@xxxxxxxxxx>
---
 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@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/dm-devel



[Index of Archives]     [DM Crypt]     [Fedora Desktop]     [ATA RAID]     [Fedora Marketing]     [Fedora Packaging]     [Fedora SELinux]     [Yosemite Discussion]     [KDE Users]     [Fedora Docs]

  Powered by Linux