diff options
author | 2003-04-04 02:56:51 +0000 | |
---|---|---|
committer | 2003-04-04 02:56:51 +0000 | |
commit | 96a8bdba8a09616e39db57b7bb918809b1a0c705 (patch) | |
tree | 83024e8ee578c56950244d0a7923a1fbf2b56e30 | |
parent | sprintf -> snprintf, plus check for overflow in device name. (diff) | |
download | wireguard-openbsd-96a8bdba8a09616e39db57b7bb918809b1a0c705.tar.xz wireguard-openbsd-96a8bdba8a09616e39db57b7bb918809b1a0c705.zip |
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 3f7491e7cb5..3df9003b99b 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: /home/cvs/src/usr.sbin/tcpdump/savestr.c,v 1.4 2003/04/02 20:42:22 millert Exp $ (LBL)"; + "@(#) $Header: /home/cvs/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); } } |