You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@qpid.apache.org by "Jiri Daněk (Jira)" <ji...@apache.org> on 2020/04/30 12:43:00 UTC
[jira] [Assigned] (PROTON-2199) memory leak in c++ object inspect
[ https://issues.apache.org/jira/browse/PROTON-2199?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Jiri Daněk reassigned PROTON-2199:
----------------------------------
Assignee: Jiri Daněk
> memory leak in c++ object inspect
> ---------------------------------
>
> Key: PROTON-2199
> URL: https://issues.apache.org/jira/browse/PROTON-2199
> Project: Qpid Proton
> Issue Type: Bug
> Components: cpp-binding
> Reporter: Jeff Eaton
> Assignee: Jiri Daněk
> Priority: Major
> Labels: easyfix
>
> The {{pn_ptr_base::inspect()}} function in {{cpp/src/object.cpp}} calls {{pn_string(NULL)}} on line 36 and never frees the allocated memory with {{pn_free()}}.
> The fix is to create the std::string as a temporary variable, then free the pn_string_t, then return the temporary std::string, like this:
> {{std::string tmp(pn_string_get(s));}}
> {{pn_free(s);}}
> {{return tmp;}}
--
This message was sent by Atlassian Jira
(v8.3.4#803005)
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@qpid.apache.org
For additional commands, e-mail: dev-help@qpid.apache.org