summaryrefslogtreecommitdiffstats
path: root/src/tools
diff options
context:
space:
mode:
authorOle Troan <ot@cisco.com>2021-02-17 13:46:54 +0100
committerOle Troan <ot@cisco.com>2021-02-17 13:46:54 +0100
commit384c72f630b7e8623a5122991d7c6abe6e870b38 (patch)
tree2eb1ceac2f64452a815118bbbf4054b978a384bb /src/tools
parent6abdf34d3a4e47fb9bb5d8052e2187af0ba256d8 (diff)
vppapigen: resource leakage in fromjson array - coverity
Type: fix Signed-off-by: Ole Troan <ot@cisco.com> Change-Id: I43283c59fd121dcb2486b26151108c90b027748b
Diffstat (limited to 'src/tools')
-rw-r--r--src/tools/vppapigen/vppapigen_c.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/tools/vppapigen/vppapigen_c.py b/src/tools/vppapigen/vppapigen_c.py
index 759d3325056..a83d361010e 100644
--- a/src/tools/vppapigen/vppapigen_c.py
+++ b/src/tools/vppapigen/vppapigen_c.py
@@ -380,7 +380,7 @@ class FromJSON():
int i;
cJSON *array = cJSON_GetObjectItem(o, "{n}");
int size = cJSON_GetArraySize(array);
- if (size != {lfield}) return 0;
+ if (size != {lfield}) goto error;
for (i = 0; i < size; i++) {{
cJSON *e = cJSON_GetArrayItem(array, i);
{call}