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:
Chris Johns
2014-11-20 08:30:01 +11:00
parent 724eb8c410
commit 90f65007e9

View File

@@ -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;