From: Dmitry Stogov Date: Fri, 28 Aug 2015 12:32:50 +0000 (+0300) Subject: Removed signal protection (set to NULL before free() to avoid dangling pointers) X-Git-Tag: php-7.0.0RC2~2^2~45 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=8da0aeaa13a14aeba6a51a534c9605d20753cf76;p=php Removed signal protection (set to NULL before free() to avoid dangling pointers) --- 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"; }