summaryrefslogtreecommitdiff
path: root/main/php_open_temporary_file.c
diff options
context:
space:
mode:
authorAnatol Belski <ab@php.net>2013-10-17 10:40:43 +0200
committerAnatol Belski <ab@php.net>2013-10-17 10:40:43 +0200
commitcf6ab0e915f95f01a8db1ce7daf70ed36cf49c66 (patch)
treec4fd681e0b62ad67d2b2ef9101c5e59cae8f0bc2 /main/php_open_temporary_file.c
parente30b2aae5ad93405eee19bca6125ea872f409c82 (diff)
downloadphp-git-cf6ab0e915f95f01a8db1ce7daf70ed36cf49c66.tar.gz
applied and fixed the original patch
initial work on the patch import done
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 054d497be6..8315297738 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;
}
/* }}} */