]> git.ipfire.org Git - thirdparty/json-c.git/commit
fix json_object_put() to return 1 for freed scalars and empty containers 945/head
authorArran Cudbard-Bell <a.cudbardb@freeradius.org>
Tue, 14 Jul 2026 13:32:03 +0000 (09:32 -0400)
committerArran Cudbard-Bell <a.cudbardb@freeradius.org>
Tue, 14 Jul 2026 14:28:04 +0000 (10:28 -0400)
commit69be99ef8e99d811d7810bdf75864ae800a67e50
tree3bc0f6b3d367b438c7587c13e5ac0620d48a46e2
parente65444a258435a8b52a09f182567e15c4aed5f28
fix json_object_put() to return 1 for freed scalars and empty containers

The iterative rewrite in 17328a67 made json_object_put() return 0 for freed scalars, strings and empty containers, contradicting the documented contract in json_object.h. Distinguish "freed" from "still referenced" in _json_object_put_maybe_free() and add regression tests.
json_object.c
tests/test_deep_nesting.c
tests/test_deep_nesting.expected