From e3a77b22d272d31cedbd9eab9b37feda0e13f8d6 Mon Sep 17 00:00:00 2001 From: Jason Rumney Date: Mon, 4 Feb 2008 15:42:57 +0000 Subject: [PATCH] (w32font_open_internal): Use xmalloc, xrealloc, xfree. --- src/ChangeLog | 1 + src/w32font.c | 6 +++--- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/ChangeLog b/src/ChangeLog index 2747f40fe40..ef06b02aa2e 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -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 diff --git a/src/w32font.c b/src/w32font.c index e2973db0eb6..b0e6b250a90 100644 --- a/src/w32font.c +++ b/src/w32font.c @@ -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) -- 2.39.5