]> granicus.if.org Git - php/commitdiff
Removed signal protection (set to NULL before free() to avoid dangling pointers)
authorDmitry Stogov <dmitry@zend.com>
Fri, 28 Aug 2015 12:32:50 +0000 (15:32 +0300)
committerDmitry Stogov <dmitry@zend.com>
Fri, 28 Aug 2015 12:32:50 +0000 (15:32 +0300)
main/main.c

index 911eb8408c5a912a31f646076608013eb105ff1a..149a1ac951ac5084687186432aae1fac58cf0058 100644 (file)
@@ -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";
                }