From c51b107d9cf63c77e89262c109aee920233dc658 Mon Sep 17 00:00:00 2001 From: bparker06 Date: Tue, 2 Jan 2018 20:24:48 -0500 Subject: [PATCH] Update archive_file_7z.c --- libretro-common/file/archive_file_7z.c | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/libretro-common/file/archive_file_7z.c b/libretro-common/file/archive_file_7z.c index 73a04f9336..1f8ec9ddd3 100644 --- a/libretro-common/file/archive_file_7z.c +++ b/libretro-common/file/archive_file_7z.c @@ -370,18 +370,21 @@ static int sevenzip_parse_file_init(file_archive_transfer_t *state, if (InFile_Open(&sevenzip_context->archiveStream.file, file)) goto error; #else - fileW = utf8_to_utf16_string_alloc(file); - - if (fileW) + if (!string_is_empty(file)) { - /* could not open 7zip archive? */ - if (InFile_OpenW(&sevenzip_context->archiveStream.file, fileW)) - { - free(fileW); - goto error; - } + fileW = utf8_to_utf16_string_alloc(file); - free(fileW); + if (fileW) + { + /* could not open 7zip archive? */ + if (InFile_OpenW(&sevenzip_context->archiveStream.file, fileW)) + { + free(fileW); + goto error; + } + + free(fileW); + } } #endif