diff options
author | Peng Fan <van.freenix@gmail.com> | 2013-07-31 20:06:55 +0800 |
---|---|---|
committer | Peng Fan <van.freenix@gmail.com> | 2013-09-05 13:47:39 +0800 |
commit | 65096e5cf330be0eaed449c5ec44afb50225e41f (patch) | |
tree | c5a6b354cf5618332fc1c7971fa453fd438f02ee /rtl-alloc-heap.c | |
parent | 9be475e0a236178f53e3fd60854bed953ec08a40 (diff) |
assign NULL to free pointer
Signed-off-by: Peng Fan <van.freenix@gmail.com>
Diffstat (limited to 'rtl-alloc-heap.c')
-rw-r--r-- | rtl-alloc-heap.c | 3 |
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; + } } |