void mqttmessage_destroy()

in src/mqtt_message.c [136:152]


void mqttmessage_destroy(MQTT_MESSAGE_HANDLE handle)
{
    /* Codes_SRS_MQTTMESSAGE_07_005: [If the handle parameter is NULL then mqttmessage_destroyMessage shall do nothing] */
    if (handle != NULL)
    {
        /* Codes_SRS_MQTTMESSAGE_07_006: [mqttmessage_destroyMessage shall free all resources associated with the MQTT_MESSAGE_HANDLE value] */
        if (handle->topicName != NULL)
        {
            free(handle->topicName);
        }
        if (handle->appPayload.message != NULL)
        {
            free(handle->appPayload.message);
        }
        free(handle);
    }
}