]> sourceware.org Git - lvm2.git/commitdiff
dmsetup: fix memleak in _get_split_name
authorZdenek Kabelac <zkabelac@redhat.com>
Thu, 16 Aug 2012 18:12:38 +0000 (20:12 +0200)
committerZdenek Kabelac <zkabelac@redhat.com>
Thu, 23 Aug 2012 12:36:10 +0000 (14:36 +0200)
Free allocated buffer in _get_split_name error path.

WHATS_NEW_DM
tools/dmsetup.c

index 3890ea4fb38a8b260432cbb1e8d99a8b7f4d9f5a..186a2e155833c512b00b4efa34db2cb0a016df9f 100644 (file)
@@ -1,3 +1,7 @@
+Version 1.02.77 -
+=================================
+  Fix memory leak in dmsetup _get_split_name() error path.
+
 Version 1.02.76 - 7th August 2012
 =================================
   Add dm_vasprintf to libdevmapper.
index 5422f0b3973020e0f3355b401ccf47455db07f0c..7a632c74e4fe9da9d708df95eaab9123aa3d19b7 100644 (file)
@@ -380,8 +380,10 @@ static struct dm_split_name *_get_split_name(const char *uuid, const char *name,
                return NULL;
        }
 
-       if (!(split_name->subsystem = _extract_uuid_prefix(uuid, separator)))
+       if (!(split_name->subsystem = _extract_uuid_prefix(uuid, separator))) {
+               dm_free(split_name);
                return_NULL;
+       }
 
        split_name->vg_name = split_name->lv_name =
            split_name->lv_layer = (char *) "";
This page took 0.045082 seconds and 5 git commands to generate.