The usefulness of free() in __move_json_value
MoonChasing opened this issue · comments
Hello, I want to know the usefulness of free()
in __move_json_value
, especially when type is object or array,
I wonder if there is a memory bug here (I have such doubts, I haven't read the code in too much detail).
For example, json_object_remove
and json_array_remove
call __move_json_value
, and param is &memb/elem->value
, followed by free(memb/elem)
. I don't quite understand here, why need free it in __move_json_value
?
Thank you. It's a bug... The code of removing value from object or array is still untested.
I forgot that __move_json_value will free the 'src' JSON value. I will fix it ASAP.
Yes, thx.
So perfect.