Subject: Re: Patch to ticket 228

Re: Patch to ticket 228

From: Peter Stuge <>
Date: Thu, 29 Sep 2011 02:25:26 +0200

Jernej Kovacic wrote:
> On success, the function returns the number of algorithms for the
> given method_type (a positive number), allocates the array and
> appropriately fills it (it will not be NULL terminated). On failure
> (e.g. unsuccessful allocation, etc.) it returns an error code (a
> negative number). Internally, LIBSSH2_ALLOC will be used to allocate
> the appropriate amount of memory.
> If the function fails it will free the allocated memory (if necessary) itself.
> If the function succeeds and returns a valid list, the user must free
> it when he doesn't need it anymore. This is done by calling
> libssh2_free (which actually calls LIBSSH2_FREE).

Also describe and make sure to document the case when the function
returns 0, even if it is just theoretical it is critical to not leave
any case unclear.

Received on 2011-09-29