Ticket #134 (closed defect)

Opened 8 years ago

Last modified 8 years ago

memory leak when connection is lost

Reported by: yoichiwo7 Owned by: bagder
Priority: normal Milestone:
Component: Version:
Keywords: Cc: yoichiwo7, bagder
Blocked By: Blocks:


Version: libssh2-1.2.2

Memory for outgoing packet buffer is allocated to (session->packet->outbuf) on transport.c:737.
When the connection is lost during the session, _libssh2_transport_write() will keep the data
to send it after (transport.c:783-794).

The problem is, when I call libssh2_session_free() to cleanup the resouces, it won't
cleanup the kept memory allocated to (session->packet->outbuf).

By cleaning up (session->packet->outbuf) in session_free(), the problem could be fixed.
(Please see the diff file)


session_patch.diff (832 bytes) - added by yoichiwo7 8 years ago.
Unified diff output for added lines in session_free()

Download all attachments as: .zip

Change History

Changed 8 years ago by yoichiwo7

Unified diff output for added lines in session_free()

comment:1 Changed 8 years ago by bagder

Thanks for your report and help in improving libssh2!

A fix has just been committed to the source code repo, this case is now considered fixed and closed!

Note: See TracTickets for help on using tickets.