summaryrefslogtreecommitdiffstats
path: root/ini
diff options
context:
space:
mode:
authorDmitri Pal <dpal@redhat.com>2010-12-24 00:18:56 -0500
committerStephen Gallagher <sgallagh@redhat.com>2011-01-03 13:51:37 -0500
commit859df7ddd1bf1f36ce05966482086ecfb6c81e11 (patch)
treedff93ca4ecbbd1faf491d128c3fbd192162dc345 /ini
parent06ce5367aa0578b11890db45a9acee3ec4357f58 (diff)
Free newly created value in case of error
The newly created value object was not freed in case of an error. Coverity issue 10076.
Diffstat (limited to 'ini')
-rw-r--r--ini/ini_parse.c2
1 files changed, 2 insertions, 0 deletions
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,