Fix for NULL pointer dereference defect.
Pointer 'st' returned from call to function 'malloc' at line 320 may be NULL and it will be dereferenced at line 321. Signed-off-by: Artur Wojcik <artur.wojcik@intel.com> Signed-off-by: Dan Williams <dan.j.williams@intel.com>
This commit is contained in:
parent
c3ca5f6028
commit
4e9d21862d
|
@ -318,6 +318,8 @@ static struct supertype *match_metadata_desc_imsm(char *arg)
|
|||
return NULL;
|
||||
|
||||
st = malloc(sizeof(*st));
|
||||
if (!st)
|
||||
return NULL;
|
||||
memset(st, 0, sizeof(*st));
|
||||
st->ss = &super_imsm;
|
||||
st->max_devs = IMSM_MAX_DEVICES;
|
||||
|
|
Loading…
Reference in New Issue