mirror of
https://github.com/nginx/nginx.git
synced 2024-12-12 02:09:04 +08:00
QUIC: fixed memory leak in ngx_quic_send_frames().
The function did not free passed frames in case of error.
This commit is contained in:
parent
46a01acdc0
commit
7250a7688d
@ -3839,6 +3839,7 @@ ngx_quic_send_frames(ngx_connection_t *c, ngx_quic_send_ctx_t *ctx,
|
|||||||
|
|
||||||
len = ngx_quic_create_frame(p, f);
|
len = ngx_quic_create_frame(p, f);
|
||||||
if (len == -1) {
|
if (len == -1) {
|
||||||
|
ngx_quic_free_frames(c, frames);
|
||||||
return NGX_ERROR;
|
return NGX_ERROR;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -3897,11 +3898,13 @@ ngx_quic_send_frames(ngx_connection_t *c, ngx_quic_send_ctx_t *ctx,
|
|||||||
pkt.num_len, pkt.trunc);
|
pkt.num_len, pkt.trunc);
|
||||||
|
|
||||||
if (ngx_quic_encrypt(&pkt, ssl_conn, &res) != NGX_OK) {
|
if (ngx_quic_encrypt(&pkt, ssl_conn, &res) != NGX_OK) {
|
||||||
|
ngx_quic_free_frames(c, frames);
|
||||||
return NGX_ERROR;
|
return NGX_ERROR;
|
||||||
}
|
}
|
||||||
|
|
||||||
len = c->send(c, res.data, res.len);
|
len = c->send(c, res.data, res.len);
|
||||||
if (len == NGX_ERROR || (size_t) len != res.len) {
|
if (len == NGX_ERROR || (size_t) len != res.len) {
|
||||||
|
ngx_quic_free_frames(c, frames);
|
||||||
return NGX_ERROR;
|
return NGX_ERROR;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user