From: Jan-Philipp Litza Date: Mon, 31 Aug 2015 17:52:36 +0000 (+0200) Subject: luci-lib-jsonc: Fix memory leak in stringify() X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=90c841d66e5a13735996e5177b622cb0deae9016;p=oweals%2Fluci.git luci-lib-jsonc: Fix memory leak in stringify() --- 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; }