mirror of
https://github.com/php/php-src.git
synced 2026-04-10 09:33:06 +02:00
- Fix memory leak.
This commit is contained in:
@@ -975,6 +975,7 @@ PHPAPI char *expand_filepath(const char *filepath, char *real_path)
|
||||
new_state.cwd_length = strlen(cwd);
|
||||
|
||||
if(virtual_file_ex(&new_state, filepath, NULL)) {
|
||||
free(new_state.cwd);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@@ -984,8 +985,8 @@ PHPAPI char *expand_filepath(const char *filepath, char *real_path)
|
||||
real_path[copy_len]='\0';
|
||||
} else {
|
||||
real_path = estrndup(new_state.cwd, new_state.cwd_length);
|
||||
free(new_state.cwd);
|
||||
}
|
||||
free(new_state.cwd);
|
||||
|
||||
return real_path;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user