1
0
mirror of https://git.libssh.org/projects/libssh.git synced 2025-06-03 14:42:01 +03:00

examples: Fix a use after free in scp example.

This commit is contained in:
Andreas Schneider 2013-06-13 10:55:12 +02:00
parent abd6b8004e
commit a03d8f49fb

View File

@ -286,7 +286,7 @@ int main(int argc, char **argv){
break;
}
}
if(dest->is_ssh){
if (dest->is_ssh && dest->scp != NULL) {
r=ssh_scp_close(dest->scp);
if(r == SSH_ERROR){
fprintf(stderr,"Error closing scp: %s\n",ssh_get_error(dest->session));