diff options
Diffstat (limited to 'xorg-server/dix/dixfonts.c')
-rwxr-xr-x | xorg-server/dix/dixfonts.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/xorg-server/dix/dixfonts.c b/xorg-server/dix/dixfonts.c index 6260f48b9..49758d5b5 100755 --- a/xorg-server/dix/dixfonts.c +++ b/xorg-server/dix/dixfonts.c @@ -1829,11 +1829,14 @@ GetFontPath(ClientPtr client, int *count, int *length, unsigned char **result) fpe = font_path_elements[i]; len += fpe->name_length + 1; } - font_path_string = (unsigned char *) realloc(font_path_string, len); - if (!font_path_string) + c = realloc(font_path_string, len); + if (c == NULL) { + free(font_path_string); + font_path_string = NULL; return BadAlloc; + } - c = font_path_string; + font_path_string = c; *length = 0; for (i = 0; i < num_fpes; i++) { fpe = font_path_elements[i]; |