Pointer 'this' returned from call to function 'malloc' at line 3795
may be NULL and will be dereferenced at line 3796.
Artur Wojcik <artur.wojcik@intel.com>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
}
this = malloc(sizeof(*this));
+ if (!this) {
+ fprintf(stderr, Name ": failed to allocate %lu bytes\n",
+ sizeof(*this));
+ break;
+ }
memset(this, 0, sizeof(*this));
this->next = rest;
ord = get_imsm_ord_tbl_ent(dev, slot);
for (d = super->disks; d ; d = d->next)
if (d->index == idx)
- break;
+ break;
if (d == NULL)
skip = 1;