diff options
author | Zdenek Kabelac <zkabelac@redhat.com> | 2012-08-16 20:12:38 +0200 |
---|---|---|
committer | Zdenek Kabelac <zkabelac@redhat.com> | 2012-08-23 14:36:10 +0200 |
commit | 7e318dad427c7d2e6787f9412cf7c4ee761faf9f (patch) | |
tree | 561bae1641398afce265708fba1054125427b3b2 /tools/dmsetup.c | |
parent | 59ca324c35f3898070a5ad4cb0ec267a1eb4a292 (diff) | |
download | lvm2-7e318dad427c7d2e6787f9412cf7c4ee761faf9f.tar.gz lvm2-7e318dad427c7d2e6787f9412cf7c4ee761faf9f.tar.xz lvm2-7e318dad427c7d2e6787f9412cf7c4ee761faf9f.zip |
dmsetup: fix memleak in _get_split_name
Free allocated buffer in _get_split_name error path.
Diffstat (limited to 'tools/dmsetup.c')
-rw-r--r-- | tools/dmsetup.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/tools/dmsetup.c b/tools/dmsetup.c index 5422f0b3..7a632c74 100644 --- a/tools/dmsetup.c +++ b/tools/dmsetup.c @@ -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 *) ""; |