summaryrefslogtreecommitdiffstats
path: root/cpukit/libdl
diff options
context:
space:
mode:
authorChris Johns <chrisj@rtems.org>2014-11-20 08:30:01 +1100
committerChris Johns <chrisj@rtems.org>2014-11-20 08:30:01 +1100
commit90f65007e96b98362aacdc39f6f730956324b94c (patch)
tree780af506c6a12aa66b7320be112803df022c5326 /cpukit/libdl
parentFix type in MAINTAINERS. (diff)
downloadrtems-90f65007e96b98362aacdc39f6f730956324b94c.tar.bz2
libdl: Fix allocator NULL check (Coverity 1255328) refs #2191
The address returned from the allocator call was not checked when zeroing the memory.
Diffstat (limited to 'cpukit/libdl')
-rw-r--r--cpukit/libdl/rtl-allocator.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/cpukit/libdl/rtl-allocator.c b/cpukit/libdl/rtl-allocator.c
index b845013fd8..26044c2c49 100644
--- a/cpukit/libdl/rtl-allocator.c
+++ b/cpukit/libdl/rtl-allocator.c
@@ -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;