diff --git a/libretro-common/file/archive_file.c b/libretro-common/file/archive_file.c index 39ed009511..6559e209e5 100644 --- a/libretro-common/file/archive_file.c +++ b/libretro-common/file/archive_file.c @@ -346,10 +346,16 @@ static int file_archive_decompress_data_to_file( } end: - handle->backend->stream_free(handle->stream); - if (handle && handle->data) - free(handle->data); + if (handle) + { + if (handle->backend) + handle->backend->stream_free(handle->stream); + + if (handle->data) + free(handle->data); + } + return ret; }