summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/mail.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/mail.c b/src/mail.c
index 1f092ebc1..6eb0d9839 100644
--- a/src/mail.c
+++ b/src/mail.c
@@ -228,14 +228,15 @@ void MailEnd(MailInfo * mail)
fclose(mail->writepipe);
fd = popen(SendMailPath, "w");
- if (!fd)
- return;
- while ((ret = fgetc(mail->readpipe)) != 255)
- fputc(ret, fd);
+ if (fd)
+ {
+ while ((ret = fgetc(mail->readpipe)) != 255)
+ fputc(ret, fd);
+ pclose(fd);
+ }
fclose(mail->readpipe);
- pclose(fd);
exit(EXIT_SUCCESS);
}
else if (pid < 0)