Skip to content
Snippets Groups Projects
Commit 8e670bd3 authored by Jan-Philipp Litza's avatar Jan-Philipp Litza
Browse files

Add patch "luci-lib-jsonc: Fix memory leak in stringify"

parent f5bef2ab
No related branches found
No related tags found
No related merge requests found
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
index 971fb12..b857c97 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;
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment