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

Fix memleak in db/esil/apple #18238

Merged
merged 3 commits into from Jan 19, 2021
Merged

Conversation

eagleoflqj
Copy link
Contributor

Checklist

  • Closing issues: #issue
  • Mark this if you consider it ready to merge
  • I've added tests (optional)
  • I wrote some lines in the radare2book

Description

#18150
As I said in discord, there's a problem of r_skiplist_insert. When it meets duplicate key, it simply returns the original node. but this result is always ignored, thus a call r_skiplist_insert (list, data) may cause memory leak.
Should we check the result every time, or use a new function to insert and free if duplicate?
the leak can be reproduced by r2 -Qc 'pd 2~?push' bins/mach0/arm16-ofp.lzh

@trufae
Copy link
Collaborator

trufae commented Jan 18, 2021

Do you think we can merge this PR as is? or you want to address this skiplist issue you mention in te same pr?

@trufae trufae added this to the 5.0.1 milestone Jan 18, 2021
@eagleoflqj
Copy link
Contributor Author

Do you think we can merge this PR as is? or you want to address this skiplist issue you mention in te same pr?

You mean add the api to automatically free? If you think it’s the right way, then i’ll do it in this pr.

libr/util/skiplist.c Outdated Show resolved Hide resolved
@trufae trufae merged commit b878409 into radareorg:master Jan 19, 2021
@eagleoflqj eagleoflqj deleted the memleak-apple branch January 19, 2021 12:51
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

Successfully merging this pull request may close these issues.

None yet

2 participants