charset.c (load_charset_map): Don't deref NULL on failed malloc.
authorJim Meyering <meyering@redhat.com>
Mon, 31 Jan 2011 07:34:45 +0000 (08:34 +0100)
committerJim Meyering <meyering@redhat.com>
Mon, 31 Jan 2011 07:34:45 +0000 (08:34 +0100)
src/ChangeLog
src/charset.c

index 393223c..63ea7c2 100644 (file)
@@ -1,3 +1,8 @@
+2011-01-31  Jim Meyering  <meyering@redhat.com>
+
+       * charset.c (load_charset_map): Don't deref NULL on failed malloc.
+       Use xmalloc rather than malloc.
+
 2011-01-30  Paul Eggert  <eggert@cs.ucla.edu>
 
        strftime: import from gnulib
index 57e24ae..a604660 100644 (file)
@@ -292,7 +292,7 @@ load_charset_map (struct charset *charset, struct charset_map_entries *entries,
       else
        {
          if (! temp_charset_work)
-           temp_charset_work = malloc (sizeof (*temp_charset_work));
+           temp_charset_work = xmalloc (sizeof (*temp_charset_work));
          if (control_flag == 1)
            {
              memset (temp_charset_work->table.decoder, -1,