mirror of
https://github.com/joel16/VitaShell.git
synced 2024-11-26 21:30:45 +00:00
Fixed memory leak
This commit is contained in:
parent
a4829945cc
commit
460c44ae23
@ -659,7 +659,7 @@ static void create_recent_symlink(FileListEntry *file_entry) {
|
||||
}
|
||||
|
||||
static void fileBrowserHandleFile(FileListEntry *file_entry) {
|
||||
snprintf(cur_file, MAX_PATH_LENGTH - 1, "%s%s", file_list.path, file_entry->name);
|
||||
snprintf(cur_file, MAX_PATH_LENGTH, "%s%s", file_list.path, file_entry->name);
|
||||
int type = handleFile(cur_file, file_entry);
|
||||
|
||||
// Archive mode
|
||||
@ -667,7 +667,7 @@ static void fileBrowserHandleFile(FileListEntry *file_entry) {
|
||||
is_in_archive = 1;
|
||||
dir_level_archive = dir_level;
|
||||
|
||||
snprintf(archive_path, MAX_PATH_LENGTH - 1, "%s%s", file_list.path, file_entry->name);
|
||||
snprintf(archive_path, MAX_PATH_LENGTH, "%s%s", file_list.path, file_entry->name);
|
||||
|
||||
strcat(file_list.path, file_entry->name);
|
||||
addEndSlash(file_list.path);
|
||||
@ -735,7 +735,7 @@ static void fileBrowserHandleSymlink(FileListEntry *file_entry) {
|
||||
if ((file_entry->symlink->to_file == 1 && !checkFileExist(file_entry->symlink->target_path))
|
||||
|| (file_entry->symlink->to_file == 0 && !checkFolderExist(file_entry->symlink->target_path))) {
|
||||
// TODO: What if in archive?
|
||||
snprintf(cur_file, MAX_PATH_LENGTH - 1, "%s%s", file_list.path, file_entry->name);
|
||||
snprintf(cur_file, MAX_PATH_LENGTH, "%s%s", file_list.path, file_entry->name);
|
||||
textViewer(cur_file);
|
||||
return;
|
||||
}
|
||||
@ -765,6 +765,9 @@ static void fileBrowserHandleSymlink(FileListEntry *file_entry) {
|
||||
}
|
||||
fileBrowserHandleFile(resolved_file_entry);
|
||||
dirUp();
|
||||
|
||||
free(target_file_name);
|
||||
free(target_base_directory);
|
||||
}
|
||||
int res = refreshFileList();
|
||||
if (res < 0)
|
||||
|
2
file.c
2
file.c
@ -1052,7 +1052,7 @@ int fileListGetDirectoryEntries(FileList *list, const char *path, int sort) {
|
||||
if (!p) {
|
||||
return VITASHELL_ERROR_INTERNAL;
|
||||
}
|
||||
snprintf(p, MAX_PATH_LENGTH - 1, "%s%s%s",
|
||||
snprintf(p, MAX_PATH_LENGTH, "%s%s%s",
|
||||
path, hasEndSlash(path) ? "" : "/", dir.d_name);
|
||||
|
||||
Symlink* symlink = malloc(sizeof(Symlink));
|
||||
|
Loading…
Reference in New Issue
Block a user