error = smartthings_payload_set_bool(resp_payload, PROP_VALUE, status);
if (error != SMARTTHINGS_RESOURCE_ERROR_NONE) {
_E("smartthings_payload_set_bool() failed, [%d]", error);
+ smartthings_payload_destroy(resp_payload);
return;
}
error = smartthings_resource_notify(st_handle, RES_CAPABILITY_PRESENCESENSOR_MAIN_0, resp_payload);
if (error != SMARTTHINGS_RESOURCE_ERROR_NONE) {
_E("smartthings_resource_notify() failed, [%d]", error);
+ smartthings_payload_destroy(resp_payload);
return;
}