Browse Source

- Fix memory leak.

PHP-4.0.5
Andi Gutmans 26 years ago
parent
commit
e91c188e85
  1. 3
      main/fopen_wrappers.c

3
main/fopen_wrappers.c

@ -975,6 +975,7 @@ PHPAPI char *expand_filepath(const char *filepath, char *real_path)
new_state.cwd_length = strlen(cwd); new_state.cwd_length = strlen(cwd);
if(virtual_file_ex(&new_state, filepath, NULL)) { if(virtual_file_ex(&new_state, filepath, NULL)) {
free(new_state.cwd);
return NULL; return NULL;
} }
@ -984,8 +985,8 @@ PHPAPI char *expand_filepath(const char *filepath, char *real_path)
real_path[copy_len]='\0'; real_path[copy_len]='\0';
} else { } else {
real_path = estrndup(new_state.cwd, new_state.cwd_length); real_path = estrndup(new_state.cwd, new_state.cwd_length);
free(new_state.cwd);
} }
free(new_state.cwd);
return real_path; return real_path;
} }

Loading…
Cancel
Save