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;
|
return rstat;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* close the archive file */
|
if (ok){
|
||||||
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){
|
|
||||||
|
|
||||||
/* add a header to the message announcing our presence */
|
/* add a header to the message announcing our presence */
|
||||||
smfi_addheader(ctx, "X-Mail-Attached", VERSION);
|
smfi_addheader(ctx, "X-Mail-Attached", VERSION);
|
||||||
|
|
||||||
/* replace body if attachements have been found */
|
/* replace body if attachements have been found */
|
||||||
|
|
||||||
char* new_body = attach_files(priv->mlfi_fp);
|
char* new_body = attach_files(priv->mlfi_fp);
|
||||||
if(new_body != NULL){
|
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 */
|
/* In any case release the temporary data storage file */
|
||||||
(void) unlink(priv->mlfi_fname);
|
(void) unlink(priv->mlfi_fname);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue