summaryrefslogtreecommitdiffhomepage
path: root/libs/luci-lib-jsonc/src/jsonc.c
diff options
context:
space:
mode:
authorJan-Philipp Litza <janphilipp@litza.de>2015-08-31 19:52:36 +0200
committerJan-Philipp Litza <janphilipp@litza.de>2015-08-31 19:53:51 +0200
commit90c841d66e5a13735996e5177b622cb0deae9016 (patch)
treef2a3bb6c7c36b63bf2b172d87880f043d4a7c795 /libs/luci-lib-jsonc/src/jsonc.c
parentc0e2255ae90145062d5966725c7ee5da3c310ce1 (diff)
luci-lib-jsonc: Fix memory leak in stringify()
Diffstat (limited to 'libs/luci-lib-jsonc/src/jsonc.c')
-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 971fb122f7..b857c979e9 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;
}