if *userdata was a NULL pointer it would be dereferenced
it even after a NULL pointer check. The dereference
was moved inside the NULL pointer check to prevent the
pointer dereference.
Change-Id: I334d56c210e81329bcfef9936fbe653cc5561e8f
Signed-off-by: George Nash <george.nash@intel.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/15371
Tested-by: jenkins-iotivity <jenkins-iotivity@opendaylight.org>
Reviewed-by: Jihun Ha <jihun.ha@samsung.com>
Reviewed-by: JungYong KIM <jyong2.kim@samsung.com>
Reviewed-by: Habib Virji <habib.virji@samsung.com>
Reviewed-by: Uze Choi <uzchoi@samsung.com>
if(*userdata != NULL)
{
*userdata = (void*)OICMalloc(sizeof(UserProperties));
+ ((UserProperties*)(*userdata))->userValue_int = value;
}
OIC_LOG_V(INFO, ESX_ENROLLEE_TAG, "[User specific property] %s : %ld",
USERPROPERTY_KEY_INT, value);
- ((UserProperties*)(*userdata))->userValue_int = value;
g_userProperties.userValue_int = value;
}
}