From 5283331e56017d3af43dc97b612108c0e98b169d Mon Sep 17 00:00:00 2001 From: "Todd C. Miller" Date: Fri, 4 Apr 2003 02:56:52 +0000 Subject: Back out the realloc change, to do it right requires more record keeping and could result in very large memory chunks. --- usr.sbin/tcpdump/savestr.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'usr.sbin') 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 @@ -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); } } -- cgit v1.2.3