-const char list_rcs[] = "$Id: list.c,v 1.29 2012/03/09 17:55:50 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
#include "list.h"
#include "miscutil.h"
-const char list_h_rcs[] = LIST_H_VERSION;
-
-
static int list_is_valid (const struct list *the_list);
* 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.
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)
{
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