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

Don't leak msppacket every Get on HDZero/Skyzone #100

Merged
merged 1 commit into from
Jul 21, 2023

Conversation

CapnBry
Copy link
Member

@CapnBry CapnBry commented Jul 18, 2023

GetRecordingState() and GetChannelIndex() on HDZero and Skyzone VRX Backpacks allocate a new msppacket every call, but never free it. This fixes it by using a value off the stack instead of the heap.

The msppacket structure is pretty big since it contains a 64 byte buffer in addition to its other members so this will add up, but it is unlikely anyone would run out of memory due to this even though every SendIndexCmd() calls Get at least twice.

@pkendall64 pkendall64 merged commit db56cbf into ExpressLRS:master Jul 21, 2023
29 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.

None yet

2 participants