From a6408962010c1880a54d2f0f3a1e35b0ca65531d Mon Sep 17 00:00:00 2001 From: neodarz Date: Fri, 9 Aug 2019 11:46:05 +0200 Subject: Fix memory leak --- db/uobject.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'db/uobject.cpp') diff --git a/db/uobject.cpp b/db/uobject.cpp index ce685b3..0b76daf 100644 --- a/db/uobject.cpp +++ b/db/uobject.cpp @@ -68,7 +68,7 @@ std::string uobject::add(std::string collection, struct json_object* jsonObject, std::cout << typeid(json_datas).name() << std::endl; std::cout << "json_datas type: " << json_type_to_name(json_object_get_type(json_datas)) << std::endl; } - json_tokener_reset(tok); + json_tokener_free(tok); return json_object_to_json_string_ext(jsonObject, JSON_C_TO_STRING_SPACED | JSON_C_TO_STRING_PRETTY); } -- cgit v1.2.1