diff options
author | Matt Kraai | 2000-09-13 02:46:14 +0000 |
---|---|---|
committer | Matt Kraai | 2000-09-13 02:46:14 +0000 |
commit | 322ae93a5e0b78b65831f9fd87fd456eb84d21a1 (patch) | |
tree | 5b967e1d873ff6eff8296bf9fda73825f0c55884 /console-tools | |
parent | b89075298edf0a471b9046b1f3c8a936e18ead20 (diff) | |
download | busybox-322ae93a5e0b78b65831f9fd87fd456eb84d21a1.zip busybox-322ae93a5e0b78b65831f9fd87fd456eb84d21a1.tar.gz |
Fix calls to {m,c,re}alloc so that they use x{m,c,re}alloc instead of
segfaulting or handling errors the same way themselves.
Diffstat (limited to 'console-tools')
-rw-r--r-- | console-tools/loadfont.c | 6 | ||||
-rw-r--r-- | console-tools/loadkmap.c | 6 |
2 files changed, 2 insertions, 10 deletions
diff --git a/console-tools/loadfont.c b/console-tools/loadfont.c index 927c2ba..e93ca31 100644 --- a/console-tools/loadfont.c +++ b/console-tools/loadfont.c @@ -102,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]; diff --git a/console-tools/loadkmap.c b/console-tools/loadkmap.c index 488585f..2321a1e 100644 --- a/console-tools/loadkmap.c +++ b/console-tools/loadkmap.c @@ -67,11 +67,7 @@ int loadkmap_main(int argc, char **argv) exit(FALSE); } - ibuff = (u_short *) malloc(ibuffsz); - if (!ibuff) { - errorMsg("Out of memory.\n"); - exit(FALSE); - } + ibuff = (u_short *) xmalloc(ibuffsz); for (i = 0; i < MAX_NR_KEYMAPS; i++) { if (flags[i] == 1) { |