summaryrefslogtreecommitdiff
path: root/main/fopen_wrappers.c
diff options
context:
space:
mode:
authorAndi Gutmans <andi@php.net>2000-08-31 22:24:20 +0000
committerAndi Gutmans <andi@php.net>2000-08-31 22:24:20 +0000
commit27de50012b516feb4eb9845d2992c45c89abd57a (patch)
treef89e8e698d1ec4aceda4cbbec2bd68375356baea /main/fopen_wrappers.c
parent1bb90f5805ea471dd85ee0806203d3fe71059630 (diff)
downloadphp-git-27de50012b516feb4eb9845d2992c45c89abd57a.tar.gz
- Use emalloc() for opened_path now. This was a potential leak before.
- This patch has potential to break stuff but I tested it as much as I - could. Fixes should be easy.
Diffstat (limited to 'main/fopen_wrappers.c')
-rw-r--r--main/fopen_wrappers.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/main/fopen_wrappers.c b/main/fopen_wrappers.c
index 638c771c9b..fa7c053f4b 100644
--- a/main/fopen_wrappers.c
+++ b/main/fopen_wrappers.c
@@ -1077,7 +1077,8 @@ PHPAPI char *expand_filepath(const char *filepath, char *real_path)
memcpy(real_path,new_state.cwd,copy_len);
real_path[copy_len]='\0';
} else {
- real_path = new_state.cwd;
+ real_path = estrndup(new_state.cwd, new_state.cwd_length);
+ free(new_state.cwd);
}
return real_path;