com php-src: Removed signal protection (set to NULL before free() to avoid dangling pointers): main/main.c
| From: | Dmitry Stogov | Date: | Fri, 28 Aug 2015 12:32:50 +0000 |
| Subject: | com php-src: Removed signal protection (set to NULL before free() to avoid dangling pointers): main/main.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-88792@lists.php.net to get a copy of this message | ||
Commit: 8da0aeaa13a14aeba6a51a534c9605d20753cf76
Author: Dmitry Stogov <dmitry@zend.com> Fri, 28 Aug 2015 15:32:50 +0300
Parents: 87f0f77105eb940d0eca63b7c889c136e9ce2a48
Branches: master
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=8da0aeaa13a14aeba6a51a534c9605d20753cf76
Log:
Removed signal protection (set to NULL before free() to avoid dangling pointers)
Changed paths:
M main/main.c
Diff:
diff --git a/main/main.c b/main/main.c
index 911eb84..149a1ac 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";
}