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

Re: [libssh2] #182: Various memory leaks

From: libssh2 Trac <>
Date: Fri, 25 Jun 2010 13:48:14 -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 stuge):

 Thanks for doing this research. Personally I believe that the issues
 within libssh2 are too fundamental to be easily fixable with only a few
 added if statements.

 Please create a patch using git, against the latest version of the
 codebase. Grab the code
 git clone git://
 then make your changes, and create a commit
 git commit
 and finally turn your commit into a patch file
 git format-patch -1
 Attaching that patch to this ticket makes it a lot easier for others to
 test your changes.

 I see a couple of issues with the suggested changes. In particular, 0
 bytes transferred is often OK within libssh2, and assuming that all socket
 operations are restricted to always having the same errors may not be a
 good idea and finally it's not acceptable to require a second call to any
 function after a failure for internal state to get updated properly.

 I'm afraid that fixing this issue properly will need fairly invasive
 changes => it'll take time to get done.

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