From 8a77e6bc8e6677b2bdf7205891073b9bfb7055ef Mon Sep 17 00:00:00 2001 From: Victor Julien Date: Wed, 4 Jun 2014 16:54:56 +0200 Subject: [PATCH] Fix Coverity 1220097 *** CID 1220097: Missing unlock (LOCK) /src/log-file.c: 160 in LogFileWriteJsonRecord() 154 } 155 } 156 157 /* Bail early if no file pointer to write to (in the unlikely 158 * event file rotation failed. */ 159 if (aft->file_ctx->fp == NULL) { >>> CID 1220097: Missing unlock (LOCK) >>> Returning without unlocking "aft->file_ctx->fp_mutex". 160 return; 161 } 162 163 FILE *fp = aft->file_ctx->fp; 164 char timebuf[64]; 165 AppProto alproto = FlowGetAppProtocol(p->flow); --- src/log-file.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/log-file.c b/src/log-file.c index 3c5bcd9c7c..1cf10b584c 100644 --- a/src/log-file.c +++ b/src/log-file.c @@ -157,6 +157,7 @@ static void LogFileWriteJsonRecord(LogFileLogThread *aft, const Packet *p, const /* Bail early if no file pointer to write to (in the unlikely * event file rotation failed. */ if (aft->file_ctx->fp == NULL) { + SCMutexUnlock(&aft->file_ctx->fp_mutex); return; }