forked from Imagelibrary/rtems
libdl: Fix allocator NULL check (Coverity 1255328) refs #2191
The address returned from the allocator call was not checked when zeroing the memory.
This commit is contained in:
@@ -61,7 +61,7 @@ rtems_rtl_alloc_new (rtems_rtl_alloc_tag_t tag, size_t size, bool zero)
|
||||
printf ("rtl: alloc: new: %s addr=%p size=%zu\n",
|
||||
rtems_rtl_trace_tag_label (tag), address, size);
|
||||
|
||||
if (zero)
|
||||
if (address && zero)
|
||||
memset (address, 0, size);
|
||||
|
||||
return address;
|
||||
|
||||
Reference in New Issue
Block a user