diff options
author | Corinna Vinschen <corinna@vinschen.de> | 2013-06-24 11:34:03 +0000 |
---|---|---|
committer | Corinna Vinschen <corinna@vinschen.de> | 2013-06-24 11:34:03 +0000 |
commit | 837a83bf1c0ea8315825b903075ba279997e5e8c (patch) | |
tree | 3d9e380a9441a14ae0b3422d8df27eeadf14005f /newlib/libc/reent | |
parent | 99943e12c851ac566448525b5aaa5c9098041b31 (diff) | |
download | newlib-837a83bf1c0ea8315825b903075ba279997e5e8c.zip newlib-837a83bf1c0ea8315825b903075ba279997e5e8c.tar.gz newlib-837a83bf1c0ea8315825b903075ba279997e5e8c.tar.bz2 |
* libc/reent/reent.c (_reclaim_reent): Free also _misc and
_signal_buf.
Diffstat (limited to 'newlib/libc/reent')
-rw-r--r-- | newlib/libc/reent/reent.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/newlib/libc/reent/reent.c b/newlib/libc/reent/reent.c index 9f5a8c0..b6c2abf 100644 --- a/newlib/libc/reent/reent.c +++ b/newlib/libc/reent/reent.c @@ -87,6 +87,10 @@ _DEFUN (_reclaim_reent, (ptr), _free_r (ptr, ptr->_localtime_buf); if (ptr->_asctime_buf) _free_r (ptr, ptr->_asctime_buf); + if (ptr->_signal_buf) + _free_r (ptr, ptr->_signal_buf); + if (ptr->_misc) + _free_r (ptr, ptr->_misc); #endif #ifndef _REENT_GLOBAL_ATEXIT @@ -110,6 +114,11 @@ _DEFUN (_reclaim_reent, (ptr), if (ptr->_cvtbuf) _free_r (ptr, ptr->_cvtbuf); + /* We should free _sig_func to avoid a memory leak, but how to + do it safely considering that a signal may be delivered immediately + after the free? + if (ptr->_sig_func) + _free_r (ptr, ptr->_sig_func);*/ if (ptr->__sdidinit) { |