Skip to content

[Rust] Don't leak the callbacks within DownloadInstance::perform_custom_request#7216

Closed
bdash wants to merge 1 commit into
devfrom
rust-downloadinstance-leak
Closed

[Rust] Don't leak the callbacks within DownloadInstance::perform_custom_request#7216
bdash wants to merge 1 commit into
devfrom
rust-downloadinstance-leak

Conversation

@bdash

@bdash bdash commented Jul 31, 2025

Copy link
Copy Markdown
Contributor

I'm not entirely clear why this function copies the callbacks to the heap given that BNPerformCustomRequest is synchronous. Rather than changing that, I added an explicit Box::from_raw to ensure it is deallocated. This matches what is done within perform_request.

@emesare

emesare commented Aug 3, 2025

Copy link
Copy Markdown
Member

I think we probably should just avoid boxing it altogether and pass it by ref into the function: 966097b

@bdash

bdash commented Aug 5, 2025

Copy link
Copy Markdown
Contributor Author

@emesare is going to fix the leak via 966097b in the near future.

@bdash bdash closed this Aug 5, 2025
@bdash bdash deleted the rust-downloadinstance-leak branch August 5, 2025 18:58
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