Jacob's patch to make passphrase boxes work more sanely
[u/mdw/putty] / x11fwd.c
index 8ace77d..2b4a6bc 100644 (file)
--- a/x11fwd.c
+++ b/x11fwd.c
@@ -189,7 +189,10 @@ char *x11_init (Socket *s, char *display, void *c) {
 }
 
 void x11_close (Socket s) {
-    struct X11Private *pr = (struct X11Private *)sk_get_private_ptr(s);
+    struct X11Private *pr;\r
+       if (!s)\r
+               return;\r
+       pr = (struct X11Private *)sk_get_private_ptr(s);
 
     if (pr->auth_protocol) {
         sfree(pr->auth_protocol);