changeset 100103:c2ef1c8b2d64

(register_font_driver): Use xmalloc. (font_put_frame_data): Likewise.
author Andreas Schwab <schwab@suse.de>
date Mon, 01 Dec 2008 20:14:43 +0000
parents 25295c680f6b
children 6ab80abea3ee
files src/ChangeLog src/font.c
diffstat 2 files changed, 7 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/src/ChangeLog	Mon Dec 01 18:08:59 2008 +0000
+++ b/src/ChangeLog	Mon Dec 01 20:14:43 2008 +0000
@@ -1,3 +1,8 @@
+2008-12-01  Andreas Schwab  <schwab@suse.de>
+
+	* font.c (register_font_driver): Use xmalloc.
+	(font_put_frame_data): Likewise.
+
 2008-12-01  Chong Yidong  <cyd@stupidchicken.com>
 
 	* xfaces.c (realize_x_face): Make abort condition clearer.
--- a/src/font.c	Mon Dec 01 18:08:59 2008 +0000
+++ b/src/font.c	Mon Dec 01 20:14:43 2008 +0000
@@ -3451,7 +3451,7 @@
     if (EQ (list->driver->type, driver->type))
       error ("Duplicated font driver: %s", SDATA (SYMBOL_NAME (driver->type)));
 
-  list = malloc (sizeof (struct font_driver_list));
+  list = xmalloc (sizeof (struct font_driver_list));
   list->on = 0;
   list->driver = driver;
   list->next = NULL;
@@ -3577,9 +3577,7 @@
 
   if (! list)
     {
-      list = malloc (sizeof (struct font_data_list));
-      if (! list)
-	return -1;
+      list = xmalloc (sizeof (struct font_data_list));
       list->driver = driver;
       list->next = f->font_data_list;
       f->font_data_list = list;