projects
/
openvswitch
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
f6b60e0
)
json: Fix memory leak when nesting depth is exceeded.
author
Ben Pfaff
<blp@nicira.com>
Mon, 1 Feb 2010 22:57:27 +0000
(14:57 -0800)
committer
Ben Pfaff
<blp@nicira.com>
Tue, 2 Feb 2010 23:21:09 +0000
(15:21 -0800)
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.
lib/json.c
patch
|
blob
|
history
diff --git
a/lib/json.c
b/lib/json.c
index 0339a368d960268981810677f1f0d2bd913d197f..8fd9c3a7a5e488397bbc5ac0885373eda02ec367 100644
(file)
--- 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;