aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorneodarz <neodarz@neodarz.net>2019-08-09 11:46:05 +0200
committerneodarz <neodarz@neodarz.net>2019-08-09 11:46:05 +0200
commita6408962010c1880a54d2f0f3a1e35b0ca65531d (patch)
tree01d3da1b8d6b9f5fa2987f8594f55490d5c769d4
parentdbb8f177d5bc28bb2a51be4d3b9344e08fd869f6 (diff)
downloadumosapicpp-a6408962010c1880a54d2f0f3a1e35b0ca65531d.tar.xz
umosapicpp-a6408962010c1880a54d2f0f3a1e35b0ca65531d.zip
Fix memory leak
-rw-r--r--db/uobject.cpp2
1 files changed, 1 insertions, 1 deletions
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);
}