X-Git-Url: http://git.demorecorder.com/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Fxcb_auth.c;h=4839b78d60d6e3b502ac6f3b5fe6d6ebee885012;hb=5755582444ad0ba79e661ab3173cc38e9e588d83;hp=d774d106942bf46e157e91e73f995c4f9e274a63;hpb=a546d00091de0ab16374dec55e8e2fa87d6bbebf;p=free-sw%2Fxcb%2Flibxcb diff --git a/src/xcb_auth.c b/src/xcb_auth.c index d774d10..4839b78 100644 --- a/src/xcb_auth.c +++ b/src/xcb_auth.c @@ -27,13 +27,18 @@ #include #include -#include -#include -#include #include #include #include +#ifdef _WIN32 +#include "xcb_windefs.h" +#else +#include +#include +#include +#endif /* _WIN32 */ + #include "xcb.h" #include "xcbint.h" @@ -322,10 +327,15 @@ int _xcb_get_auth_info(int fd, xcb_auth_info_t *info, int display) if (!info->namelen) goto no_auth; /* out of memory */ - if (!gotsockname && (sockname = get_peer_sock_name(getsockname, fd)) == NULL) + if (!gotsockname) { - free(info->name); - goto no_auth; /* can only authenticate sockets */ + free(sockname); + + if ((sockname = get_peer_sock_name(getsockname, fd)) == NULL) + { + free(info->name); + goto no_auth; /* can only authenticate sockets */ + } } ret = compute_auth(info, authptr, sockname);