aboutsummaryrefslogtreecommitdiffstats
path: root/src/tools/vppapigen
diff options
context:
space:
mode:
Diffstat (limited to 'src/tools/vppapigen')
-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))