diff options
author | Andreas Schneider <asn@cryptomilk.org> | 2013-06-19 12:16:57 +0200 |
---|---|---|
committer | Andreas Schneider <asn@cryptomilk.org> | 2013-06-19 12:16:57 +0200 |
commit | de4cb811a0fd9ee7e0e56161fdecfe2ba5ce415f (patch) | |
tree | 0ccc9eaf2454373764ea2bba9055daa21ffe1403 /examples | |
parent | abb25861e5e95cfc036b49970bdf8aaa8b43a36c (diff) | |
download | libssh-de4cb811a0fd9ee7e0e56161fdecfe2ba5ce415f.tar.gz libssh-de4cb811a0fd9ee7e0e56161fdecfe2ba5ce415f.tar.xz libssh-de4cb811a0fd9ee7e0e56161fdecfe2ba5ce415f.zip |
examples: Fix a possible memory leak.
Diffstat (limited to 'examples')
-rw-r--r-- | examples/samplesshd-tty.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/examples/samplesshd-tty.c b/examples/samplesshd-tty.c index 373ec07..a0e79e4 100644 --- a/examples/samplesshd-tty.c +++ b/examples/samplesshd-tty.c @@ -307,10 +307,13 @@ static int main_loop(ssh_channel chan) { } if(ssh_event_add_fd(event, fd, events, copy_fd_to_chan, chan) != SSH_OK) { printf("Couldn't add an fd to the event\n"); + ssh_event_free(event); return -1; } if(ssh_event_add_session(event, session) != SSH_OK) { printf("Couldn't add the session to the event\n"); + ssh_event_remove_fd(event, fd); + ssh_event_free(event); return -1; } |