Skip to content

Commit

Permalink
Partial revert of 6a819bb.
Browse files Browse the repository at this point in the history
  • Loading branch information
dstogov committed May 13, 2015
1 parent 5a1bef8 commit f69b30e
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions ext/standard/basic_functions.c
Original file line number Diff line number Diff line change
Expand Up @@ -4740,11 +4740,11 @@ PHP_FUNCTION(error_clear_last)
PG(last_error_type) = 0;
PG(last_error_lineno) = 0;

efree(PG(last_error_message));
free(PG(last_error_message));
PG(last_error_message) = NULL;

if (PG(last_error_file)) {
efree(PG(last_error_file));
free(PG(last_error_file));
PG(last_error_file) = NULL;
}
}
Expand Down
12 changes: 6 additions & 6 deletions main/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -990,11 +990,11 @@ static void php_error_cb(int type, const char *error_filename, const uint error_
HANDLE_BLOCK_INTERRUPTIONS();
#endif
if (PG(last_error_message)) {
efree(PG(last_error_message));
free(PG(last_error_message));
PG(last_error_message) = NULL;
}
if (PG(last_error_file)) {
efree(PG(last_error_file));
free(PG(last_error_file));
PG(last_error_file) = NULL;
}
#ifdef ZEND_SIGNALS
Expand All @@ -1004,8 +1004,8 @@ static void php_error_cb(int type, const char *error_filename, const uint error_
error_filename = "Unknown";
}
PG(last_error_type) = type;
PG(last_error_message) = estrdup(buffer);
PG(last_error_file) = estrdup(error_filename);
PG(last_error_message) = strdup(buffer);
PG(last_error_file) = strdup(error_filename);
PG(last_error_lineno) = error_lineno;
}

Expand Down Expand Up @@ -1399,11 +1399,11 @@ static zval *php_get_configuration_directive_for_zend(zend_string *name)
static void php_free_request_globals(void)
{
if (PG(last_error_message)) {
efree(PG(last_error_message));
free(PG(last_error_message));
PG(last_error_message) = NULL;
}
if (PG(last_error_file)) {
efree(PG(last_error_file));
free(PG(last_error_file));
PG(last_error_file) = NULL;
}
if (PG(php_sys_temp_dir)) {
Expand Down

0 comments on commit f69b30e

Please sign in to comment.