From 859df7ddd1bf1f36ce05966482086ecfb6c81e11 Mon Sep 17 00:00:00 2001 From: Dmitri Pal Date: Fri, 24 Dec 2010 00:18:56 -0500 Subject: Free newly created value in case of error The newly created value object was not freed in case of an error. Coverity issue 10076. --- ini/ini_parse.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ini/ini_parse.c b/ini/ini_parse.c index 26dc43f..18edc62 100644 --- a/ini/ini_parse.c +++ b/ini/ini_parse.c @@ -405,6 +405,7 @@ static int complete_value_processing(struct parser_obj *po) if (error) { TRACE_ERROR_NUMBER("Failed searching for dup", error); + value_destroy(vo); return error; } @@ -418,6 +419,7 @@ static int complete_value_processing(struct parser_obj *po) sizeof(struct value_obj *)); if (error) { TRACE_ERROR_NUMBER("Failed updating the value", error); + value_destroy(vo); return error; } /* If we failed to update it is better to leak then crash, -- cgit