From 4b2abc333474e0daa54f3dd4bf6ec9bbf930ae27 Mon Sep 17 00:00:00 2001 From: twinaphex Date: Mon, 11 Sep 2017 00:12:26 +0200 Subject: [PATCH] Cleanups --- core_info.c | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/core_info.c b/core_info.c index 3e21fc0859..d48b35189a 100644 --- a/core_info.c +++ b/core_info.c @@ -875,11 +875,7 @@ bool core_info_database_supports_content_path(const char *database_path, const c database = strdup(new_path); if (string_is_empty(database)) - { - if (database) - free(database); - return false; - } + goto error; path_remove_extension(database); @@ -907,8 +903,7 @@ bool core_info_database_supports_content_path(const char *database_path, const c && !string_list_find_elem(info->supported_extensions_list, "7z")) continue; - free(database); - return false; + goto error; } } } @@ -929,7 +924,9 @@ bool core_info_database_supports_content_path(const char *database_path, const c } } - free(database); +error: + if (database) + free(database); return false; }