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

json_object_object_del() segmentation fault #435

Closed
tristenator opened this issue Jul 24, 2018 · 1 comment
Closed

json_object_object_del() segmentation fault #435

tristenator opened this issue Jul 24, 2018 · 1 comment

Comments

@tristenator
Copy link

tristenator commented Jul 24, 2018

hello, i want to remove an object from an object. this is the simplest scenario. creating a root object jo. creating an object o. adding o to jo using the key "key". and i want to remove "key" from the root object.

`
json_object *jo = json_object_new_object();

	json_object *o = json_object_new_string("test");

	json_object_object_add(jo, "key", o);

	json_object_object_del(o, "key");`

the json_object_object_del causes a segfault. any help would be appreciated, thank you in advance.

@tristenator
Copy link
Author

stupid me, sorry i just realised my mistake.

i was passing the object o to json_object_object_del when i should have been passing jo.

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

No branches or pull requests

1 participant