From 8da0aeaa13a14aeba6a51a534c9605d20753cf76 Mon Sep 17 00:00:00 2001 From: Dmitry Stogov Date: Fri, 28 Aug 2015 15:32:50 +0300 Subject: [PATCH] Removed signal protection (set to NULL before free() to avoid dangling pointers) --- main/main.c | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/main/main.c b/main/main.c index 911eb8408c..149a1ac951 100644 --- a/main/main.c +++ b/main/main.c @@ -982,20 +982,16 @@ static ZEND_COLD void php_error_cb(int type, const char *error_filename, const u /* store the error if it has changed */ if (display) { -#ifdef ZEND_SIGNALS - HANDLE_BLOCK_INTERRUPTIONS(); -#endif if (PG(last_error_message)) { - free(PG(last_error_message)); + char *s = PG(last_error_message); PG(last_error_message) = NULL; + free(s); } if (PG(last_error_file)) { - free(PG(last_error_file)); + char *s = PG(last_error_file); PG(last_error_file) = NULL; + free(s); } -#ifdef ZEND_SIGNALS - HANDLE_UNBLOCK_INTERRUPTIONS(); -#endif if (!error_filename) { error_filename = "Unknown"; } -- 2.50.1