Here is the function:
static int deviceMethodCallback(const char method_name, const unsigned char payload, size_t size, unsigned char* response, size_t response_size, void* userContextCallback)
I wonder if I should free(payload). No explanation was provided by ESP_AZURE. I wonder how to handle the resources presented to deviceMethodCallback(). Thanks.
@liudr , I am not sure if this code you have mentioned is in the esp porting layer or in azure-iot-sdk-c. But in any case, as per my understanding, since it is a "const", it isn't expected to be freed
Here is the function: static int deviceMethodCallback(const char method_name, const unsigned char payload, size_t size, unsigned char* response, size_t response_size, void* userContextCallback)
I wonder if I should free(payload). No explanation was provided by ESP_AZURE. I wonder how to handle the resources presented to deviceMethodCallback(). Thanks.