mirror of
git://sourceware.org/git/lvm2.git
synced 2024-12-21 13:34:40 +03:00
libdm: check for null from pool strdup
Unlikely to happen, but Coverity shown we may have possible derefer NULL pointer.
This commit is contained in:
parent
422c7474ca
commit
d4288c9bdf
@ -1,5 +1,6 @@
|
|||||||
Version 1.02.111 -
|
Version 1.02.111 -
|
||||||
====================================
|
====================================
|
||||||
|
Add missing check for allocation inside dm_split_lvm_name().
|
||||||
Test dm_task_get_message_response for !NULL in dm_stats_print_region().
|
Test dm_task_get_message_response for !NULL in dm_stats_print_region().
|
||||||
Add checks for failing dm_stats_create() in dmsetup.
|
Add checks for failing dm_stats_create() in dmsetup.
|
||||||
Add missing fifo close when failed to initialize client connection.
|
Add missing fifo close when failed to initialize client connection.
|
||||||
|
@ -95,8 +95,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)
|
if (mem && !(*vgname = dm_pool_strdup(mem, dmname))) {
|
||||||
*vgname = dm_pool_strdup(mem, dmname);
|
log_error("Failed to duplicate dmname.");
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
if (!*vgname)
|
if (!*vgname)
|
||||||
return 0;
|
return 0;
|
||||||
|
Loading…
Reference in New Issue
Block a user