Commit 5671e879 authored by Mandeep Shetty's avatar Mandeep Shetty Committed by Erich Keane

Fix memory leaks in handling server requests.

Two memory leaks fixed. One after a response is sent and one when a
server request is deleted. malloc'ed tokens were not free'd in both
instances.

Change-Id: I125bab278dd8542ff5970e6655b24a5cbacfe7e9
Signed-off-by: default avatarMandeep Shetty <mandeep.shetty@intel.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/1040Tested-by: default avatarjenkins-iotivity <jenkins-iotivity@opendaylight.org>
Reviewed-by: default avatarSakthivel Samidurai <sakthivel.samidurai@intel.com>
Reviewed-by: default avatarErich Keane <erich.keane@intel.com>
parent 9cfd314b
......@@ -89,6 +89,7 @@ static void DeleteServerRequest(OCServerRequest * serverRequest)
if(serverRequest)
{
LL_DELETE(serverRequestList, serverRequest);
OCFree(serverRequest->requestToken);
OCFree(serverRequest);
serverRequest = NULL;
OC_LOG(INFO, TAG, PCF("Server Request Removed!!"));
......@@ -606,6 +607,7 @@ OCStackResult HandleSingleResponse(OCEntityHandlerResponse * ehResponse)
}
#endif
OCFree(responseInfo.info.token);
OCFree(responseInfo.info.options);
//Delete the request
FindAndDeleteServerRequest(serverRequest);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment