-
Notifications
You must be signed in to change notification settings - Fork 194
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
fixed dangling pointer using std::string #3112
Conversation
Thanks for opening this pull request! The maintainers of this repository would appreciate it if you would update the release notes by adding a file in |
Quality Gate failedFailed conditions |
@@ -569,14 +568,14 @@ const char* YarpBroker::requestRpc(const char* szport, const char* request, doub | |||
NetworkBase::disconnect(port.getName(), szport); | |||
if(!response.size() || !ret) { | |||
port.close(); | |||
return nullptr; | |||
return {}; | |||
} | |||
|
|||
port.close(); | |||
return response.toString().c_str(); |
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.
Is the c_str()
needed here?
Fix for: #3105
I'm aware that std::string is not a plain char*.
..but do we need to stick to this oooooold '99 style in libyarpmanager? I think not.
BTW, strings are used elsewhere in the same lib.