1
0
mirror of git://sourceware.org/git/lvm2.git synced 2024-12-21 13:34:40 +03:00

libdm: improve check in dm_split_lvm_name

We support both type of call - with or without mem pool.
So ensure we will not use NULL vgname also when mem is given.
This commit is contained in:
Zdenek Kabelac 2013-04-21 12:48:24 +02:00
parent a2b76a6f02
commit 8f1dd00c36

View 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)));