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

[R] Fix potential memory leaks when creating externalptr #9817

Merged
merged 1 commit into from
Nov 29, 2023

Conversation

david-cortes
Copy link
Contributor

ref #9810

This PR fixes a situation in which an R allocation failure when creating externalptr objects could lead to memory leaks by not freeing C++ allocated objects, as it triggers (on failure) a longjump which bypasses their destructors.

It doesn't make the modification in function XGDMatrixCreateFromMat_R which is being modified in this other PR.

@trivialfis
Copy link
Member

Can we close this issue #7246 once both PRs are merged?

@trivialfis trivialfis merged commit c0ef2f8 into dmlc:master Nov 29, 2023
24 of 26 checks passed
@david-cortes
Copy link
Contributor Author

Can we close this issue #7246 once both PRs are merged?

Thanks for remininding me about this issue. Here I've created a new PR that should fix everything in there: #9823

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.

2 participants