]> asedeno.scripts.mit.edu Git - PuTTY.git/blobdiff - ssh.c
Change the naming policy for connection-sharing Unix sockets.
[PuTTY.git] / ssh.c
diff --git a/ssh.c b/ssh.c
index 57ee2e8acd6d387d9070194e597ad67224233bfe..d395d7b5c556e72347a814cd2c8509eed27c1aa1 100644 (file)
--- a/ssh.c
+++ b/ssh.c
@@ -10625,11 +10625,13 @@ static const char *ssh_init(void *frontend_handle, void **backend_handle,
     ssh->gsslibs = NULL;
 #endif
 
+    random_ref(); /* do this now - may be needed by sharing setup code */
+
     p = connect_to_host(ssh, host, port, realhost, nodelay, keepalive);
-    if (p != NULL)
+    if (p != NULL) {
+        random_unref();
        return p;
-
-    random_ref();
+    }
 
     return NULL;
 }