Skip to content

ssh: free the session on init failures#3179

Closed
danielgustafsson wants to merge 1 commit intocurl:masterfrom
danielgustafsson:dg-ssh_session_free
Closed

ssh: free the session on init failures#3179
danielgustafsson wants to merge 1 commit intocurl:masterfrom
danielgustafsson:dg-ssh_session_free

Conversation

@danielgustafsson
Copy link
Copy Markdown
Member

Ensure to clear the session object in case the libssh2 initialization fails.

It could be argued that the libssh2 error function should be called to get a proper error message in this case. But since the only error path in libssh2_knownhost_init() is memory a allocation failure it's safest
to avoid since the libssh2 error handling allocates memory.

Ensure to clear the session object in case the libssh2 initialization
fails.

It could be argued that the libssh2 error function should be called to
get a proper error message in this case. But since the only error path
in libssh2_knownhost_init() is memory a allocation failure it's safest
to avoid since the libssh2 error handling allocates memory.
@lock lock bot locked as resolved and limited conversation to collaborators Jan 24, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants