if (copyOfRequest)
{
- // Do shallow copy
memcpy(copyOfRequest, entityHandlerRequest, sizeof(OCEntityHandlerRequest));
+ copyOfRequest->payload = NULL;
+ copyOfRequest->query = NULL;
+ copyOfRequest->numRcvdVendorSpecificHeaderOptions = 0;
+ copyOfRequest->rcvdVendorSpecificHeaderOptions = NULL;
- if (copyOfRequest->query)
+ if (entityHandlerRequest->query)
{
copyOfRequest->query = OICStrdup(entityHandlerRequest->query);
if (!copyOfRequest->query)
copyOfRequest->payload = (OCPayload *)
(OCRepPayloadClone ((OCRepPayload*) entityHandlerRequest->payload));
}
-
- // Ignore vendor specific header options for example
- copyOfRequest->numRcvdVendorSpecificHeaderOptions = 0;
- copyOfRequest->rcvdVendorSpecificHeaderOptions = NULL;
}
if (copyOfRequest)
}\r
\r
bool currPolicy = NSGetPolicy();\r
- NSAskAcceptanceToUser(entityHandlerRequest);\r
+ NSAskAcceptanceToUser(NSCopyOCEntityHandlerRequest(entityHandlerRequest));\r
\r
if (currPolicy == NS_POLICY_PROVIDER)\r
{\r
NS_LOG(DEBUG, "NSGetSubscriptionAccepter == NS_ACCEPTER_CONSUMER");\r
NSSendConsumerSubResponse(NSCopyOCEntityHandlerRequest(entityHandlerRequest));\r
}\r
+\r
+ NSFreeOCEntityHandlerRequest(entityHandlerRequest);\r
}\r
else if (resourceType == NS_RESOURCE_SYNC)\r
{\r