Hi all,
I found a leak in gpt.c source and I try to fix it.
See my attached file.

Regards,
Manuele
=== modified file 'uspace/lib/label/src/gpt.c'
--- uspace/lib/label/src/gpt.c	2015-11-04 18:39:51 +0000
+++ uspace/lib/label/src/gpt.c	2016-03-15 12:50:21 +0000
@@ -823,8 +823,10 @@
 
 	b0 = uint64_t_le2host(pte->start_lba);
 	b1 = uint64_t_le2host(pte->end_lba);
-	if (b1 <= b0)
+	if (b1 <= b0) {
+		free(part);
 		return EINVAL;
+	}
 
 	part->index = index;
 	part->block0 = b0;

_______________________________________________
HelenOS-devel mailing list
[email protected]
http://lists.modry.cz/listinfo/helenos-devel

Reply via email to