OSDN Git Service

* huf.c (alloc_buf): call fatal_error() when memory allocation failed
[lha/lha.git] / src / huf.c
index 8004083..cc1bde4 100644 (file)
--- a/src/huf.c
+++ b/src/huf.c
@@ -262,7 +262,7 @@ alloc_buf( /* void */ )
        while ((buf = (unsigned char *) malloc(bufsiz)) == NULL) {
                bufsiz = (bufsiz / 10) * 9;
                if (bufsiz < 4 * 1024)
        while ((buf = (unsigned char *) malloc(bufsiz)) == NULL) {
                bufsiz = (bufsiz / 10) * 9;
                if (bufsiz < 4 * 1024)
-                       break;
+            fatal_error("Not enough memory");
        }
        return buf;
 }
        }
        return buf;
 }