From dbe49c83c01b5ceef09419de09c0fbaed81cde4d Mon Sep 17 00:00:00 2001 From: "Eric S. Raymond" Date: Sun, 18 Jan 1998 00:41:15 +0000 Subject: Prevent core dumps due to simultaneous use of %F and %T. svn path=/trunk/; revision=1589 --- driver.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/driver.c b/driver.c index 82e6f2a0..cbdad26b 100644 --- a/driver.c +++ b/driver.c @@ -923,7 +923,7 @@ int num; /* index of message */ if (idp->val.num == XMIT_ACCEPT) length += (strlen(idp->id) + 1); - names = (char *)alloca(++length); + names = (char *)xmalloc(++length); names[0] = '\0'; for (idp = xmit_names; idp; idp = idp->next) if (idp->val.num == XMIT_ACCEPT) @@ -931,12 +931,13 @@ int num; /* index of message */ strcat(names, idp->id); strcat(names, " "); } - after = (char *)alloca(length); + after = (char *)xmalloc(length); #ifdef SNPRINTF snprintf(after, length, before, names); #else sprintf(after, before, names); #endif /* SNPRINTF */ + free(names); free(before); before = after; @@ -957,7 +958,7 @@ int num; /* index of message */ *sp = '\177'; length += strlen(from); - after = alloca(length); + after = (char *)xmalloc(length); cp[1] = 's'; #ifdef SNPRINTF snprintf(after, length, before, from); @@ -986,6 +987,7 @@ int num; /* index of message */ #endif /* HAVE_SETEUID */ sinkfp = popen(before, "w"); + free(before); #ifdef HAVE_SETEUID /* this will fail quietly if we didn't start as root */ -- cgit v1.2.3