summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeng Fan <van.freenix@gmail.com>2013-07-31 20:06:55 +0800
committerPeng Fan <van.freenix@gmail.com>2013-09-05 13:47:39 +0800
commit65096e5cf330be0eaed449c5ec44afb50225e41f (patch)
treec5a6b354cf5618332fc1c7971fa453fd438f02ee
parent9be475e0a236178f53e3fd60854bed953ec08a40 (diff)
assign NULL to free pointer
Signed-off-by: Peng Fan <van.freenix@gmail.com>
-rw-r--r--rtl-alloc-heap.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/rtl-alloc-heap.c b/rtl-alloc-heap.c
index 1f3c8dd..44a4816 100644
--- a/rtl-alloc-heap.c
+++ b/rtl-alloc-heap.c
@@ -26,5 +26,8 @@ rtems_rtl_alloc_heap (bool allocate,
if (allocate)
*address = malloc (size);
else
+ {
free (*address);
+ *address = NULL;
+ }
}