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:
parent
a2b76a6f02
commit
8f1dd00c36
@ -92,7 +92,10 @@ static char *_unquote(char *component)
|
|||||||
int dm_split_lvm_name(struct dm_pool *mem, const char *dmname,
|
int dm_split_lvm_name(struct dm_pool *mem, const char *dmname,
|
||||||
char **vgname, char **lvname, char **layer)
|
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;
|
return 0;
|
||||||
|
|
||||||
_unquote(*layer = _unquote(*lvname = _unquote(*vgname)));
|
_unquote(*layer = _unquote(*lvname = _unquote(*vgname)));
|
||||||
|
Loading…
Reference in New Issue
Block a user