summaryrefslogtreecommitdiffstats
path: root/sample.c
diff options
context:
space:
mode:
Diffstat (limited to 'sample.c')
-rw-r--r--sample.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/sample.c b/sample.c
index 20b19c7..543bcfc 100644
--- a/sample.c
+++ b/sample.c
@@ -422,7 +422,10 @@ int main(int argc, char **argv){
signal(SIGTERM, do_exit);
if(user)
ssh_options_set_username(options,user);
- ssh_options_set_host(options,host);
+ if (ssh_options_set_host(options,host) < 0) {
+ ssh_options_free(options);
+ return 1;
+ }
session=ssh_new();
ssh_set_options(session,options);
if(ssh_connect(session)){