From 65096e5cf330be0eaed449c5ec44afb50225e41f Mon Sep 17 00:00:00 2001 From: Peng Fan Date: Wed, 31 Jul 2013 20:06:55 +0800 Subject: assign NULL to free pointer Signed-off-by: Peng Fan --- rtl-alloc-heap.c | 3 +++ 1 file changed, 3 insertions(+) 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; + } } -- cgit v1.2.3