From d6b35d62bab9d80f1763a5fa08665d996f9bf787 Mon Sep 17 00:00:00 2001 From: Matthias Andree Date: Tue, 14 Nov 2006 09:52:05 +0000 Subject: Fix regression from 6.3.4 that crashes fetchmail --mda FOO when encountering malformed message. Report by Neil Hoggart (also closes BerliOS bugs #9364, #9412, #9449). svn path=/branches/BRANCH_6-3/; revision=4940 --- sink.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'sink.c') diff --git a/sink.c b/sink.c index 2e36e57e..e2d8c7a7 100644 --- a/sink.c +++ b/sink.c @@ -1317,14 +1317,14 @@ int close_sink(struct query *ctl, struct msgblk *msg, flag forward) { int rc,e,e2,err = 0; - if (ferror(sinkfp)) - err = 1, e2 = errno; - if ((fflush(sinkfp))) - err = 1, e2 = errno; - /* close the delivery pipe, we'll reopen before next message */ if (sinkfp) { + if (ferror(sinkfp)) + err = 1, e2 = errno; + if ((fflush(sinkfp))) + err = 1, e2 = errno; + errno = 0; rc = pclose(sinkfp); e = errno; -- cgit v1.2.3