upstream: add free_upstream_list ()
Michael
This commit is contained in:
parent
4a8ea0d23b
commit
21aa3ecf60
@ -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
|
||||
|
@ -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_ */
|
||||
|
Loading…
Reference in New Issue
Block a user