1
0
mirror of git://sourceware.org/git/lvm2.git synced 2024-12-30 17:18:21 +03:00

libdm: check if passed return pointer is not NULL

Coverity: before storing return value, check passed space will
not dereference NULL pointer.
This commit is contained in:
Zdenek Kabelac 2015-11-16 00:13:10 +01:00
parent dd9a05b5ae
commit 422c7474ca

View File

@ -2692,13 +2692,15 @@ static const char *_tok_value_string_list(const struct dm_report_field_type *ft,
dm_free(arr);
out:
*end = s;
*sel_str_list = ssl;
if (*sel_str_list)
*sel_str_list = ssl;
return s;
bad:
*end = s;
if (ssl)
dm_pool_free(mem, ssl);
*sel_str_list = NULL;
if (*sel_str_list)
*sel_str_list = NULL;
return s;
}