From 1d6f88b0ec1d5aa9b1729575a7b54ce4950ad15f Mon Sep 17 00:00:00 2001 From: twinaphex Date: Tue, 3 Jan 2017 19:07:56 +0100 Subject: [PATCH] Try to prevent 'write to pointer after free' issues --- tasks/task_content.c | 8 -------- 1 file changed, 8 deletions(-) diff --git a/tasks/task_content.c b/tasks/task_content.c index d99fcc760a..ed2e018116 100644 --- a/tasks/task_content.c +++ b/tasks/task_content.c @@ -391,8 +391,6 @@ static bool load_content_from_compressed_archive( snprintf(str, sizeof(str), "%s \"%s\".\n", msg_hash_to_str(MSG_COULD_NOT_READ_CONTENT_FILE), path); - if (error_string) - free(error_string); *error_string = strdup(str); return false; } @@ -633,8 +631,6 @@ static const struct retro_subsystem_info *content_file_init_subsystem( "subsystem \"%s\", but %u content files were provided.\n", special->num_roms, special->desc, (unsigned)subsystem->size); - if (error_string) - free(error_string); *error_string = strdup(msg); goto error; } @@ -645,8 +641,6 @@ static const struct retro_subsystem_info *content_file_init_subsystem( "but %u content files were provided.\n", special->desc, (unsigned)subsystem->size); - if (error_string) - free(error_string); *error_string = strdup(msg); goto error; } @@ -912,8 +906,6 @@ error: snprintf(msg, sizeof(msg), "%s %s.\n", msg_hash_to_str(MSG_FAILED_TO_LOAD), name); - if (error_string) - free(error_string); *error_string = strdup(msg); } }