From f1ab2ece8ced9778e5eb5d3d88ab68385e4677f8 Mon Sep 17 00:00:00 2001 From: Lioncash Date: Sun, 14 Sep 2014 20:18:39 -0400 Subject: [PATCH] Fix a realloc guard mistake I made in config file. --- conf/config_file.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/conf/config_file.c b/conf/config_file.c index 2f00d2aef4..d4d5eb10ec 100644 --- a/conf/config_file.c +++ b/conf/config_file.c @@ -82,7 +82,7 @@ static char *getaline(FILE *file) if (index == cur_size) { cur_size *= 2; - newline = (char*)realloc(newline, cur_size + 1); + newline_tmp = (char*)realloc(newline, cur_size + 1); if (newline_tmp) { @@ -459,6 +459,7 @@ config_file_t *config_file_new_from_string(const char *from_string) if (!list) { + string_list_free(lines); config_file_free(conf); return NULL; } @@ -479,7 +480,7 @@ config_file_t *config_file_new_from_string(const char *from_string) if (list != conf->tail) free(list); } - + string_list_free(lines); return conf;