0005-luci-lib-jsonc-Fix-memory-leak-in-stringify.patch 557 B

12345678910111213141516
  1. From: Jan-Philipp Litza <janphilipp@litza.de>
  2. Date: Mon, 31 Aug 2015 19:52:36 +0200
  3. Subject: luci-lib-jsonc: Fix memory leak in stringify()
  4. diff --git a/libs/luci-lib-jsonc/src/jsonc.c b/libs/luci-lib-jsonc/src/jsonc.c
  5. index 971fb12..b857c97 100644
  6. --- a/libs/luci-lib-jsonc/src/jsonc.c
  7. +++ b/libs/luci-lib-jsonc/src/jsonc.c
  8. @@ -106,6 +106,7 @@ static int json_stringify(lua_State *L)
  9. flags |= JSON_C_TO_STRING_PRETTY | JSON_C_TO_STRING_SPACED;
  10. lua_pushstring(L, json_object_to_json_string_ext(obj, flags));
  11. + json_object_put(obj);
  12. return 1;
  13. }