X-Git-Url: https://asedeno.scripts.mit.edu/gitweb/?a=blobdiff_plain;f=x11fwd.c;h=895d8a99d50028c2e028a97390b70cf26580c8ef;hb=0cc6fb8bfea07360afeac83ba67aceffb56499c8;hp=1e04f542b83dd867761fd260fbd4b2fd851c0068;hpb=aa5bae89163f96453ee84541c1e96c650b3bc8f8;p=PuTTY.git diff --git a/x11fwd.c b/x11fwd.c index 1e04f542..895d8a99 100644 --- a/x11fwd.c +++ b/x11fwd.c @@ -171,6 +171,7 @@ struct X11Display *x11_setup_display(char *display, int authtype, Conf *conf) sk_addr_free(disp->addr); sfree(disp->hostname); sfree(disp->unixsocketpath); + sfree(disp); return NULL; /* FIXME: report an error */ } } @@ -343,7 +344,7 @@ void x11_get_auth_from_authfile(struct X11Display *disp, int len[4]; int family, protocol; int ideal_match = FALSE; - char *ourhostname = get_hostname(); + char *ourhostname; /* * Normally we should look for precisely the details specified in @@ -372,6 +373,8 @@ void x11_get_auth_from_authfile(struct X11Display *disp, if (!authfp) return; + ourhostname = get_hostname(); + /* Records in .Xauthority contain four strings of up to 64K each */ buf = snewn(65537 * 4, char);