• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Tags
Aucun tag

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

Commit MetaInfo

Révision0d1b033387342e34b9d3a973dfe40d31dc1a07b4 (tree)
l'heure2011-06-30 05:51:10
AuteurJan Kratochvil <jan.kratochvil@redh...>
CommiterJan Kratochvil

Message de Log

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.

Change Summary

Modification

--- a/readline/ChangeLog.gdb
+++ b/readline/ChangeLog.gdb
@@ -1,3 +1,11 @@
1+2011-06-29 Jan Kratochvil <jan.kratochvil@redhat.com>
2+
3+ Avoid free from a signal handler.
4+ * Makefile.in (xfree.o): Add readline.h.
5+ * xfree.c: Include stdio.h and readline.h.
6+ (xfree): Return on RL_STATE_SIGHANDLER.
7+ * xmalloc.h (xfree): New definition.
8+
19 2011-05-11 Jan Kratochvil <jan.kratochvil@redhat.com>
210
311 Workaround gdb.base/completion.exp regression on readline-6.2.
--- a/readline/Makefile.in
+++ b/readline/Makefile.in
@@ -422,7 +422,7 @@ vi_mode.o: rldefs.h ${BUILD_DIR}/config.h rlconf.h
422422 vi_mode.o: readline.h keymaps.h rltypedefs.h chardefs.h tilde.h
423423 vi_mode.o: history.h ansi_stdlib.h rlstdc.h
424424 xfree.o: ${BUILD_DIR}/config.h
425-xfree.o: ansi_stdlib.h
425+xfree.o: ansi_stdlib.h readline.h
426426 xmalloc.o: ${BUILD_DIR}/config.h
427427 xmalloc.o: ansi_stdlib.h
428428
--- a/readline/xfree.c
+++ b/readline/xfree.c
@@ -31,7 +31,10 @@
3131 # include "ansi_stdlib.h"
3232 #endif /* HAVE_STDLIB_H */
3333
34+#include <stdio.h>
35+
3436 #include "xmalloc.h"
37+#include "readline.h"
3538
3639 /* **************************************************************** */
3740 /* */
@@ -45,6 +48,10 @@ void
4548 xfree (string)
4649 PTR_T string;
4750 {
51+ /* Leak a bit. */
52+ if (RL_ISSTATE(RL_STATE_SIGHANDLER))
53+ return;
54+
4855 if (string)
4956 free (string);
5057 }
--- a/readline/xmalloc.h
+++ b/readline/xmalloc.h
@@ -38,6 +38,9 @@
3838
3939 #endif /* !PTR_T */
4040
41+/* xmalloc and xrealloc should be also protected from RL_STATE_SIGHANDLER. */
42+#define xfree xfree_readline
43+
4144 extern PTR_T xmalloc PARAMS((size_t));
4245 extern PTR_T xrealloc PARAMS((void *, size_t));
4346 extern void xfree PARAMS((void *));