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
json_object_object_del() and Segmentation fault #430
Comments
If you want to free the entire It does not make sense to call |
What @ploxiln said, but also: if you're want to keep using the string after freeing the object, you need to copy it, perhaps with strdup. http://json-c.github.io/json-c/json-c-0.13.1/doc/html/json__object_8h.html#a9ee29ca8d79896e15007131527f6002e |
Got it. Thank you so much 😄 |
But with the latest version of json-c compiled from source I'm getting below error:
|
Still I'm not getting how I've two json objects in my program:
If i delete any of the two |
Got it working. Few sub-objects of |
I searched for similar issue but didn't get any so posting my issue here. The below code is resulting Segmentation fault. The line which causing has been marked. If I comment the line there is no errors. Can't figure out why it is not working. I want to release all the memory used by json-c once I read the values from json.
Code:
Json:
The text was updated successfully, but these errors were encountered: