Subject: Re: [libssh2] #182: Various memory leaks

Re: [libssh2] #182: Various memory leaks

From: libssh2 Trac <>
Date: Wed, 30 Jun 2010 14:42:23 -0000

#182: Various memory leaks
  Reporter: john@… | Owner: bagder
      Type: defect | Status: assigned
  Priority: normal | Milestone: 1.2.6
 Component: API | Version: 1.2.6
Resolution: | Keywords:
    Blocks: | Blocked By:

Comment (by john@…):

 That change would work for the channel_free function. However given that
 there is a session->socket_state variable, and it is used in many places,
 and it is set to LIBSSH2_SOCKET_DISCONNECTED I felt it would be a good
 idea to actually reflect the state of the socket. There may be other
 places with similar tests that would also fail to complete (release memory
 etc..) if the socket is dead but the socket_state says it's ok.
 I feel that maybe the best thing to do is change _libssh2_recv and
 _libssh2_send functions deal with this problem, but they will need to be
 modified to take a session pointer as a variable.
 I also feel that a user defined callback for testing errno would be best,
 the user may know best as to what are valid errno's.
 Another possibility is to provide a function to set socket_state =
 LIBSSH2_SOCKET_DISCONNECTED. I actually know when the socket is bad I have
 no way to tell the session object that.

Ticket URL: <>
libssh2 <>
C library for writing portable SSH2 clients
Received on 2010-06-30