Skip to content

Conversation

@jacobperron
Copy link
Member

Backport #794 to Foxy.

* Fix memory leak in rcl_subscription_init()/rcl_publisher_init()

In rcl_subscription_init(), while rmw_subscription_get_actual_qos()
return failure, created rmw subscription handle isn't freed.
In rcl_publisher_init(), while rmw_publisher_get_actual_qos()
return failure, created rmw publisher handle isn't freed.

Signed-off-by: Barry Xu <[email protected]>

* Remove codes on the cascading errors.

Signed-off-by: Barry Xu <[email protected]>

* Change code style

Signed-off-by: Barry Xu <[email protected]>

* Output error message to stderr

Signed-off-by: Barry Xu <[email protected]>
@jacobperron jacobperron self-assigned this Oct 14, 2020
@jacobperron jacobperron changed the title Fix memory leak in rcl_subscription_init()/rcl_publisher_init() (#794) [foxy] Fix memory leak in rcl_subscription_init()/rcl_publisher_init() (#794) Oct 14, 2020
This version of the macro is not available in Foxy.

Signed-off-by: Jacob Perron <[email protected]>
@jacobperron
Copy link
Member Author

The rcutils macro being used isn't available in Foxy, so I've opted to not use a format string to print the file and line number (4bf6989).

Signed-off-by: Jacob Perron <[email protected]>
@jacobperron jacobperron merged commit 76a706d into foxy Oct 16, 2020
@delete-merged-branch delete-merged-branch bot deleted the jacob/backport_foxy_794 branch October 16, 2020 20:42
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.

5 participants