There was a deadcode.
It has goto statement which is only called when memory allocation fails.
In the goto statement, it was trying to free the variable that failed in memory allocation.
BUG: https://jira.iotivity.org/browse/IOT-1664
Change-Id: I36ea779ee5bae131a10f55dafcb45728c1e7dc9b
Signed-off-by: Habib Virji <habib.virji@samsung.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/15373
Tested-by: jenkins-iotivity <jenkins-iotivity@opendaylight.org>
Reviewed-by: Dan Mihai <Daniel.Mihai@microsoft.com>
Reviewed-by: George Nash <george.nash@intel.com>
Reviewed-by: Ziran Sun <ziran.sun@samsung.com>
return OC_STACK_OK;
exit:
- if (serverResponse)
- {
- OICFree(serverResponse);
- serverResponse = NULL;
- }
*response = NULL;
return OC_STACK_NO_MEMORY;
}