I am new to JSON-C, Please see my sample code and let me know of it will create any memory leak, if yes then how to free JSON-C object.
Do I need to clean new_obj, if yes then how. Can some one help to understand how to do memory management JSON-C. Thanks in Advance |
|||||
|
Yes, I believe your code will leak memory. The problem is that you are overwriting your new_obj pointer multiple times. Your code should be something like this:
Please let me know if this works for you. If you want more help, json-c has a reference count mode which can give you more information about objects. Let me know and I can elaborate on this more. |
|||||||||
|
联系客服