Commit 939b06f0 authored by Ian Craggs's avatar Ian Craggs

Response to bug 384016, setting will message

parent f052e8b3
......@@ -29,15 +29,15 @@
#define URI_TCP "tcp://"
char* MQTTClient_Level = "MQTTClientV3_Level ##MICROBROKER_LEVEL_TAG##";
char* MQTTClient_Version = "MQTTClientV3_Version ##MICROBROKER_VERSION_TAG##";
#define BUILD_TIMESTAMP __DATE__ " " __TIME__ /* __TIMESTAMP__ */
#define CLIENT_VERSION "1.0.0.6" /* __VERSION__ */
char* client_timestamp_eye = "MQTTClientV3_Timestamp " BUILD_TIMESTAMP;
char* client_version_eye = "MQTTClientV3_Version " CLIENT_VERSION;
static ClientStates ClientState =
{
"1.0.0.5", /* version */
CLIENT_VERSION, /* version */
NULL /* client list */
};
......@@ -724,6 +724,7 @@ int MQTTClient_connect(MQTTClient handle, MQTTClient_connectOptions* options)
if (options->will && options->will->struct_version == 0)
{
m->c->will = malloc(sizeof(willMessages));
m->c->will->msg = options->will->message;
m->c->will->qos = options->will->qos;
m->c->will->retained = options->will->retained;
......@@ -810,6 +811,11 @@ int MQTTClient_connect(MQTTClient handle, MQTTClient_connectOptions* options)
}
exit:
if (m->c->will)
{
free(m->c->will);
m->c->will = NULL;
}
Thread_unlock_mutex(mqttclient_mutex);
FUNC_EXIT_RC(rc);
return rc;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment