[lvm-devel] master - lv_manip: check for str_list_dup failure

Zdenek Kabelac zkabelac at fedoraproject.org
Tue Aug 19 14:18:51 UTC 2014


Gitweb:        http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=dec39b1a5f0f599fd751bc6cea8caaac8a211d31
Commit:        dec39b1a5f0f599fd751bc6cea8caaac8a211d31
Parent:        cdb16a603954a1a3771644a101d0b372f8e0826c
Author:        Zdenek Kabelac <zkabelac at redhat.com>
AuthorDate:    Tue Aug 19 14:27:03 2014 +0200
Committer:     Zdenek Kabelac <zkabelac at redhat.com>
CommitterDate: Tue Aug 19 14:33:06 2014 +0200

lv_manip: check for str_list_dup failure

---
 lib/metadata/lv_manip.c |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/lib/metadata/lv_manip.c b/lib/metadata/lv_manip.c
index c314377..db70818 100644
--- a/lib/metadata/lv_manip.c
+++ b/lib/metadata/lv_manip.c
@@ -470,8 +470,9 @@ int lv_layout_and_type(struct dm_pool *mem, const struct logical_volume *lv,
 	 * device that is not combined with any other type. So just copy what
 	 * we have set for "layout" and use it for "type" too.
 	 */
-	if (dm_list_empty(*type))
-		str_list_dup(mem, *type, *layout);
+	if (dm_list_empty(*type) &&
+	    !str_list_dup(mem, *type, *layout))
+                goto_bad;
 
 	return 1;
 bad:




More information about the lvm-devel mailing list