Moved file close
Signed-off-by: Tyrolyean <tyrolyean@tyrolyean.net>
This commit is contained in:
parent
f611b9d729
commit
ece1e21535
1 changed files with 8 additions and 7 deletions
15
src/main.c
15
src/main.c
|
@ -40,17 +40,13 @@ sfsistat mlfi_cleanup(SMFICTX* ctx, bool ok) {
|
|||
return rstat;
|
||||
}
|
||||
|
||||
/* close the archive file */
|
||||
if (priv->mlfi_fp != NULL && fclose(priv->mlfi_fp) == EOF){
|
||||
/* failed; we have to wait until later */
|
||||
rstat = SMFIS_TEMPFAIL;
|
||||
(void) unlink(priv->mlfi_fname);
|
||||
} else if (ok){
|
||||
if (ok){
|
||||
|
||||
/* add a header to the message announcing our presence */
|
||||
smfi_addheader(ctx, "X-Mail-Attached", VERSION);
|
||||
|
||||
/* replace body if attachements have been found */
|
||||
|
||||
char* new_body = attach_files(priv->mlfi_fp);
|
||||
if(new_body != NULL){
|
||||
|
||||
|
@ -68,7 +64,12 @@ sfsistat mlfi_cleanup(SMFICTX* ctx, bool ok) {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* close the archive file */
|
||||
if (priv->mlfi_fp != NULL && fclose(priv->mlfi_fp) == EOF){
|
||||
/* failed; we have to wait until later */
|
||||
rstat = SMFIS_TEMPFAIL;
|
||||
(void) unlink(priv->mlfi_fname);
|
||||
}
|
||||
/* In any case release the temporary data storage file */
|
||||
(void) unlink(priv->mlfi_fname);
|
||||
|
||||
|
|
Loading…
Reference in a new issue