X-Git-Url: http://www.privoxy.org/gitweb/?p=privoxy.git;a=blobdiff_plain;f=list.c;h=e0736d39fa28b929db455dcbb4a43cd987562399;hp=d987814443caa388c8d9e77ad253262a0f575120;hb=40afc653330e1f37e2f5257ddc16cb620c88a3e9;hpb=4f4d26f5a63e82b6429a28db1b28698ec5f6c19c diff --git a/list.c b/list.c index d9878144..e0736d39 100644 --- a/list.c +++ b/list.c @@ -1,11 +1,11 @@ -const char list_rcs[] = "$Id: list.c,v 1.29 2012/03/09 17:55:50 fabiankeil Exp $"; +const char list_rcs[] = "$Id: list.c,v 1.32 2014/11/14 10:39:49 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 @@ -902,7 +902,7 @@ struct map *new_map(void) * Function : free_map * * Description : Free the memory occupied by a map and its - * depandant strings + * dependent strings * * Parameters : * 1 : the_map = map to be freed. May be NULL. @@ -1064,7 +1064,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 +1096,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