Skip to contentSkip to conversation

LVM2/lib/format_text export.c

PATCH [email protected] 1 participant 1 message Jan 25, 2012

lore
Share & tools
lore
#0 lore raw

CVSROOT: /cvs/lvm2
Module name: LVM2
Changes by: zkabelac at sourceware.org 2012-01-25 22:35:36

Modified files:
lib/format_text: export.c

Log message:
Instrument code that pointer are already released

Set pointers to NULL since on the function exit they are no longer valid.

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/format_text/export.c.diff?cvsroot=lvm2&r1=1.85&r2=1.86

lib/format_text/export.c +6 -2
@@ -757,11 +757,15 @@
 	r = 1;
 
       out:
-	if (f->mem)
+	if (f->mem) {
 		dm_pool_destroy(f->mem);
+		f->mem = NULL;
+	}
 
-	if (f->pv_names)
+	if (f->pv_names) {
 		dm_hash_destroy(f->pv_names);
+		f->pv_names = NULL;
+	}
 
 	return r;
 }