output-json-email: fix error code

Returning early if first function call fail could avoid some issue.
pull/1954/head
Eric Leblond 11 years ago committed by Victor Julien
parent b5972eeea2
commit 92ad63abb7

@ -371,6 +371,10 @@ TmEcode JsonEmailLogJson(JsonEmailLogThread *aft, json_t *js, const Packet *p, F
OutputJsonEmailCtx *email_ctx = aft->emaillog_ctx; OutputJsonEmailCtx *email_ctx = aft->emaillog_ctx;
SMTPTransaction *tx = (SMTPTransaction *) vtx; SMTPTransaction *tx = (SMTPTransaction *) vtx;
if (sjs == NULL) {
SCReturnInt(TM_ECODE_FAILED);
}
if ((email_ctx->flags & LOG_EMAIL_EXTENDED) || (email_ctx->fields != 0)) if ((email_ctx->flags & LOG_EMAIL_EXTENDED) || (email_ctx->fields != 0))
JsonEmailLogJSONCustom(email_ctx, sjs, tx); JsonEmailLogJSONCustom(email_ctx, sjs, tx);

Loading…
Cancel
Save