diff options
author | marha <marha@users.sourceforge.net> | 2015-05-26 19:43:34 +0200 |
---|---|---|
committer | marha <marha@users.sourceforge.net> | 2015-05-26 19:43:34 +0200 |
commit | 912e881bec8b16f2331225960645c3bdf5a8ba2d (patch) | |
tree | 92afd568d4b3eaab1faf26d8d95d8c6df0173079 /xorg-server/dix/dixfonts.c | |
parent | 2e00f3764228cfc91180bbe9375a8d85e0e65a5b (diff) | |
parent | 843964ee791452b197e41dacb0146f5b456ffaa5 (diff) | |
download | vcxsrv-912e881bec8b16f2331225960645c3bdf5a8ba2d.tar.gz vcxsrv-912e881bec8b16f2331225960645c3bdf5a8ba2d.tar.bz2 vcxsrv-912e881bec8b16f2331225960645c3bdf5a8ba2d.zip |
Merge remote-tracking branch 'origin/released'
Conflicts:
mesalib/src/mapi/glapi/glapi_priv.h
mesalib/src/mesa/drivers/dri/swrast/swrast.c
xorg-server/dix/dispatch.c
xorg-server/os/utils.c
xorg-server/record/record.c
Diffstat (limited to 'xorg-server/dix/dixfonts.c')
-rw-r--r-- | xorg-server/dix/dixfonts.c | 18 |
1 files changed, 8 insertions, 10 deletions
diff --git a/xorg-server/dix/dixfonts.c b/xorg-server/dix/dixfonts.c index 6213d2dfa..12aef65a0 100644 --- a/xorg-server/dix/dixfonts.c +++ b/xorg-server/dix/dixfonts.c @@ -170,9 +170,8 @@ QueueFontWakeup(FontPathElementPtr fpe) } } if (num_slept_fpes == size_slept_fpes) { - new = (FontPathElementPtr *) - realloc(slept_fpes, - sizeof(FontPathElementPtr) * (size_slept_fpes + 4)); + new = reallocarray(slept_fpes, size_slept_fpes + 4, + sizeof(FontPathElementPtr)); if (!new) return; slept_fpes = new; @@ -432,7 +431,7 @@ OpenFont(ClientPtr client, XID fid, Mask flags, unsigned lenfname, * copy the current FPE list, so that if it gets changed by another client * while we're blocking, the request still appears atomic */ - c->fpe_list = malloc(sizeof(FontPathElementPtr) * num_fpes); + c->fpe_list = xallocarray(num_fpes, sizeof(FontPathElementPtr)); if (!c->fpe_list) { free((void *) c->fontname); free(c); @@ -836,7 +835,7 @@ ListFonts(ClientPtr client, unsigned char *pattern, unsigned length, if (!(c = malloc(sizeof *c))) return BadAlloc; - c->fpe_list = malloc(sizeof(FontPathElementPtr) * num_fpes); + c->fpe_list = xallocarray(num_fpes, sizeof(FontPathElementPtr)); if (!c->fpe_list) { free(c); return BadAlloc; @@ -1094,7 +1093,7 @@ StartListFontsWithInfo(ClientPtr client, int length, unsigned char *pattern, if (!(c = malloc(sizeof *c))) goto badAlloc; - c->fpe_list = malloc(sizeof(FontPathElementPtr) * num_fpes); + c->fpe_list = xallocarray(num_fpes, sizeof(FontPathElementPtr)); if (!c->fpe_list) { free(c); goto badAlloc; @@ -1475,7 +1474,7 @@ doImageText(ClientPtr client, ITclosurePtr c) *new_closure = *c; c = new_closure; - data = malloc(c->nChars * itemSize); + data = xallocarray(c->nChars, itemSize); if (!data) { free(c); c = old_closure; @@ -1634,7 +1633,7 @@ SetFontPathElements(int npaths, unsigned char *paths, int *bad, Bool persist) unsigned char *cp = paths; FontPathElementPtr fpe = NULL, *fplist; - fplist = malloc(sizeof(FontPathElementPtr) * npaths); + fplist = xallocarray(npaths, sizeof(FontPathElementPtr)); if (!fplist) { *bad = 0; return BadAlloc; @@ -1931,8 +1930,7 @@ RegisterFPEFunctions(NameCheckFunc name_func, FPEFunctions *new; /* grow the list */ - new = (FPEFunctions *) realloc(fpe_functions, - (num_fpe_types + 1) * sizeof(FPEFunctions)); + new = reallocarray(fpe_functions, num_fpe_types + 1, sizeof(FPEFunctions)); if (!new) return -1; fpe_functions = new; |