Clean up this thing

This commit is contained in:
Alcaro 2016-08-20 21:23:32 +02:00
parent 7f3e63a18d
commit be4e0aee1f

View File

@ -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);