Skip to content

Commit 0a60650

Browse files
committed
lvm.c: Fix "use after free" in 'bd_lvm_get_thpool_meta_size'
1 parent fcc7ede commit 0a60650

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/plugins/lvm.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -682,14 +682,16 @@ guint64 bd_lvm_get_thpool_meta_size (guint64 size, guint64 chunk_size, guint64 n
682682
}
683683

684684
ret = g_ascii_strtoull (output, NULL, 0);
685-
g_free (output);
686685
if (ret == 0) {
687686
g_set_error (error, BD_LVM_ERROR, BD_LVM_ERROR_PARSE,
688687
"Failed to parse number from thin_metadata_size's output: '%s'",
689688
output);
689+
g_free (output);
690690
return 0;
691691
}
692692

693+
g_free (output);
694+
693695
return MAX (ret, BD_LVM_MIN_THPOOL_MD_SIZE);
694696
}
695697

0 commit comments

Comments
 (0)