mirror of
https://github.com/haproxy/haproxy.git
synced 2026-06-11 09:52:56 -04:00
MINOR: quic: Possible memleak in qc_new_conn()
This should fix Coverity CID 375047 in GH #1536 where <buf_area> could leak because not always freed by by quic_conn_drop(), especially when not stored in <qc> variable.
This commit is contained in:
parent
225c31fc9f
commit
c0b481f87b
1 changed files with 4 additions and 1 deletions
|
|
@ -3561,7 +3561,7 @@ static struct quic_conn *qc_new_conn(unsigned int version, int ipv4,
|
|||
struct quic_conn *qc;
|
||||
/* Initial CID. */
|
||||
struct quic_connection_id *icid;
|
||||
char *buf_area;
|
||||
char *buf_area = NULL;
|
||||
struct listener *l = NULL;
|
||||
|
||||
TRACE_ENTER(QUIC_EV_CONN_INIT);
|
||||
|
|
@ -3668,6 +3668,9 @@ static struct quic_conn *qc_new_conn(unsigned int version, int ipv4,
|
|||
|
||||
err:
|
||||
TRACE_DEVEL("leaving in error", QUIC_EV_CONN_INIT, qc ? qc : NULL);
|
||||
pool_free(pool_head_quic_conn_rxbuf, buf_area);
|
||||
if (qc)
|
||||
qc->rx.buf.area = NULL;
|
||||
quic_conn_drop(qc);
|
||||
return NULL;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue