1
0
mirror of https://git.libssh.org/projects/libssh.git synced 2025-06-13 20:41:30 +03:00

examples: Fix some memory leaks.

This commit is contained in:
Andreas Schneider
2011-04-15 19:05:53 +02:00
parent ef658b4bef
commit 644145a88c
3 changed files with 16 additions and 2 deletions

View File

@ -16,7 +16,7 @@ program.
#include <libssh/libsshpp.hpp>
int main(int argc, const char **argv){
ssh::Session session,s2;
ssh::Session session;
try {
if(argc>1)
session.setOption(SSH_OPTIONS_HOST,argv[1]);
@ -24,10 +24,10 @@ int main(int argc, const char **argv){
session.setOption(SSH_OPTIONS_HOST,"localhost");
session.connect();
session.userauthAutopubkey();
session.disconnect();
} catch (ssh::SshException e){
std::cout << "Error during connection : ";
std::cout << e.getError() << std::endl;
}
//s2=session;
return 0;
}