From: Ben Pfaff Date: Mon, 1 Feb 2010 22:57:27 +0000 (-0800) Subject: json: Fix memory leak when nesting depth is exceeded. X-Git-Tag: v1.0.0~259^2~203 X-Git-Url: http://git.onelab.eu/?a=commitdiff_plain;h=d951f1c78c2131fd466abec3c800fff7a4108c65;p=sliver-openvswitch.git json: Fix memory leak when nesting depth is exceeded. This is probably not an important memory leak, since it is only on a rare error path, but it is best to fix it anyway. Found with valgrind. --- diff --git a/lib/json.c b/lib/json.c index 0339a368d..8fd9c3a7a 100644 --- a/lib/json.c +++ b/lib/json.c @@ -1213,6 +1213,7 @@ json_parser_push(struct json_parser *p, p->parse_state = new_state; return node; } else { + json_destroy(new_json); json_error(p, "input exceeds maximum nesting depth %d", JSON_MAX_HEIGHT); return NULL;