mirror of
https://github.com/rizinorg/rizin.git
synced 2026-10-12 02:21:57 +00:00
This fixes several interdependent issues, originally surfaced as leaked memory by xzy test cases: - Fixed double-free of sub-namespaced sdbs in ns_free_exc_list and added a test for this case. Refcounting should correctly account for the amount of times an sdb is referenced as a sub-namespace. This caused even more leaks, whose causes are now localized downstream: - bf->sdb->refs++; in rz_bin_object_new() appears to have only been a workaround for the actual issue mentioned above. - RzBinObject.kv also depended on it, but actually it is supposed to only be an additional reference to an sdb managed by the plugin, so we adjust the code accordingly. Finally, test_rz_bin_reloc_storage also had an independent leak fixed here to make the entire test file leak-free.