mirror of
git://sourceware.org/git/lvm2.git
synced 2024-12-21 13:34:40 +03:00
cache: check for internal error
Don't try to duplicate NULL on internal error path.
This commit is contained in:
parent
e55c6999ae
commit
9f2961f259
@ -130,7 +130,12 @@ char *lvseg_discards_dup(struct dm_pool *mem, const struct lv_segment *seg)
|
||||
|
||||
char *lvseg_cachemode_dup(struct dm_pool *mem, const struct lv_segment *seg)
|
||||
{
|
||||
return dm_pool_strdup(mem, get_cache_pool_cachemode_name(seg));
|
||||
const char *name = get_cache_pool_cachemode_name(seg);
|
||||
|
||||
if (!name)
|
||||
return_NULL;
|
||||
|
||||
return dm_pool_strdup(mem, name);
|
||||
}
|
||||
|
||||
#ifdef DMEVENTD
|
||||
|
Loading…
Reference in New Issue
Block a user