diff options
author | Michael Adam <obnox@samba.org> | 2009-12-06 13:26:50 +0100 |
---|---|---|
committer | Michael Adam <obnox@samba.org> | 2009-12-07 00:22:36 +0100 |
commit | 21aa3ecf60e5e6e54a9775876ae9e0eb6224e9cd (patch) | |
tree | 4a8b2d69a5b1c9190b2926ba53efa7670d3cc80f | |
parent | 4a8ea0d23bcff15ce3ccda9b3b85cb7b93345bf0 (diff) |
upstream: add free_upstream_list ()
Michael
-rw-r--r-- | src/upstream.c | 12 | ||||
-rw-r--r-- | src/upstream.h | 1 |
2 files changed, 13 insertions, 0 deletions
diff --git a/src/upstream.c b/src/upstream.c index dd91817..3966f06 100644 --- a/src/upstream.c +++ b/src/upstream.c @@ -209,4 +209,16 @@ struct upstream *upstream_get (char *host, struct upstream *up) return up; } + +void free_upstream_list (struct upstream *up) +{ + while (up) { + struct upstream *tmp = up; + up = up->next; + safefree (tmp->domain); + safefree (tmp->host); + safefree (tmp); + } +} + #endif diff --git a/src/upstream.h b/src/upstream.h index 5125410..34dad68 100644 --- a/src/upstream.h +++ b/src/upstream.h @@ -43,6 +43,7 @@ struct upstream { extern void upstream_add (const char *host, int port, const char *domain, struct upstream **upstream_list); extern struct upstream *upstream_get (char *host, struct upstream *up); +extern void free_upstream_list (struct upstream *up); #endif /* UPSTREAM_SUPPORT */ #endif /* _TINYPROXY_UPSTREAM_H_ */ |