2015-08-31 17:56:00 +00:00
|
|
|
From: Jan-Philipp Litza <janphilipp@litza.de>
|
|
|
|
Date: Mon, 31 Aug 2015 19:52:36 +0200
|
|
|
|
Subject: 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
|
2016-12-20 00:09:53 +00:00
|
|
|
index 971fb122f7655b379e717ef78a5417032ead9a57..b857c979e93bec395bca164a4f144c7c69005bec 100644
|
2015-08-31 17:56:00 +00:00
|
|
|
--- 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;
|
|
|
|
}
|
|
|
|
|