File 0002-ini_parse-Add-missing-TRACE_FLOW_EXIT.patch of Package ding-libs.33681
From fbaaf491afd199e2c401037a448052494d0f5b40 Mon Sep 17 00:00:00 2001
From: Michal Židek <mzidek@redhat.com>
Date: Jun 22 2016 08:29:57 +0000
Subject: ini_parse: Add missing TRACE_FLOW_EXIT
Some TRACE_FLOW_EXIT macros were missing
in handle_kvp() before return.
Reviewed-by: Lukáš Slebodník <lslebodn@redhat.com>
---
diff --git a/ini/ini_parse.c b/ini/ini_parse.c
index 91525a0..0de4e35 100644
--- a/ini/ini_parse.c
+++ b/ini/ini_parse.c
@@ -968,6 +968,7 @@ static int handle_kvp(struct parser_obj *po, uint32_t *action)
TRACE_ERROR_STRING("No key", str);
po->last_error = ERR_NOKEY;
*action = PARSE_ERROR;
+ TRACE_FLOW_EXIT();
return EOK;
}
@@ -977,6 +978,7 @@ static int handle_kvp(struct parser_obj *po, uint32_t *action)
TRACE_ERROR_STRING("No equal sign", str);
po->last_error = ERR_NOEQUAL;
*action = PARSE_ERROR;
+ TRACE_FLOW_EXIT();
return EOK;
}
@@ -992,6 +994,7 @@ static int handle_kvp(struct parser_obj *po, uint32_t *action)
TRACE_ERROR_STRING("Key name is too long", str);
po->last_error = ERR_LONGKEY;
*action = PARSE_ERROR;
+ TRACE_FLOW_EXIT();
return EOK;
}
@@ -1000,6 +1003,7 @@ static int handle_kvp(struct parser_obj *po, uint32_t *action)
error = complete_value_processing(po);
if (error) {
TRACE_ERROR_NUMBER("Failed to complete value processing", error);
+ TRACE_FLOW_EXIT();
return error;
}
}
@@ -1008,6 +1012,7 @@ static int handle_kvp(struct parser_obj *po, uint32_t *action)
po->key = malloc(len + 1);
if (!(po->key)) {
TRACE_ERROR_NUMBER("Failed to dup key", ENOMEM);
+ TRACE_FLOW_EXIT();
return ENOMEM;
}
@@ -1034,6 +1039,7 @@ static int handle_kvp(struct parser_obj *po, uint32_t *action)
dupval = malloc(len + 1);
if (!dupval) {
TRACE_ERROR_NUMBER("Failed to dup value", ENOMEM);
+ TRACE_FLOW_EXIT();
return ENOMEM;
}
@@ -1046,6 +1052,7 @@ static int handle_kvp(struct parser_obj *po, uint32_t *action)
if (error) {
TRACE_ERROR_NUMBER("Failed to create arrays", error);
free(dupval);
+ TRACE_FLOW_EXIT();
return error;
}
@@ -1058,6 +1065,7 @@ static int handle_kvp(struct parser_obj *po, uint32_t *action)
if (error) {
TRACE_ERROR_NUMBER("Failed to add value to arrays", error);
free(dupval);
+ TRACE_FLOW_EXIT();
return error;
}