From be4e0aee1fbca04e871b5d01ab08d3c3ff341a2e Mon Sep 17 00:00:00 2001 From: Alcaro Date: Sat, 20 Aug 2016 21:23:32 +0200 Subject: [PATCH] Clean up this thing --- libretro-common/file/config_file.c | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/libretro-common/file/config_file.c b/libretro-common/file/config_file.c index 2ceaffc0e6..9b049b0013 100644 --- a/libretro-common/file/config_file.c +++ b/libretro-common/file/config_file.c @@ -769,14 +769,10 @@ void config_set_string(config_file_t *conf, const char *key, const char *val) return; } - entry = (struct config_entry_list*)calloc(1, sizeof(*entry)); + if (!val) return; - if (!entry || !val) - { - if (entry) - free(entry); - return; - } + entry = (struct config_entry_list*)calloc(1, sizeof(*entry)); + if (!entry) return; entry->key = strdup(key); entry->value = strdup(val);