Merge branch 'fix-redundant-null-checks' of https://github.com/tbeu/paho.mqtt.c into develop

This commit is contained in:
Ian Craggs 2018-08-28 12:18:07 +01:00
commit 6f93f2d2a6
2 changed files with 2 additions and 3 deletions

View File

@ -2996,8 +2996,7 @@ static int MQTTAsync_disconnect1(MQTTAsync handle, const MQTTAsync_disconnectOpt
dis->command.details.dis.timeout = options->timeout;
if (m->c->MQTTVersion >= MQTTVERSION_5 && options->struct_version >= 1)
{
if (options != NULL)
dis->command.properties = MQTTProperties_copy(&options->properties);
dis->command.properties = MQTTProperties_copy(&options->properties);
dis->command.details.dis.reasonCode = options->reasonCode;
}
}

View File

@ -453,7 +453,7 @@ void* TreeRemoveNodeIndex(Tree* aTree, Node* curnode, int index)
{
Node temp;
memset(&temp, '\0', sizeof(Node));
temp.parent = (redundant) ? redundant->parent : NULL;
temp.parent = redundant->parent;
temp.red = 0;
TreeBalanceAfterRemove(aTree, &temp, index);
}