From 44a9181f3f0511ad95ec7892bae61a56ddee7abe Mon Sep 17 00:00:00 2001 From: tbeu Date: Sat, 25 Aug 2018 16:51:37 +0200 Subject: [PATCH] Fix redundant NULL checks Signed-off-by: tbeu --- src/MQTTAsync.c | 3 +-- src/Tree.c | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/src/MQTTAsync.c b/src/MQTTAsync.c index 50d57564..ebbd0f73 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); }