diff --git a/src/http_client.c b/src/http_client.c index f06be6594..e8d7b05c5 100644 --- a/src/http_client.c +++ b/src/http_client.c @@ -946,8 +946,6 @@ more: return; end: - if (hc->ops.res_end) - hc->ops.res_end(hc); si_shutw(si); si_shutr(si); return; @@ -963,6 +961,8 @@ static void httpclient_applet_release(struct appctx *appctx) * again from the caller */ hc->appctx = NULL; + if (hc->ops.res_end) + hc->ops.res_end(hc); /* destroy the httpclient when set to autotokill */ if (hc->flags & HTTPCLIENT_FA_AUTOKILL) {