From 25ebc244ab7d5cb0e905eccd36d343660e0533aa Mon Sep 17 00:00:00 2001 From: KeVteL Date: Mon, 13 Jan 2025 14:54:37 +0100 Subject: [PATCH] include bug + iterator logic fix Signed-off-by: Kevin Vu te Laar --- clients/python-wrapper/villas-python-wrapper.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/clients/python-wrapper/villas-python-wrapper.cpp b/clients/python-wrapper/villas-python-wrapper.cpp index e310f8dfe..650abf92b 100644 --- a/clients/python-wrapper/villas-python-wrapper.cpp +++ b/clients/python-wrapper/villas-python-wrapper.cpp @@ -1,7 +1,6 @@ #include #include #include -#include #include #include extern "C" { @@ -113,8 +112,11 @@ PYBIND11_MODULE(villas_node, m) { return (vnode *)villas::node::NodeFactory::make(json_object_iter_value(it), id, json_object_iter_key(it)); } else { // create node without name - const char* capi_str = json_dumps(json_object_iter_value(it), 0); - return node_new(id_str, capi_str); + char* capi_str = json_dumps(json, 0); + auto ret = node_new(id_str, capi_str); + + free(capi_str); + return ret; } }, py::return_value_policy::reference);