alibaba / xquic

XQUIC Library released by Alibaba is a cross-platform implementation of QUIC and HTTP/3 protocol.
Apache License 2.0
1.7k stars 327 forks source link

[Bug]: test_server.c may cause memory leak #263

Closed Luffbee closed 9 months ago

Luffbee commented 1 year ago

What happened?

test_server.c allocate user date in server_accept callback, but free it in conn_close_notify callback, which may cause memory leak if a connection is closed before it get ALPN. This can be fixed by implementing the server_refuse callback, which is designed to work with server_accept in such scenarios.

Steps To Reproduce

Run it with valgrind in a high loss rate environment.

Relevant log output

No response