diff options
author | Jan Kratochvil <jan.kratochvil@redhat.com> | 2011-06-29 20:51:10 +0000 |
---|---|---|
committer | Jan Kratochvil <jan.kratochvil@redhat.com> | 2011-06-29 20:51:10 +0000 |
commit | 685e9fd1355b9b7c125056f6e1a8b001a14801d2 (patch) | |
tree | 098a6f4abd71171a42b6408eb357573c559ac4e6 /readline/xfree.c | |
parent | f7956ea4e1b85fbdb003cd7746a5a7794675eeec (diff) | |
download | gdb-685e9fd1355b9b7c125056f6e1a8b001a14801d2.tar.gz |
readline/
Avoid free from a signal handler.
* Makefile.in (xfree.o): Add readline.h.
* xfree.c: Include stdio.h and readline.h.
(xfree): Return on RL_STATE_SIGHANDLER.
* xmalloc.h (xfree): New definition.
Diffstat (limited to 'readline/xfree.c')
-rw-r--r-- | readline/xfree.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/readline/xfree.c b/readline/xfree.c index 37a81e6c236..d3af7d9aef0 100644 --- a/readline/xfree.c +++ b/readline/xfree.c @@ -31,7 +31,10 @@ # include "ansi_stdlib.h" #endif /* HAVE_STDLIB_H */ +#include <stdio.h> + #include "xmalloc.h" +#include "readline.h" /* **************************************************************** */ /* */ @@ -45,6 +48,10 @@ void xfree (string) PTR_T string; { + /* Leak a bit. */ + if (RL_ISSTATE(RL_STATE_SIGHANDLER)) + return; + if (string) free (string); } |