diff --git a/src/MQTTAsync.c b/src/MQTTAsync.c index c633282e..5f33f062 100644 --- a/src/MQTTAsync.c +++ b/src/MQTTAsync.c @@ -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; } } diff --git a/src/Tree.c b/src/Tree.c index 337d0804..bc6b7640 100644 --- a/src/Tree.c +++ b/src/Tree.c @@ -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); }