X-Git-Url: http://git.demorecorder.com/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Fxcb_auth.c;h=4839b78d60d6e3b502ac6f3b5fe6d6ebee885012;hb=5755582444ad0ba79e661ab3173cc38e9e588d83;hp=1af27fc5d061641213aea6d31002fe08ca549123;hpb=1c4717de367fe3bf1cf56bd8ef2bd30586bed023;p=free-sw%2Fxcb%2Flibxcb diff --git a/src/xcb_auth.c b/src/xcb_auth.c index 1af27fc..4839b78 100644 --- a/src/xcb_auth.c +++ b/src/xcb_auth.c @@ -327,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);