summaryrefslogtreecommitdiff
path: root/main/php_open_temporary_file.c
diff options
context:
space:
mode:
Diffstat (limited to 'main/php_open_temporary_file.c')
-rw-r--r--main/php_open_temporary_file.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/main/php_open_temporary_file.c b/main/php_open_temporary_file.c
index 16b61b8ba7..ebe5350ef2 100644
--- a/main/php_open_temporary_file.c
+++ b/main/php_open_temporary_file.c
@@ -124,11 +124,11 @@ static int php_do_open_temporary_file(const char *path, const char *pfx, char **
cwd[0] = '\0';
}
- new_state.cwd = strdup(cwd);
+ new_state.cwd = estrdup(cwd);
new_state.cwd_length = strlen(cwd);
if (virtual_file_ex(&new_state, path, NULL, CWD_REALPATH TSRMLS_CC)) {
- free(new_state.cwd);
+ efree(new_state.cwd);
return -1;
}
@@ -140,7 +140,7 @@ static int php_do_open_temporary_file(const char *path, const char *pfx, char **
if (spprintf(&opened_path, 0, "%s%s%sXXXXXX", new_state.cwd, trailing_slash, pfx) >= MAXPATHLEN) {
efree(opened_path);
- free(new_state.cwd);
+ efree(new_state.cwd);
return -1;
}
@@ -151,7 +151,7 @@ static int php_do_open_temporary_file(const char *path, const char *pfx, char **
* which means that opening it will fail... */
if (VCWD_CHMOD(opened_path, 0600)) {
efree(opened_path);
- free(new_state.cwd);
+ efree(new_state.cwd);
return -1;
}
fd = VCWD_OPEN_MODE(opened_path, open_flags, 0600);
@@ -170,7 +170,7 @@ static int php_do_open_temporary_file(const char *path, const char *pfx, char **
} else {
*opened_path_p = opened_path;
}
- free(new_state.cwd);
+ efree(new_state.cwd);
return fd;
}
/* }}} */