(w32font_open_internal): Use xmalloc, xrealloc, xfree.

This commit is contained in:
Jason Rumney 2008-02-04 15:42:57 +00:00
parent 880a595421
commit e3a77b22d2
2 changed files with 4 additions and 3 deletions

View file

@ -21,6 +21,7 @@
* w32font.c (w32font_open_internal): Use font_unparse_fcname to
set full_name.
(w32font_open_internal): Use xmalloc, xrealloc, xfree.
2008-02-03 Jason Rumney <jasonr@gnu.org>

View file

@ -689,13 +689,13 @@ w32font_open_internal (f, font_entity, pixel_size, w32_font)
/* We don't know how much space we need for the full name, so start with
96 bytes and go up in steps of 32. */
len = 96;
name = malloc (len);
name = xmalloc (len);
while (name && font_unparse_fcname (font_entity, pixel_size, name, len) < 0)
{
char *new = realloc (name, len += 32);
char *new = xrealloc (name, len += 32);
if (! new)
free (name);
xfree (name);
name = new;
}
if (name)