aboutsummaryrefslogtreecommitdiff
path: root/sample.c
diff options
context:
space:
mode:
authorAris Adamantiadis <aris@0xbadc0de.be>2008-03-03 14:51:35 +0000
committerAris Adamantiadis <aris@0xbadc0de.be>2008-03-03 14:51:35 +0000
commit01470097c6ff22b3c1a8c4383ae08a2ad3ce0ff8 (patch)
treecb0a7cd01ed647ca4c2d19e534556d48bba8cd57 /sample.c
parentfeccd44ef59329f3bfb8963e473a14e43e1aa2ec (diff)
downloadlibssh-01470097c6ff22b3c1a8c4383ae08a2ad3ce0ff8.tar.gz
libssh-01470097c6ff22b3c1a8c4383ae08a2ad3ce0ff8.tar.xz
libssh-01470097c6ff22b3c1a8c4383ae08a2ad3ce0ff8.zip
fix bug #0000002 : in_socket_buffer and out_socket_buffer memleak +
"g" and "p" O(1) memleak. git-svn-id: svn+ssh://svn.berlios.de/svnroot/repos/libssh/trunk@134 7dcaeef0-15fb-0310-b436-a5af3365683c
Diffstat (limited to 'sample.c')
-rw-r--r--sample.c19
1 files changed, 9 insertions, 10 deletions
diff --git a/sample.c b/sample.c
index 37af237d..9fef51ed 100644
--- a/sample.c
+++ b/sample.c
@@ -391,7 +391,7 @@ int main(int argc, char **argv){
if(ssh_connect(session)){
fprintf(stderr,"Connection failed : %s\n",ssh_get_error(session));
ssh_disconnect(session);
- ssh_finalize();
+ ssh_finalize();
return 1;
}
state=ssh_is_server_known(session);
@@ -404,16 +404,16 @@ int main(int argc, char **argv){
ssh_print_hexa("Public key hash",hash,MD5_DIGEST_LEN);
fprintf(stderr,"For security reason, connection will be stopped\n");
ssh_disconnect(session);
- ssh_finalize();
+ ssh_finalize();
exit(-1);
case SSH_SERVER_FOUND_OTHER:
fprintf(stderr,"The host key for this server was not found but an other type of key exists.\n");
fprintf(stderr,"An attacker might change the default server key to confuse your client"
"into thinking the key does not exist\n"
"We advise you to rerun the client with -d or -r for more safety.\n");
- ssh_disconnect(session);
- ssh_finalize();
- exit(-1);
+ ssh_disconnect(session);
+ ssh_finalize();
+ exit(-1);
case SSH_SERVER_NOT_KNOWN:
fprintf(stderr,"The server is unknown. Do you trust the host key ?\n");
ssh_get_pubkey_hash(session,hash);
@@ -434,7 +434,7 @@ int main(int argc, char **argv){
case SSH_SERVER_ERROR:
fprintf(stderr,"%s",ssh_get_error(session));
ssh_disconnect(session);
- ssh_finalize();
+ ssh_finalize();
exit(-1);
}
@@ -442,7 +442,7 @@ int main(int argc, char **argv){
auth=ssh_userauth_autopubkey(session);
if(auth==SSH_AUTH_ERROR){
fprintf(stderr,"Authenticating with pubkey: %s\n",ssh_get_error(session));
- ssh_finalize();
+ ssh_finalize();
return -1;
}
banner=ssh_get_issue_banner(session);
@@ -455,7 +455,7 @@ int main(int argc, char **argv){
if(auth==SSH_AUTH_ERROR){
fprintf(stderr,"authenticating with keyb-interactive: %s\n",
ssh_get_error(session));
- ssh_finalize();
+ ssh_finalize();
return -1;
}
}
@@ -464,13 +464,12 @@ int main(int argc, char **argv){
if(ssh_userauth_password(session,NULL,password) != SSH_AUTH_SUCCESS){
fprintf(stderr,"Authentication failed: %s\n",ssh_get_error(session));
ssh_disconnect(session);
- ssh_finalize();
+ ssh_finalize();
return -1;
}
memset(password,0,strlen(password));
}
ssh_say(1,"Authentication success\n");
- printf("%s\n",argv[0]);
if(strstr(argv[0],"sftp")){
sftp=1;
ssh_say(1,"doing sftp instead\n");