]> sourceware.org Git - lvm2.git/commitdiff
libdm: improve check in dm_split_lvm_name
authorZdenek Kabelac <zkabelac@redhat.com>
Sun, 21 Apr 2013 10:48:24 +0000 (12:48 +0200)
committerZdenek Kabelac <zkabelac@redhat.com>
Sun, 21 Apr 2013 21:10:43 +0000 (23:10 +0200)
We support both type of call - with or without mem pool.
So ensure we will not use NULL vgname also when mem is given.

libdm/libdm-string.c

index 5ef633435e415db7ff2e0c762a17ae5747f4984e..9d667bb836bd5a3aa24a98ffa73a11792dc6ae1b 100644 (file)
@@ -92,7 +92,10 @@ static char *_unquote(char *component)
 int dm_split_lvm_name(struct dm_pool *mem, const char *dmname,
                      char **vgname, char **lvname, char **layer)
 {
-       if (mem && !(*vgname = dm_pool_strdup(mem, dmname)))
+       if (mem)
+               *vgname = dm_pool_strdup(mem, dmname);
+
+       if (!*vgname)
                return 0;
 
        _unquote(*layer = _unquote(*lvname = _unquote(*vgname)));
This page took 0.062637 seconds and 5 git commands to generate.