diff options
author | Tom Smeding <tom.smeding@gmail.com> | 2020-07-12 21:50:16 +0200 |
---|---|---|
committer | Tom Smeding <tom.smeding@gmail.com> | 2020-07-12 21:50:16 +0200 |
commit | 282279c05f0ce892b1e65f7b6ae8046571d6eeb0 (patch) | |
tree | c48bbd4771ac78108ba8620ef4af786b32e7d1b9 | |
parent | 5e27a5874aa1437a1a9b9974d26750d5520017e2 (diff) |
tomsg_clientlib: Ensure tomsg_connect sets client to NULL on error
-rw-r--r-- | ssh/tomsg_clientlib.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/ssh/tomsg_clientlib.c b/ssh/tomsg_clientlib.c index daa2cf5..9898b66 100644 --- a/ssh/tomsg_clientlib.c +++ b/ssh/tomsg_clientlib.c @@ -191,6 +191,9 @@ static enum tomsg_retval version_negotiation(struct tomsg_client *client) { enum tomsg_retval tomsg_connect( const char *hostname, int port, struct tomsg_client **clientp) { + // In case we throw an error along the way + *clientp = NULL; + struct sshnc_client *conn; enum sshnc_retval ret = sshnc_connect( hostname, port, "tomsg", "tomsg", hostkey_checker, NULL, &conn); |