mirror of
https://github.com/curl/curl.git
synced 2026-05-30 04:27:30 +03:00
cf-h2-prox: fix peer leak
The unlinking of the new Curl_peer was happening too later after the struct had been set to zero. Move the unlink to happen before that. Fixes #21602 Reported-by: Joshua Rogers Closes #21627
This commit is contained in:
parent
061136f24b
commit
a0f08d6975
1 changed files with 1 additions and 1 deletions
|
|
@ -190,6 +190,7 @@ static void cf_h2_proxy_ctx_clear(struct cf_h2_proxy_ctx *ctx)
|
|||
}
|
||||
Curl_bufq_free(&ctx->inbufq);
|
||||
Curl_bufq_free(&ctx->outbufq);
|
||||
Curl_peer_unlink(&ctx->dest);
|
||||
tunnel_stream_clear(&ctx->tunnel);
|
||||
memset(ctx, 0, sizeof(*ctx));
|
||||
ctx->call_data = save;
|
||||
|
|
@ -199,7 +200,6 @@ static void cf_h2_proxy_ctx_free(struct cf_h2_proxy_ctx *ctx)
|
|||
{
|
||||
if(ctx) {
|
||||
cf_h2_proxy_ctx_clear(ctx);
|
||||
Curl_peer_unlink(&ctx->dest);
|
||||
curlx_free(ctx);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue