diff options
author | Andi Gutmans <andi@php.net> | 2000-08-31 22:24:20 +0000 |
---|---|---|
committer | Andi Gutmans <andi@php.net> | 2000-08-31 22:24:20 +0000 |
commit | 27de50012b516feb4eb9845d2992c45c89abd57a (patch) | |
tree | f89e8e698d1ec4aceda4cbbec2bd68375356baea /main/fopen_wrappers.c | |
parent | 1bb90f5805ea471dd85ee0806203d3fe71059630 (diff) | |
download | php-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.c | 3 |
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; |