Skip to content

Conversation

@ralwing
Copy link

@ralwing ralwing commented Sep 12, 2025

Related Issues & PRs

Fix the double free error mentioned
ouster-lidar/ouster-ros#486
It's a copy of PR:
ouster-lidar#669

Summary of Changes

Replace the extern linkage with the safe function calls.

Validation

ralwing and others added 2 commits September 1, 2025 07:44
Co-authored-by: Ussama Naal <606033+Samahu@users.noreply.github.com>
Copilot AI review requested due to automatic review settings September 12, 2025 08:09
Copy link

Copilot AI left a 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 double free error by replacing direct extern linkage with safe function calls that return references to static constants. This prevents potential memory management issues when the same constants are accessed from multiple translation units.

  • Converts extern variable declarations to function declarations that return const references
  • Changes extern variable definitions to static variables with accompanying getter functions
  • Updates all usage sites to call the new getter functions instead of accessing variables directly

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 from extern variables to const reference getter functions
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.

@ralwing ralwing merged commit 96cc7c2 into master Sep 12, 2025
9 of 10 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