diff --git a/src/vfs/sftpfs/connection.c b/src/vfs/sftpfs/connection.c
index 83e33d0..69c854d 100644
a
|
b
|
sftpfs_open_connection (struct vfs_s_super *super, GError ** error) |
376 | 376 | */ |
377 | 377 | super_data->socket_handle = sftpfs_open_socket (super, error); |
378 | 378 | if (super_data->socket_handle == -1) |
379 | | goto deinit_by_error; |
| 379 | return -1; |
380 | 380 | |
381 | 381 | /* ... start it up. This will trade welcome banners, exchange keys, |
382 | 382 | * and setup crypto, compression, and MAC layers |
… |
… |
sftpfs_open_connection (struct vfs_s_super *super, GError ** error) |
385 | 385 | if (rc != 0) |
386 | 386 | { |
387 | 387 | g_set_error (error, MC_ERROR, -1, _("sftp: Failure establishing SSH session: (%d)"), rc); |
388 | | goto deinit_by_error; |
| 388 | return -1; |
389 | 389 | } |
390 | 390 | |
391 | 391 | /* At this point we havn't yet authenticated. The first thing to do |
… |
… |
sftpfs_open_connection (struct vfs_s_super *super, GError ** error) |
400 | 400 | if (!sftpfs_open_connection_ssh_agent (super, error) |
401 | 401 | && !sftpfs_open_connection_ssh_key (super, error) |
402 | 402 | && !sftpfs_open_connection_ssh_password (super, error)) |
403 | | goto deinit_by_error; |
| 403 | return -1; |
404 | 404 | |
405 | 405 | super_data->sftp_session = libssh2_sftp_init (super_data->session); |
406 | 406 | |
407 | 407 | if (super_data->sftp_session == NULL) |
408 | | goto deinit_by_error; |
| 408 | return -1; |
409 | 409 | |
410 | 410 | /* Since we have not set non-blocking, tell libssh2 we are blocking */ |
411 | 411 | libssh2_session_set_blocking (super_data->session, 1); |
412 | 412 | |
413 | 413 | return 0; |
414 | | |
415 | | deinit_by_error: |
416 | | sftpfs_close_connection (super, "Shutdown with errors", NULL); |
417 | | return -1; |
418 | 414 | } |
419 | 415 | |
420 | 416 | /* --------------------------------------------------------------------------------------------- */ |
… |
… |
sftpfs_close_connection (struct vfs_s_super *super, const char *shutdown_message |
438 | 434 | return; |
439 | 435 | |
440 | 436 | vfs_path_element_free (super_data->original_connection_info); |
| 437 | super_data->original_connection_info = NULL; |
| 438 | |
441 | 439 | if (super_data->agent != NULL) |
442 | 440 | { |
443 | 441 | libssh2_agent_disconnect (super_data->agent); |
… |
… |
sftpfs_close_connection (struct vfs_s_super *super, const char *shutdown_message |
456 | 454 | libssh2_session_disconnect (super_data->session, shutdown_message); |
457 | 455 | super_data->session = NULL; |
458 | 456 | } |
459 | | if (super_data->fingerprint != NULL) |
460 | | super_data->fingerprint = NULL; |
| 457 | |
| 458 | super_data->fingerprint = NULL; |
461 | 459 | |
462 | 460 | if (super_data->socket_handle != -1) |
463 | 461 | { |