-
Notifications
You must be signed in to change notification settings - Fork 438
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Memory leak with yajl_tree_parse in yajl version 2.1.0 #223
Comments
Can you please help on the above query. Thanks, |
In C when you free an object by calling The best way to detect the source of memory leaks is to use Valgrind. Run your program, or a similar enough test program, under Valgrind with the test data and it will report each and every memory block that is not freed, and it will give a stack backtrace to the location each group of similar blocks was allocated. |
- use wrapped malloc() et al wrappers consistently - update example/parse_config.c to do memory leak detection - add a regression test using example/parse_config Several issues in lloyd/yajl complained about this leak, and comments in lloyd/yajl#102 showed a mostly correct fix though none of these issues mentioned or actually fixed the directly related error reporting problem. Fixes lloyd/yajl#102, fixes lloyd/yajl#113, fixes lloyd/yajl#168, fixes lloyd/yajl#191, fixes lloyd/yajl#223, fixes lloyd/yajl#250. Also fixes lloy/yajl#185.
Hi,
We feed 32KB in yajl_tree_parse() API, which took 220KB of memory for processing. Once the parsing finished, we freed the root by using yajl_tree_free() API.
200KB of memory only freed out of 220KB, remaining 20KB of memory is not freed.
Please find our reference code below.
After freeing node1 is pointing to some data, it is not NULL.
Could you please provide your input on this.
Kindly do needful ASAP.
Thanks.
The text was updated successfully, but these errors were encountered: