diff --git a/src/http_client.c b/src/http_client.c index ff2ab4e85..f137a6e3b 100644 --- a/src/http_client.c +++ b/src/http_client.c @@ -628,6 +628,9 @@ struct httpclient *httpclient_new(void *caller, enum http_meth_t meth, struct is { struct httpclient *hc; + if (!httpclient_proxy) + return NULL; + hc = calloc(1, sizeof(*hc)); if (!hc) goto err; @@ -655,6 +658,9 @@ struct httpclient *httpclient_new_from_proxy(struct proxy *px, void *caller, enu { struct httpclient *hc; + if (!px) + return NULL; + hc = httpclient_new(caller, meth, url); if (!hc) return NULL;