Skip to content

Commit

Permalink
eliminate memory leak in partially-completed constructor
Browse files Browse the repository at this point in the history
  • Loading branch information
codebot committed Apr 1, 2016
1 parent fad984d commit 19bc9ec
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions rmw_fastrtps_cpp/src/functions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -300,6 +300,7 @@ extern "C"
static_cast<const char *>(malloc(sizeof(char) * strlen(name) + 1));
if (!node_handle->name) {
RMW_SET_ERROR_MSG("failed to allocate memory");
free(node_handle);
return NULL;
}
memcpy(const_cast<char *>(node_handle->name), name, strlen(name) + 1);
Expand Down

0 comments on commit 19bc9ec

Please sign in to comment.