diff options
author | Chris Johns <chrisj@rtems.org> | 2014-11-20 08:38:28 +1100 |
---|---|---|
committer | Chris Johns <chrisj@rtems.org> | 2014-11-20 08:38:28 +1100 |
commit | 80590a8ecffbe3d61a28ccb64d2dc04a0612e52b (patch) | |
tree | 32be3d4498e0ab3e30cb2fd0b3feb5620d5f6d98 /cpukit/libdl | |
parent | libdl: Fix allocator NULL check (Coverity 1255328) refs #2191 (diff) | |
download | rtems-80590a8ecffbe3d61a28ccb64d2dc04a0612e52b.tar.bz2 |
libdl: Add a comment to the previous fix.
The fix is ref #2191.
Diffstat (limited to 'cpukit/libdl')
-rw-r--r-- | cpukit/libdl/rtl-allocator.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/cpukit/libdl/rtl-allocator.c b/cpukit/libdl/rtl-allocator.c index 26044c2c49..ced19d0466 100644 --- a/cpukit/libdl/rtl-allocator.c +++ b/cpukit/libdl/rtl-allocator.c @@ -61,6 +61,9 @@ 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); + /* + * Only zero the memory if asked to and the allocation was successful. + */ if (address && zero) memset (address, 0, size); |