summaryrefslogtreecommitdiff
path: root/usr.bin
diff options
context:
space:
mode:
authorTed Unangst <tedu@cvs.openbsd.org>2003-10-13 00:44:26 +0000
committerTed Unangst <tedu@cvs.openbsd.org>2003-10-13 00:44:26 +0000
commitfd544af7542538bad774ccb341b7660cbe7ad00e (patch)
tree9f30e14e5ba1b89129562f9e0796147cfbb1f507 /usr.bin
parente98583d0473c7dde6afbd97bc6e997147e485bba (diff)
realloc stuff. ok deraadt@ jose@
Diffstat (limited to 'usr.bin')
-rw-r--r--usr.bin/kdump/kdump.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/usr.bin/kdump/kdump.c b/usr.bin/kdump/kdump.c
index 3b21ce285f0..a519a644a84 100644
--- a/usr.bin/kdump/kdump.c
+++ b/usr.bin/kdump/kdump.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: kdump.c,v 1.22 2003/07/02 20:54:17 deraadt Exp $ */
+/* $OpenBSD: kdump.c,v 1.23 2003/10/13 00:44:25 tedu Exp $ */
/*-
* Copyright (c) 1988, 1993
@@ -39,7 +39,7 @@ static char copyright[] =
#if 0
static char sccsid[] = "@(#)kdump.c 8.4 (Berkeley) 4/28/95";
#endif
-static char *rcsid = "$OpenBSD: kdump.c,v 1.22 2003/07/02 20:54:17 deraadt Exp $";
+static char *rcsid = "$OpenBSD: kdump.c,v 1.23 2003/10/13 00:44:25 tedu Exp $";
#endif /* not lint */
#include <sys/param.h>
@@ -220,9 +220,12 @@ main(int argc, char *argv[])
if ((ktrlen = ktr_header.ktr_len) < 0)
errx(1, "bogus length 0x%x", ktrlen);
if (ktrlen > size) {
- m = (void *)realloc(m, ktrlen+1);
- if (m == NULL)
+ void *newm;
+
+ newm = realloc(m, ktrlen+1);
+ if (newm == NULL)
errx(1, "%s", strerror(ENOMEM));
+ m = newm;
size = ktrlen;
}
if (ktrlen && fread_tail(m, ktrlen, 1) == 0)