Issue #923: Avoid stack recursion in json_object_put() so heavily nested object trees can be freed.

This commit is contained in:
Eric Hawicz
2026-04-24 12:56:40 -04:00
parent fe30bc7e66
commit 96a2496fc3
4 changed files with 168 additions and 15 deletions

View File

@@ -47,7 +47,10 @@ struct json_object
json_object_to_json_string_fn *_to_json_string;
struct printbuf *_pb;
json_object_delete_fn *_user_delete;
void *_userdata;
union {
void *_userdata;
void *_delete_parent; // Used during json_object_put
};
// Actually longer, always malloc'd as some more-specific type.
// The rest of a struct json_object_${o_type} follows
};