diff options
author | hubertf <hubertf@pkgsrc.org> | 2002-04-05 01:33:24 +0000 |
---|---|---|
committer | hubertf <hubertf@pkgsrc.org> | 2002-04-05 01:33:24 +0000 |
commit | dcdeb66984ee6350f0ce6e5344e11433d07b1495 (patch) | |
tree | c4a1ed0c73e8b0eb45912129e448ff1d96b8ab31 /sysutils/xdu/patches | |
parent | 63cb10f32213c239c9ab34c5184696a9772f092b (diff) | |
download | pkgsrc-dcdeb66984ee6350f0ce6e5344e11433d07b1495.tar.gz |
Find another place where we can run out of memory, and print
some proper error message (instead of dumping core later)
Diffstat (limited to 'sysutils/xdu/patches')
-rw-r--r-- | sysutils/xdu/patches/patch-aa | 20 |
1 files changed, 17 insertions, 3 deletions
diff --git a/sysutils/xdu/patches/patch-aa b/sysutils/xdu/patches/patch-aa index a9d59f4e5e5..a9bfa9b71c4 100644 --- a/sysutils/xdu/patches/patch-aa +++ b/sysutils/xdu/patches/patch-aa @@ -1,4 +1,4 @@ -$NetBSD: patch-aa,v 1.2 2001/08/25 16:34:27 hubertf Exp $ +$NetBSD: patch-aa,v 1.3 2002/04/05 01:33:25 hubertf Exp $ --- xdu.c.orig Sun Jun 5 21:29:23 1994 +++ xdu.c @@ -55,7 +55,21 @@ $NetBSD: patch-aa,v 1.2 2001/08/25 16:34:27 hubertf Exp $ } fclose(fp); } -@@ -622,6 +630,7 @@ +@@ -290,7 +298,12 @@ + name++; + } + buf[indx] = 0; +- path[arg++] = strdup(buf); ++ path[arg] = strdup(buf); ++ if (path[arg] == NULL) { ++ fprintf(stderr, "Out of memory! (#3)\n"); ++ exit(1); ++ } ++ arg++; + path[arg] = NULL; + + addtree(&top,path,size); +@@ -622,6 +635,7 @@ 100.0*topp->size/rootp->size); } @@ -63,7 +77,7 @@ $NetBSD: patch-aa,v 1.2 2001/08/25 16:34:27 hubertf Exp $ char * strdup(s) char *s; -@@ -631,10 +640,15 @@ +@@ -631,10 +645,15 @@ n = strlen(s); cp = malloc(n+1); |