-
Notifications
You must be signed in to change notification settings - Fork 44
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
fix rclc_example: memory leaking in msg.data allocation #386
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Signed-off-by: zhangtonghe <[email protected]>
pablogs9
approved these changes
Jul 28, 2023
Codecov Report
@@ Coverage Diff @@
## humble #386 +/- ##
==========================================
- Coverage 69.13% 69.06% -0.08%
==========================================
Files 16 16
Lines 2715 2715
Branches 765 765
==========================================
- Hits 1877 1875 -2
- Misses 451 452 +1
- Partials 387 388 +1 |
JanStaschulat
approved these changes
Jul 28, 2023
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.
LGTM
@Zard-C thank you for this pull request! |
@Mergifyio backport rolling |
✅ Backports have been created
|
mergify bot
pushed a commit
that referenced
this pull request
Jul 28, 2023
Signed-off-by: zhangtonghe <[email protected]> Co-authored-by: zhangtonghe <[email protected]> (cherry picked from commit 7af2054)
Zard-C
added a commit
to Zard-C/rclc
that referenced
this pull request
Aug 21, 2023
Co-authored-by: zhangtonghe <[email protected]> (cherry picked from commit 7af2054) Signed-off-by: Zard-C <[email protected]>
JanStaschulat
added a commit
that referenced
this pull request
Aug 22, 2023
… (#387) * fix rclc_example: memory leaking in msg.data allocation (#386) Signed-off-by: zhangtonghe <[email protected]> Co-authored-by: zhangtonghe <[email protected]> (cherry picked from commit 7af2054) * fix: deprecated rcl_timer_init (#389) * fix: deprecated rcl_timer_init Signed-off-by: Zard-C <[email protected]> Signed-off-by: zhangtonghe <[email protected]> Signed-off-by: Zard-C <[email protected]> * fix: switch rcl_timer_init to rcl_timer_init2 Signed-off-by: Zard-C <[email protected]> Signed-off-by: zhangtonghe <[email protected]> Signed-off-by: Zard-C <[email protected]> * update rclc_timer_init_default and it's invokation Signed-off-by: zhangtonghe <[email protected]> Signed-off-by: Zard-C <[email protected]> * Revert "update rclc_timer_init_default and it's invokation" This reverts commit ebc3edb. Signed-off-by: zhangtonghe <[email protected]> Signed-off-by: Zard-C <[email protected]> * fix: rcl_timer_init usage Combined changes from multiple commits to refactor the usage of rcl_timer_init for better compatibility and clarity. Signed-off-by: Zard-C <[email protected]> Signed-off-by: zhangtonghe <[email protected]> * Update rclc/include/rclc/timer.h Co-authored-by: Jan Staschulat <[email protected]> Signed-off-by: Zard-C <[email protected]> --------- Signed-off-by: Zard-C <[email protected]> Signed-off-by: zhangtonghe <[email protected]> Co-authored-by: zhangtonghe <[email protected]> Co-authored-by: Jan Staschulat <[email protected]> --------- Signed-off-by: Zard-C <[email protected]> Signed-off-by: zhangtonghe <[email protected]> Co-authored-by: Zard-C <[email protected]> Co-authored-by: zhangtonghe <[email protected]> Co-authored-by: Jan Staschulat <[email protected]>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fix bug: memory leaking while msg.data allocation.
This bug is caused by using malloc allocate memory for the std_msg.data.data, but we call std_msgs__msg__String__init(), msg.data.data was allocated a block memory which size is 1, thus we should use allocator.reallocate to reallocate memory for msg.data.data.
Fixes #385
Signed-off-by: Zard-C [email protected]