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

[lvm-devel] LVM2/libdm/ioctl libdm-iface.c



CVSROOT:	/cvs/lvm2
Module name:	LVM2
Changes by:	snitzer sourceware org	2011-11-08 19:02:21

Modified files:
	libdm/ioctl    : libdm-iface.c 

Log message:
	Add missing free() for line that is malloc()'d by getline().

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/libdm/ioctl/libdm-iface.c.diff?cvsroot=lvm2&r1=1.127&r2=1.128

--- LVM2/libdm/ioctl/libdm-iface.c	2011/11/08 17:32:11	1.127
+++ LVM2/libdm/ioctl/libdm-iface.c	2011/11/08 19:02:21	1.128
@@ -172,7 +172,7 @@
 {
 	FILE *fl;
 	char nm[256];
-	char *line;
+	char *line = NULL;
 	size_t len;
 	uint32_t num;
 
@@ -188,6 +188,7 @@
 					*number = num;
 					if (fclose(fl))
 						log_sys_error("fclose", file);
+					free(line);
 					return 1;
 				}
 				dm_bit_set(_dm_bitset, num);
@@ -196,6 +197,7 @@
 	}
 	if (fclose(fl))
 		log_sys_error("fclose", file);
+	free(line);
 
 	if (number) {
 		log_error("%s: No entry for %s found", file, name);


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