From 282279c05f0ce892b1e65f7b6ae8046571d6eeb0 Mon Sep 17 00:00:00 2001 From: Tom Smeding Date: Sun, 12 Jul 2020 21:50:16 +0200 Subject: tomsg_clientlib: Ensure tomsg_connect sets client to NULL on error --- ssh/tomsg_clientlib.c | 3 +++ 1 file changed, 3 insertions(+) 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); -- cgit v1.2.3-54-g00ecf