aboutsummaryrefslogtreecommitdiffstats
path: root/src/tools
diff options
context:
space:
mode:
authorOle Troan <ot@cisco.com>2021-02-06 13:02:41 +0100
committerNeale Ranns <neale@graphiant.com>2021-02-09 09:56:56 +0000
commitc9c9143898aa1f5b5aa90ab03a4c94181dcf7ed6 (patch)
tree87ece208cd36415f92566cd2b3c4aebf4abeff94 /src/tools
parent070387d3f4b0b5a5742b95fca19404cb50fa9927 (diff)
nat: fix coverity errors
Including a general missing free in fromjson autogenerated code. Type: fix Signed-off-by: Ole Troan <ot@cisco.com> Change-Id: I9ab2b0193135e2fb3d62d51b3c114df56969e341 Signed-off-by: Ole Troan <ot@cisco.com>
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 0798e9aca26..1886c98d6be 100644
--- a/src/tools/vppapigen/vppapigen_c.py
+++ b/src/tools/vppapigen/vppapigen_c.py
@@ -367,7 +367,7 @@ class FromJSON():
write(' {msgvar} = {t}_fromjson({msgvar}, '
'{msgsize}, item, &a->{n});\n'
.format(t=t, n=o.fieldname, msgvar=msgvar, msgsize=msgsize))
- write(' if (!{msgvar}) return 0;\n'.format(msgvar=msgvar))
+ write(' if (!{msgvar}) {{ free(a); return 0;}} \n'.format(msgvar=msgvar))
write(' // end field {}\n'.format(o.fieldname))