summaryrefslogtreecommitdiffabout
authorSergey Poznyakoff <gray@gnu.org>2016-02-21 14:28:34 (GMT)
committer Sergey Poznyakoff <gray@gnu.org>2016-02-21 14:28:34 (GMT)
commit07838fb2e9ed5769074add028e052a3b667e67e7 (patch) (side-by-side diff)
tree671a34f3a25abece344e27eb0d5fc4c0ed33e4b1
parenta3f25ce24dcaff123fb71db89419d3ae12ddb57a (diff)
downloadgrecs-07838fb2e9ed5769074add028e052a3b667e67e7.tar.gz
grecs-07838fb2e9ed5769074add028e052a3b667e67e7.tar.bz2
Fix memory leaks
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--src/json-gram.y1
-rw-r--r--src/jsonfmt.c1
2 files changed, 2 insertions, 0 deletions
diff --git a/src/json-gram.y b/src/json-gram.y
index ab65362..ca50097 100644
--- a/src/json-gram.y
+++ b/src/json-gram.y
@@ -215,6 +215,7 @@ json_value_free(struct json_value *obj)
case json_arr:
for (i = 0; i < obj->v.a->oc; i++)
json_value_free(obj->v.a->ov[i]);
+ grecs_free (obj->v.a->ov);
if (obj->v.a->ol) {
obj->v.a->ol->free_entry = objfree;
grecs_list_free(obj->v.a->ol);
diff --git a/src/jsonfmt.c b/src/jsonfmt.c
index 0687faf..0f44536 100644
--- a/src/jsonfmt.c
+++ b/src/jsonfmt.c
@@ -147,6 +147,7 @@ json_format_obj(struct json_format *fmt, struct json_value *obj, size_t level)
}
}
json_writec(fmt, '}');
+ grecs_free(keypairs);
}
static void

Return to:

Send suggestions and report system problems to the System administrator.