diff --git a/src/app-layer-smtp.c b/src/app-layer-smtp.c index 45836c5efd..9b4a27a676 100644 --- a/src/app-layer-smtp.c +++ b/src/app-layer-smtp.c @@ -529,8 +529,9 @@ int SMTPProcessDataChunk(const uint8_t *chunk, uint32_t len, (uint8_t *)entity->filename, flen, (uint8_t *)chunk, len, flags) != 0) { ret = MIME_DEC_ERR_DATA; SCLogDebug("FileOpenFile() failed"); + } else { + SMTPNewFile(tx, files->tail); } - SMTPNewFile(tx, files->tail); /* If close in the same chunk, then pass in empty bytes */ if (state->body_end) {