-
Notifications
You must be signed in to change notification settings - Fork 451
fix-double-free #485 #669
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
base: master
Are you sure you want to change the base?
fix-double-free #485 #669
Conversation
a23aa16 to
4aa6a52
Compare
4aa6a52 to
193a500
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR fixes a potential double-free issue by replacing C-style extern variable declarations with getter functions that return references to static variables. This change improves encapsulation and prevents potential memory management issues.
- Replace extern variable declarations with getter function declarations in the header
- Convert extern variable definitions to static variables with corresponding getter functions
- Update callers to use getter functions instead of direct variable access
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| ouster_client/include/ouster/types.h | Updates header declarations to use getter functions instead of extern variables |
| ouster_client/src/sensor_info.cpp | Implements static variables with getter functions and updates usage sites |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks good to me, fully agree with you findings.
Co-authored-by: Ussama Naal <606033+Samahu@users.noreply.github.com>
Related Issues & PRs
ouster-lidar/ouster-ros#485
Summary of Changes
This change replaces C like extern variable linkage with getter function
Validation
Build and tests.
Related to ouster-lidar/ouster-ros#486