From e6a8154811ab88f040bf77410f02cde203f3a41c Mon Sep 17 00:00:00 2001
From: mbm <mbm@3c298f89-4303-0410-b956-a3cf2f4a3e73>
Date: Sat, 26 Feb 2005 02:32:16 +0000
Subject: bugfix

git-svn-id: svn://svn.openwrt.org/openwrt/trunk@294 3c298f89-4303-0410-b956-a3cf2f4a3e73
---
 openwrt/package/openwrt/jffs2root.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

(limited to 'openwrt/package')

diff --git a/openwrt/package/openwrt/jffs2root.c b/openwrt/package/openwrt/jffs2root.c
index e74c89a9b..2ff37fdad 100644
--- a/openwrt/package/openwrt/jffs2root.c
+++ b/openwrt/package/openwrt/jffs2root.c
@@ -48,7 +48,10 @@ void init_crc32()
     unsigned long crc;
     unsigned long poly = 0xEDB88320L;
     int n, bit;
-    crc32 = (unsigned long *) malloc(256 * sizeof(unsigned long));
+    if ((crc32 = (unsigned long *) malloc(256 * sizeof(unsigned long))) == (void *)-1) {
+	    perror("malloc");
+	    exit(1);
+    }
     for (n = 0; n < 256; n++) {
 	crc = (unsigned long) n;
 	for (bit = 0; bit < 8; bit++)
-- 
cgit v1.2.3