SOPC_ClientHelperNew_ServiceSync unclear behavior on request memory management in case of failure
Context
SOPC_ClientHelperNew_ServiceSync
comments :
- "Request memory is managed by the client after a successful return or in case of timeout." => otherwise Caller seems responsible ?
- "it shall be allocated on heap since it will be freed by S2OPC library during treatment." (under
request
parameter) => Request memory is always freed by this function.
Problem
When the status of this function returns SOPC_STATUS_CLOSED
, if the caller tries to free the Request memory, it gets a double free error.
Solution
Request memory must always be managed in this function even in case of error.
Edited by Vincent Monfort