Subject: Re: [PATCH] add function libssh2_session_set_last_error

Re: [PATCH] add function libssh2_session_set_last_error

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

Salvador,

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?

Is there a LIBSSH2_REALLOC?

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.

//Peter
_______________________________________________
libssh2-devel http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel
Received on 2015-10-23