X-Git-Url: http://www.privoxy.org/gitweb/?p=privoxy.git;a=blobdiff_plain;f=client-tags.c;h=da925452b8a947bbec31f42f43bf44e0dc6c000d;hp=c8d860ed7281c17b7ba304ef07015b977a53c91e;hb=44e17dd7246c755ee40949ae4dee6f334c3dd7e3;hpb=3c38ebf41d3a480c3c140eb9513d11e7f7b7fe3c diff --git a/client-tags.c b/client-tags.c index c8d860ed..da925452 100644 --- a/client-tags.c +++ b/client-tags.c @@ -4,7 +4,7 @@ * * Purpose : Functions related to client-specific tags. * - * Copyright : Copyright (C) 2016 Fabian Keil + * Copyright : Copyright (C) 2016-2017 Fabian Keil * * This program is free software; you can redistribute it * and/or modify it under the terms of the GNU General @@ -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);