From ebe3afb8dd443a80d29c06fad3b9c37484d36ff5 Mon Sep 17 00:00:00 2001
From: Fabian Keil <fk@fabiankeil.de>
Date: Mon, 29 May 2017 10:15:15 +0000
Subject: [PATCH] remove_tag_for_client(): Remove a harmless 'dead store'
... and make the code easier to understand.
---
client-tags.c | 15 +++++++--------
1 file changed, 7 insertions(+), 8 deletions(-)
diff --git a/client-tags.c b/client-tags.c
index 21d3fcf6..da925452 100644
--- a/client-tags.c
+++ b/client-tags.c
@@ -473,17 +473,16 @@ static void remove_tag_for_client(const char *client_address, const char *tag)
/* Client has preceding client */
clients_with_tags->prev->next = clients_with_tags->next;
}
- freez(clients_with_tags->client);
if (clients_with_tags == requested_tags)
{
- /* Removing last tag */
- freez(requested_tags);
- clients_with_tags = requested_tags;
- }
- else
- {
- freez(clients_with_tags);
+ /*
+ * We're in the process of removing the last tag,
+ * mark the global list as empty.
+ */
+ requested_tags = NULL;
}
+ freez(clients_with_tags->client);
+ freez(clients_with_tags);
}
freez(enabled_tags->name);
freez(enabled_tags);
--
2.49.0