mirror of
https://git.libssh.org/projects/libssh.git
synced 2025-07-29 13:01:13 +03:00
examples/libssh_scp: call ssh_init and ssh_finalize explicitly
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com> Reviewed-by: Jakub Jelen <jjelen@redhat.com> Change-Id: I4c80904d40b068f47334c3116576de07782162f6
This commit is contained in:
@ -404,10 +404,11 @@ int main(int argc, char **argv) {
|
|||||||
int i;
|
int i;
|
||||||
int r;
|
int r;
|
||||||
if (opts(argc, argv) < 0) {
|
if (opts(argc, argv) < 0) {
|
||||||
r = EXIT_FAILURE;
|
return EXIT_FAILURE;
|
||||||
goto end;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ssh_init();
|
||||||
|
|
||||||
dest = parse_location(destination);
|
dest = parse_location(destination);
|
||||||
if (dest == NULL) {
|
if (dest == NULL) {
|
||||||
r = EXIT_FAILURE;
|
r = EXIT_FAILURE;
|
||||||
@ -449,5 +450,6 @@ close_dest:
|
|||||||
close_location(dest);
|
close_location(dest);
|
||||||
location_free(dest);
|
location_free(dest);
|
||||||
end:
|
end:
|
||||||
|
ssh_finalize();
|
||||||
return r;
|
return r;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user