Skip to contentSkip to conversation

LVM2 ./WHATS_NEW lib/format_text/format-text.c

PATCH [email protected] 1 participant 1 message Sep 30, 2008

lore
Share & tools
lore
#0 lore raw

CVSROOT: /cvs/lvm2
Module name: LVM2
Changes by: agk at sourceware.org 2008-09-30 20:37:53

Modified files:
. : WHATS_NEW
lib/format_text: format-text.c

Log message:
Free text metadata buffer after a failure writing it.

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/WHATS_NEW.diff?cvsroot=lvm2&r1=1.968&r2=1.969
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/format_text/format-text.c.diff?cvsroot=lvm2&r1=1.95&r2=1.96

WHATS_NEW +1 -0
@@ -1,5 +1,6 @@
 Version 2.02.41 -
 =====================================
+  Free text metadata buffer after a failure writing it.
   Fix misleading error message when there is no allocatable extents in VG.
   Fix handling of PVs which reappeared with old metadata version.
   Fix mirror DSO to call vgreduce with proper parameters.
lib/format_text/format-text.c +9 -2
@@ -597,8 +597,15 @@
 	r = 1;
 
       out:
-	if (!r && !dev_close(mdac->area.dev))
-		stack;
+	if (!r) {
+		if (!dev_close(mdac->area.dev))
+			stack;
+
+                if (fidtc->raw_metadata_buf) {
+                        dm_free(fidtc->raw_metadata_buf);
+                        fidtc->raw_metadata_buf = NULL;
+                }
+	}
 
 	return r;
 }