X-Git-Url: http://www.privoxy.org/gitweb/?a=blobdiff_plain;f=list.c;h=c234414dfb4ef5824200b2013f2970fd6885348f;hb=38dbf7e5ff2c91c23be30a58e6a17546fdffede4;hp=fcafb5777b75da30055a7ff6795ea2424e7eba1d;hpb=8675bc0559b182e88e9dfbfd98cc9c9f8717cf0b;p=privoxy.git diff --git a/list.c b/list.c index fcafb577..c234414d 100644 --- a/list.c +++ b/list.c @@ -1,4 +1,4 @@ -const char list_rcs[] = "$Id: list.c,v 1.28 2012/03/09 16:23:50 fabiankeil Exp $"; +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 $ @@ -876,15 +876,24 @@ int list_contains_item(const struct list *the_list, const char *str) * Function : new_map * * Description : Create a new, empty map. + * Causes program exit if the memory allocation fails. * * Parameters : N/A * - * Returns : A new, empty map, or NULL if out of memory. + * Returns : A new, empty map * *********************************************************************/ struct map *new_map(void) { - return (struct map *) zalloc(sizeof(struct map)); + struct map *empty_map = zalloc(sizeof(struct map)); + + if (NULL == empty_map) + { + exit(1); + } + + return empty_map; + } @@ -893,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.