ifstat: Fix memleak in dump_kern_db() for json output

Looks like this was forgotten when converting to common json output
formatter.

Fixes: fcc16c2287 ("provide common json output formatter")
Signed-off-by: Phil Sutter <phil@nwl.cc>
This commit is contained in:
Phil Sutter 2017-08-17 19:09:29 +02:00 committed by Stephen Hemminger
parent 35f6adefb8
commit b530cef0e3
1 changed files with 6 additions and 2 deletions

View File

@ -535,8 +535,12 @@ static void dump_kern_db(FILE *fp)
else
print_one_if(fp, n, n->val);
}
if (json_output)
fprintf(fp, "\n} }\n");
if (jw) {
jsonw_end_object(jw);
jsonw_end_object(jw);
jsonw_destroy(&jw);
}
}
static void dump_incr_db(FILE *fp)