diff --git a/examples/libssh_scp.c b/examples/libssh_scp.c index 7a30b37f..906a9206 100644 --- a/examples/libssh_scp.c +++ b/examples/libssh_scp.c @@ -404,10 +404,11 @@ int main(int argc, char **argv) { int i; int r; if (opts(argc, argv) < 0) { - r = EXIT_FAILURE; - goto end; + return EXIT_FAILURE; } + ssh_init(); + dest = parse_location(destination); if (dest == NULL) { r = EXIT_FAILURE; @@ -449,5 +450,6 @@ close_dest: close_location(dest); location_free(dest); end: + ssh_finalize(); return r; }