Fix calls to {m,c,re}alloc so that they use x{m,c,re}alloc instead of
[oweals/busybox.git] / loadfont.c
index 622142925a53ace8a342fdfaf2335841737a2b37..e93ca31868429d8795ca6691ff04a371ae98a6ff 100644 (file)
@@ -15,7 +15,6 @@
 #include <stdlib.h>
 #include <unistd.h>
 #include <sys/types.h>
-#include <sys/stat.h>
 #include <dirent.h>
 #include <errno.h>
 #include <sys/ioctl.h>
@@ -103,12 +102,8 @@ do_loadtable(int fd, unsigned char *inbuf, int tailsz, int fontsize)
        u_short unicode;
 
        maxct = tailsz;                         /* more than enough */
-       up = (struct unipair *) malloc(maxct * sizeof(struct unipair));
+       up = (struct unipair *) xmalloc(maxct * sizeof(struct unipair));
 
-       if (!up) {
-               errorMsg("Out of memory?\n");
-               exit(1);
-       }
        for (glyph = 0; glyph < fontsize; glyph++) {
                while (tailsz >= 2) {
                        unicode = (((u_short) inbuf[1]) << 8) + inbuf[0];