trilogy-libraries / trilogy

Trilogy is a client library for MySQL-compatible database servers, designed for performance, flexibility, and ease of embedding.
MIT License
700 stars 69 forks source link

Plug memory leaks from failed connections #144

Closed jhawthorn closed 10 months ago

jhawthorn commented 10 months ago

Under a couple conditions we could leak the internal buffer->buff buffer or a trilogy_sock_t before it was attached to the client.

These were found using RUBY_FREE_AT_EXIT=1 and ASAN/LSAN.

I made it supported to call trilogy_free multiple times on the same connection.