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

push_nocopy object/string bug #15

Open
dmg0048 opened this issue Mar 25, 2019 · 1 comment
Open

push_nocopy object/string bug #15

dmg0048 opened this issue Mar 25, 2019 · 1 comment

Comments

@dmg0048
Copy link

dmg0048 commented Mar 25, 2019

If you push an object or string to another json object though any of the noncopy functions, when calling json_builder_free, this function tries to deallocate the .name and .ptr, which have not been allocated in this scenario.

I am posting this from my phone sorry for my brevity.

@LB--
Copy link
Member

LB-- commented Aug 10, 2021

Hm, I suppose the API documentation is a bit lacking here, I think it is intended that these functions take ownership of the allocation from you, as that is how they are used internally in the implementation. Perhaps these functions should be renamed and maybe we can consider adding real nocopy that set a flag to indicate that they are not to be deallocated.

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

2 participants