Skip to content

Fix memory leak when passing XDR data to Rust#472

Merged
2opremio merged 2 commits intostellar:mainfrom
2opremio:fix-leak-in-xdr-conversion
Jul 14, 2025
Merged

Fix memory leak when passing XDR data to Rust#472
2opremio merged 2 commits intostellar:mainfrom
2opremio:fix-leak-in-xdr-conversion

Conversation

@2opremio
Copy link
Contributor

@2opremio 2opremio commented Jul 14, 2025

What

Deallocate XDR data after passing it down to Rust for JSON conversion.

Also, make sure that XDR converted to C representation is deallocated in the case of any errors.

Why

Otherwise the XDR data is leaked. It may be the culprit of #448 (or part of it at least).

This effectively was causing leaks amounting to the size of any XDR data converted to JSON.

Known limitations

N/A

@2opremio 2opremio requested a review from Shaptic July 14, 2025 00:11
@2opremio 2opremio changed the title Fix memory leak in XDR to JSON conversions Fix memory leak when passing XDR data to Rust Jul 14, 2025
@2opremio 2opremio merged commit e7ec889 into stellar:main Jul 14, 2025
16 of 17 checks passed
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