diff options
author | Andreas Schneider <asn@cryptomilk.org> | 2011-04-14 14:16:58 +0200 |
---|---|---|
committer | Andreas Schneider <asn@cryptomilk.org> | 2011-04-14 14:19:08 +0200 |
commit | 1b44daddf6a7365e6c9a14b215032dc561a9f6bd (patch) | |
tree | c55bd7c6b4545a4bdfb50f9f3b5e54b1cd97e7d3 /examples/exec.c | |
parent | a309c1b38e593dc28d09723251e9103c34157628 (diff) | |
download | libssh-1b44daddf6a7365e6c9a14b215032dc561a9f6bd.tar.gz libssh-1b44daddf6a7365e6c9a14b215032dc561a9f6bd.tar.xz libssh-1b44daddf6a7365e6c9a14b215032dc561a9f6bd.zip |
examples: Call correct functions on exit.
(cherry picked from commit 3e7d4534cec141141e2b2cc5beedcc171cd99360)
Diffstat (limited to 'examples/exec.c')
-rw-r--r-- | examples/exec.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/examples/exec.c b/examples/exec.c index 03d5d4b3..bbfdf0e4 100644 --- a/examples/exec.c +++ b/examples/exec.c @@ -13,6 +13,7 @@ int main(void) { session = connect_ssh("localhost", NULL, 0); if (session == NULL) { + ssh_finalize(); return 1; } @@ -20,6 +21,7 @@ int main(void) { if (channel == NULL) { ssh_disconnect(session); ssh_free(session); + ssh_finalize(); return 1; } @@ -49,6 +51,7 @@ int main(void) { ssh_channel_close(channel); ssh_channel_free(channel); ssh_free(session); + ssh_finalize(); return 0; failed: @@ -56,6 +59,7 @@ failed: ssh_channel_free(channel); ssh_disconnect(session); ssh_free(session); + ssh_finalize(); return 1; } |