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

coverity report data leak #305

Closed
danielwangksu opened this issue Jul 22, 2019 · 1 comment
Closed

coverity report data leak #305

danielwangksu opened this issue Jul 22, 2019 · 1 comment
Labels
bug Something isn't working help wanted Extra attention is needed

Comments

@danielwangksu
Copy link

danielwangksu commented Jul 22, 2019

When if (rmw_serialized_message_resize(serialized_message, data_length) != RMW_RET_OK) take the true branch tss will not be released

auto tss = new MessageTypeSupport_cpp(callbacks);
auto data_length = tss->getEstimatedSerializedSize(ros_message);
if (serialized_message->buffer_capacity < data_length) {
if (rmw_serialized_message_resize(serialized_message, data_length) != RMW_RET_OK) {
RMW_SET_ERROR_MSG("unable to dynamically resize serialized message");
return RMW_RET_ERROR;

Same for if (rmw_serialized_message_resize(serialized_message, data_length) != RMW_RET_OK)

auto tss = _create_message_type_support(ts->data, ts->typesupport_identifier);
auto data_length = tss->getEstimatedSerializedSize(ros_message);
if (serialized_message->buffer_capacity < data_length) {
if (rmw_serialized_message_resize(serialized_message, data_length) != RMW_RET_OK) {
RMW_SET_ERROR_MSG("unable to dynamically resize serialized message");
return RMW_RET_ERROR;

@mabelzhang mabelzhang added bug Something isn't working help wanted Extra attention is needed labels Aug 22, 2019
@clalancette
Copy link
Contributor

This was actually fixed by #590 and #350, so closing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

3 participants