Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Provide public sdb_ref sdb_unref #199

Open
ret2libc opened this issue Oct 24, 2019 · 1 comment
Open

Provide public sdb_ref sdb_unref #199

ret2libc opened this issue Oct 24, 2019 · 1 comment

Comments

@ret2libc
Copy link
Contributor

I think we should introduce new APIs to increment/decrement the ref value of a Sdb. This can be very useful in radare2 where sdb are passed around and sometimes it's not clear which component will be the first to release a given Sdb.

This seems the case with RBinFile, which has a ->sdb field which is not freed in r_bin_file_free because it is already freed by someone else. This leads to memory leaks in some cases and in general I think it is not good practice to have some fields of a data structure owned by something else.

@radare
Copy link
Collaborator

radare commented Oct 24, 2019 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants