X-Git-Url: http://www.privoxy.org/gitweb/?p=privoxy.git;a=blobdiff_plain;f=list.c;h=dadba717a8feecd68a0e7def9e5c9fd09fa9ce3d;hp=c234414dfb4ef5824200b2013f2970fd6885348f;hb=2febce5d76114e1bf95bbd6ffea81567e8e6fb3f;hpb=bbf700a052ad341be68a7ad2bb61080a015d3184 diff --git a/list.c b/list.c index c234414d..dadba717 100644 --- a/list.c +++ b/list.c @@ -1,11 +1,10 @@ -const char list_rcs[] = "$Id: list.c,v 1.30 2014/10/18 11:31:52 fabiankeil Exp $"; /********************************************************************* * * File : $Source: /cvsroot/ijbswa/current/list.c,v $ * * Purpose : Declares functions to handle lists. * - * Copyright : Written by and Copyright (C) 2001-2007 the SourceForge + * Copyright : Written by and Copyright (C) 2001-2007 members of the * Privoxy team. http://www.privoxy.org/ * * Based on the Internet Junkbuster originally written @@ -56,9 +55,6 @@ const char list_rcs[] = "$Id: list.c,v 1.30 2014/10/18 11:31:52 fabiankeil Exp $ #include "list.h" #include "miscutil.h" -const char list_h_rcs[] = LIST_H_VERSION; - - static int list_is_valid (const struct list *the_list); @@ -1064,7 +1060,7 @@ jb_err unmap(struct map *the_map, const char *name) assert(the_map); assert(name); - last_entry = the_map->first; + last_entry = NULL; for (cur_entry = the_map->first; cur_entry != NULL; cur_entry = cur_entry->next) { @@ -1096,7 +1092,11 @@ jb_err unmap(struct map *the_map, const char *name) freez(cur_entry->name); freez(cur_entry->value); freez(cur_entry); - + if (last_entry == NULL) + { + /* The map only had a single entry which has just been removed. */ + break; + } cur_entry = last_entry; } else