diff options
author | Todd C. Miller <millert@cvs.openbsd.org> | 2003-04-04 02:56:52 +0000 |
---|---|---|
committer | Todd C. Miller <millert@cvs.openbsd.org> | 2003-04-04 02:56:52 +0000 |
commit | 5283331e56017d3af43dc97b612108c0e98b169d (patch) | |
tree | e6e1ecddaa6708461b4658c640b247019229befe | |
parent | 8612bd7aa029e97b21cb74b0c89c774dc52d7dc4 (diff) |
Back out the realloc change, to do it right requires more record
keeping and could result in very large memory chunks.
-rw-r--r-- | usr.sbin/tcpdump/savestr.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/usr.sbin/tcpdump/savestr.c b/usr.sbin/tcpdump/savestr.c index e9850ccb010..6c4e3643f61 100644 --- a/usr.sbin/tcpdump/savestr.c +++ b/usr.sbin/tcpdump/savestr.c @@ -1,4 +1,4 @@ -/* $OpenBSD: savestr.c,v 1.4 2003/04/02 20:42:22 millert Exp $ */ +/* $OpenBSD: savestr.c,v 1.5 2003/04/04 02:56:51 millert Exp $ */ /* * Copyright (c) 1997 @@ -23,7 +23,7 @@ #ifndef lint static const char rcsid[] = - "@(#) $Header: /cvs/OpenBSD/src/usr.sbin/tcpdump/savestr.c,v 1.4 2003/04/02 20:42:22 millert Exp $ (LBL)"; + "@(#) $Header: /cvs/OpenBSD/src/usr.sbin/tcpdump/savestr.c,v 1.5 2003/04/04 02:56:51 millert Exp $ (LBL)"; #endif #include <sys/types.h> @@ -53,9 +53,9 @@ savestr(register const char *str) strsize = 1024; if (strsize < size) strsize = size; - strptr = strptr ? realloc(strptr, strsize) : malloc(strsize); + strptr = (char *)malloc(strsize); if (strptr == NULL) { - fprintf(stderr, "savestr: cannot allocate memory\n"); + fprintf(stderr, "savestr: malloc\n"); exit(1); } } |