remove_tag_for_client(): Silence a coverity warning (CID #161202)
authorFabian Keil <fk@fabiankeil.de>
Sun, 8 May 2016 10:46:05 +0000 (10:46 +0000)
committerFabian Keil <fk@fabiankeil.de>
Sun, 8 May 2016 10:46:05 +0000 (10:46 +0000)
client-tags.c

index 54c4704..0bcbf35 100644 (file)
@@ -365,6 +365,13 @@ static void remove_tag_for_client(const char *client_address, const char *tag)
       clients_with_tags = clients_with_tags->next;
    }
 
+   assert(clients_with_tags != NULL);
+   if (clients_with_tags == NULL)
+   {
+      log_error(LOG_LEVEL_ERROR,
+         "Tried to remove tag %s for tag-less client %s",
+         tag, client_address);
+   }
    enabled_tags = clients_with_tags->tags;
    while (enabled_tags != NULL)
    {