Subject: Re: [PATCH] add function libssh2_session_set_last_error

Re: [PATCH] add function libssh2_session_set_last_error

From: Peter Stuge <>
Date: Fri, 23 Oct 2015 13:43:13 +0200


Salvador Fandino wrote:
> I converted it into "_libssh2_error_flags" which accepts a flag
> indicating whether the given string must be duplicated

Please think about how and where allocated memory is being freed.

Try creating and destroying sessions in a loop - there is a leak.

Do you need to free this memory in other places besides that?


Style: the function takes several parameters whose names start with err.
You add a new parameter named flags, which does not start with err.
Please be careful to always follow style wherever you make changes.
Name the new parameter e.g. errflags.

Received on 2015-10-23