You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi, using a very simple example of json parsing, valgrind reports a memory leak for function json_tokener_parse_ex:
==19276== 711 (88 direct, 623 indirect) bytes in 1 blocks are definitely lost in loss record 11 of 11
==19276== at 0x4C2EF35: calloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==19276== by 0x59E5F1A: lh_table_new (in /usr/lib/libjson-c.so.2.0.2)
==19276== by 0x59E26AD: json_object_new_object (in /usr/lib/libjson-c.so.2.0.2)
==19276== by 0x59E49A4: json_tokener_parse_ex (in /usr/lib/libjson-c.so.2.0.2)
==19276== by 0x10E0EB: json_document_is_error (api.h:1044)
The code triggering this can be seen in my project mpris-scrobbler.
The buffer string that would be matched is something like:
{"error":4,"message":"Unauthorized Token - This token has not been issued"}
Looking at the code, it seems that somehow the json_object_object_delete function is not called anywhere relevant, even though I'm calling json_tokener_free().
I have tried also using the simple case with just json_tokener_parse(buffer), but the memory leak is still there.
Is there something I'm overlooking? Like an extra step for freeing that I missed in the documentation?
Hi, using a very simple example of json parsing, valgrind reports a memory leak for function
json_tokener_parse_ex
:The code triggering this can be seen in my project mpris-scrobbler.
The buffer string that would be matched is something like:
Looking at the code, it seems that somehow the
json_object_object_delete
function is not called anywhere relevant, even though I'm callingjson_tokener_free()
.I have tried also using the simple case with just
json_tokener_parse(buffer)
, but the memory leak is still there.Is there something I'm overlooking? Like an extra step for freeing that I missed in the documentation?
Library version:
The text was updated successfully, but these errors were encountered: