summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorJo-Philipp Wich <jow@openwrt.org>2015-09-01 09:34:14 +0200
committerJo-Philipp Wich <jow@openwrt.org>2015-09-01 09:34:14 +0200
commitfdb7daa90748bc28dbd57cb0b0d23efba6d8e1c9 (patch)
treef2a3bb6c7c36b63bf2b172d87880f043d4a7c795
parent60f62f841f6816b83dab9a9028c4d0799992c56c (diff)
parent90c841d66e5a13735996e5177b622cb0deae9016 (diff)
Merge pull request #460 from jplitza/master
luci-lib-jsonc: Fix memory leak in stringify()
-rw-r--r--libs/luci-lib-jsonc/src/jsonc.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/libs/luci-lib-jsonc/src/jsonc.c b/libs/luci-lib-jsonc/src/jsonc.c
index 971fb122f..b857c979e 100644
--- a/libs/luci-lib-jsonc/src/jsonc.c
+++ b/libs/luci-lib-jsonc/src/jsonc.c
@@ -106,6 +106,7 @@ static int json_stringify(lua_State *L)
flags |= JSON_C_TO_STRING_PRETTY | JSON_C_TO_STRING_SPACED;
lua_pushstring(L, json_object_to_json_string_ext(obj, flags));
+ json_object_put(obj);
return 1;
}