Skip to content
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

fixed some memory leaks in jsonlint.c #10

Closed
wants to merge 1 commit into from

Conversation

tdingus
Copy link

@tdingus tdingus commented Mar 5, 2012

No description provided.

@vincenthz
Copy link
Owner

thanks, however it does replace a controlled (program exit) memory leak by a segfault (stack overflow) for large data since you're using function call recursions. The only proper way to do it is a loop and a context to get track of the depths.

Also on a minor note, the patch probably won't compile (spurious brace) and the indentation is using a mix bag of spaces and tabs. please make sure that only tabs are used.

@tdingus
Copy link
Author

tdingus commented Mar 6, 2012

Thanks.

Your point about recursion is well taken. If you know the proper way, would you please fix that?
The same practice can also be found in function print_tree_iter, unless I missed something.

The patch does compile although tab should be used to comply the convention used here.

@tdingus
Copy link
Author

tdingus commented Mar 20, 2012

Hi,

Do you know if this library has been used in any multi-threads operations? Or, do you think if it supports multi-threads?

Thanks,

@tdingus tdingus closed this Mar 20, 2012
@vincenthz
Copy link
Owner

The library is completely state free, hence there's nothing that can be corrupted/wrong by using multiple threads, as long as you serialize the access to the memory structure that the library uses.

@floyd-fuh floyd-fuh mentioned this pull request Feb 11, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants