upstream: add free_upstream_list ()

Michael
This commit is contained in:
Michael Adam 2009-12-06 13:26:50 +01:00
parent 4a8ea0d23b
commit 21aa3ecf60
2 changed files with 13 additions and 0 deletions

View File

@ -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

View File

@ -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_ */