summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDmitry Stogov <dmitry@zend.com>2015-08-28 15:32:50 +0300
committerDmitry Stogov <dmitry@zend.com>2015-08-28 15:32:50 +0300
commit8da0aeaa13a14aeba6a51a534c9605d20753cf76 (patch)
tree67d65d4c663b368a89b977d927809d5a83d5ee49
parent87f0f77105eb940d0eca63b7c889c136e9ce2a48 (diff)
downloadphp-git-8da0aeaa13a14aeba6a51a534c9605d20753cf76.tar.gz
Removed signal protection (set to NULL before free() to avoid dangling pointers)
-rw-r--r--main/main.c12
1 files 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";
}