mirror of
https://github.com/X11Libre/xserver.git
synced 2026-04-14 17:18:09 +00:00
[PR #2195] os: handle memory allocation failure in set_font_authorizations()
PR: https://github.com/X11Libre/xserver/pull/2195
This commit is contained in:
committed by
Enrico Weigelt, metux IT consult
parent
fda09b5233
commit
e6509060df
@@ -832,8 +832,14 @@ set_font_authorizations(char **authorizations, int *authlen, void *client)
|
||||
|
||||
len = strlen(hnameptr) + 1;
|
||||
result = calloc(1, len + sizeof(AUTHORIZATION_NAME) + 4);
|
||||
if (!result)
|
||||
if (result == NULL) {
|
||||
#if defined(HAVE_GETADDRINFO)
|
||||
if (ai) {
|
||||
freeaddrinfo(ai);
|
||||
}
|
||||
#endif
|
||||
return 0;
|
||||
}
|
||||
|
||||
p = result;
|
||||
*p++ = sizeof(AUTHORIZATION_NAME) >> 8;
|
||||
|
||||
Reference in New Issue
Block a user