Problem: When SIGINT signal is raised, occlient called OCStop(). OCStop() function called deleteResource() to delete the resources. deleteResource() takes OCResource* as first argument and dont check the NULL value.
Fix: Null check for argument in deleteResource().
Change-Id: I1f71bc5f90ef7199bf33da7157c8e52d2ffe94dd
Signed-off-by: sonu1.yadav <sonu1.yadav@samsung.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/1687
Tested-by: jenkins-iotivity <jenkins-iotivity@opendaylight.org>
Reviewed-by: Omkar Hegde <omkar.m.hegde@intel.com>
Reviewed-by: Erich Keane <erich.keane@intel.com>
{
OCResource *prev = NULL;
OCResource *temp = NULL;
+ if(!resource)
+ {
+ OC_LOG_V(DEBUG,TAG,"resource is NULL");
+ return OC_STACK_INVALID_PARAM;
+ }
OC_LOG_V (INFO, TAG, "Deleting resource %s", resource->uri);