tlsstore: fix memleak

Bug #1771.

Direct leak of 1834 byte(s) in 1 object(s) allocated from:
    #0 0x4e2e65 in realloc ??:?
    #1 0xcec27b in LogTlsLogPem /home/mats/suricata/src/log-tlsstore.c:130
    #2 0xcea4f5 in LogTlsStoreLogger /home/mats/suricata/src/log-tlsstore.c:303
    #3 0xd8b99c in OutputPacketLog /home/mats/suricata/src/output-packet.c:104
pull/2081/head
Mats Klepsland 10 years ago committed by Victor Julien
parent ed33f5f148
commit 45342078e4

@ -166,6 +166,7 @@ static void LogTlsLogPem(LogTlsStoreLogThread *aft, const Packet *p, SSLState *s
goto end_fwrite_fp;
}
fclose(fp);
SCFree(aft->enc_buf);
//Logging certificate informations
memcpy(filename + (strlen(filename) - 3), "meta", 4);
@ -222,6 +223,7 @@ static void LogTlsLogPem(LogTlsStoreLogThread *aft, const Packet *p, SSLState *s
end_fwrite_fp:
fclose(fp);
SCFree(aft->enc_buf);
if (logging_dir_not_writable < LOGGING_WRITE_ISSUE_LIMIT) {
SCLogWarning(SC_ERR_FWRITE, "Unable to write certificate");
logging_dir_not_writable++;

Loading…
Cancel
Save