[
https://issues.apache.org/jira/browse/PROTON-2199?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17105264#comment-17105264
]
ASF subversion and git services commented on PROTON-2199:
---------------------------------------------------------
Commit 625dec907e116a627893b4e7f90be01e6f988f5d in qpid-proton's branch
refs/heads/master from Jiri Daněk
[ https://gitbox.apache.org/repos/asf?p=qpid-proton.git;h=625dec9 ]
PROTON-2199 fix memory leak in C++ object inspect (#244)
> 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
> Fix For: proton-c-0.32.0
>
>
> 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: [email protected]
For additional commands, e-mail: [email protected]