Skip to content

Commit 8da0aea

Browse files
committed
Removed signal protection (set to NULL before free() to avoid dangling pointers)
1 parent 87f0f77 commit 8da0aea

File tree

1 file changed

+4
-8
lines changed

1 file changed

+4
-8
lines changed

main/main.c

+4-8
Original file line numberDiff line numberDiff line change
@@ -982,20 +982,16 @@ static ZEND_COLD void php_error_cb(int type, const char *error_filename, const u
982982

983983
/* store the error if it has changed */
984984
if (display) {
985-
#ifdef ZEND_SIGNALS
986-
HANDLE_BLOCK_INTERRUPTIONS();
987-
#endif
988985
if (PG(last_error_message)) {
989-
free(PG(last_error_message));
986+
char *s = PG(last_error_message);
990987
PG(last_error_message) = NULL;
988+
free(s);
991989
}
992990
if (PG(last_error_file)) {
993-
free(PG(last_error_file));
991+
char *s = PG(last_error_file);
994992
PG(last_error_file) = NULL;
993+
free(s);
995994
}
996-
#ifdef ZEND_SIGNALS
997-
HANDLE_UNBLOCK_INTERRUPTIONS();
998-
#endif
999995
if (!error_filename) {
1000996
error_filename = "Unknown";
1001997
}

0 commit comments

Comments
 (0)