From 2e6999df4aecfa2c32072e556e3e829b54a3a103 Mon Sep 17 00:00:00 2001 From: Michael Adam Date: Sun, 6 Dec 2009 23:04:05 +0100 Subject: Add free_reversepath_list(). Michael --- src/reverse-proxy.c | 15 +++++++++++++++ src/reverse-proxy.h | 1 + 2 files changed, 16 insertions(+) (limited to 'src') diff --git a/src/reverse-proxy.c b/src/reverse-proxy.c index efafa74..fdc9098 100644 --- a/src/reverse-proxy.c +++ b/src/reverse-proxy.c @@ -92,6 +92,21 @@ struct reversepath *reversepath_get (char *url, struct reversepath *reverse) return NULL; } +/** + * Free a reversepath list + */ + +void free_reversepath_list (struct reversepath *reverse) +{ + while (reverse) { + struct reversepath *tmp = reverse; + reverse = reverse->next; + safefree (tmp->url); + safefree (tmp->path); + safefree (tmp); + } +} + /* * Rewrite the URL for reverse proxying. */ diff --git a/src/reverse-proxy.h b/src/reverse-proxy.h index 252b41b..64b4acd 100644 --- a/src/reverse-proxy.h +++ b/src/reverse-proxy.h @@ -35,6 +35,7 @@ extern void reversepath_add (const char *path, const char *url, struct reversepath **reversepath_list); extern struct reversepath *reversepath_get (char *url, struct reversepath *reverse); +void free_reversepath_list (struct reversepath *reverse); extern char *reverse_rewrite_url (struct conn_s *connptr, hashmap_t hashofheaders, char *url); -- cgit v1.2.3