From 384c72f630b7e8623a5122991d7c6abe6e870b38 Mon Sep 17 00:00:00 2001 From: Ole Troan Date: Wed, 17 Feb 2021 13:46:54 +0100 Subject: vppapigen: resource leakage in fromjson array - coverity Type: fix Signed-off-by: Ole Troan Change-Id: I43283c59fd121dcb2486b26151108c90b027748b --- src/tools/vppapigen/vppapigen_c.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/tools/vppapigen') 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} -- cgit 1.2.3-korg