diff options
author | Todd C. Miller <millert@cvs.openbsd.org> | 2004-07-06 03:38:15 +0000 |
---|---|---|
committer | Todd C. Miller <millert@cvs.openbsd.org> | 2004-07-06 03:38:15 +0000 |
commit | 3842d83f46f7dbcbb0296754e6b5bc7418e74824 (patch) | |
tree | 2eabd6e177ffda3dca9327eb157e27a6d186ce80 /usr.sbin/mailwrapper | |
parent | 35d6263f840b4c6c7bf3dff1860b9827a8c081dc (diff) |
Back out rev 1.2 as it doesn't make sense--since we exit on failure
there is no need to save the old value of the pointer we are
realloc()ing. Based on a diff from Andrey Matveev.
Diffstat (limited to 'usr.sbin/mailwrapper')
-rw-r--r-- | usr.sbin/mailwrapper/mailwrapper.c | 15 |
1 files changed, 3 insertions, 12 deletions
diff --git a/usr.sbin/mailwrapper/mailwrapper.c b/usr.sbin/mailwrapper/mailwrapper.c index 7fafb23cdef..121fb0bc926 100644 --- a/usr.sbin/mailwrapper/mailwrapper.c +++ b/usr.sbin/mailwrapper/mailwrapper.c @@ -1,4 +1,4 @@ -/* $OpenBSD: mailwrapper.c,v 1.15 2003/03/09 01:24:26 millert Exp $ */ +/* $OpenBSD: mailwrapper.c,v 1.16 2004/07/06 03:38:14 millert Exp $ */ /* $NetBSD: mailwrapper.c,v 1.2 1999/02/20 22:10:07 thorpej Exp $ */ /* @@ -67,20 +67,11 @@ initarg(struct arglist *al) static void addarg(struct arglist *al, const char *arg, int copy) { - char **argv2; - if (al->argc == al->maxc) { al->maxc <<= 1; - - if ((argv2 = realloc(al->argv, - al->maxc * sizeof(char *))) == NULL) { - if (al->argv) - free(al->argv); - al->argv = NULL; + al->argv = realloc(al->argv, al->maxc * sizeof(char *)); + if (al->argv == NULL) err(1, "realloc"); - } else { - al->argv = argv2; - } } if (copy) { if ((al->argv[al->argc++] = strdup(arg)) == NULL) |