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

Re: [libssh2] #182: Various memory leaks

From: libssh2 Trac <>
Date: Tue, 29 Jun 2010 20:21:57 -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 bagder):

 Thanks for the patch and thanks for your patience with us. The diff makes
 things very clear. My comments/questions on it follows:

 Why is it important to set socket_state to LIBSSH2_SOCKET_DISCONNECTED
 when recv/send fails and errno isn't EINTR? Also, the checking of errno is
 not portable enough since Windows for example won't touch it for socket
 operations. What memory leak do we get if we just skip the changing of the
 socket_state for this situation? If we want to do it, I'd rather suggest
 that we change _libssh2_recv() and _libssh2_send() to become real
 functions (on all platforms) and we put that logic into those functions
 instead of distributing it to all places where those functions/macros are

 libssh2_publickey_list_free() MUST NOT be modified as it is part of the
 public API/ABI and we don't change that without careful planning and
 considerations. Why exactly do you feel a need to change that and if you
 do, how is that change related to the memory leaks this bug report is

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