Skip to content

Commit

Permalink
output-json-email: fix memleak
Browse files Browse the repository at this point in the history
This possibly fix:

ndirect leak of 64 byte(s) in 1 object(s) allocated from:
    #0 0x4c264b in malloc (/home/victor/qa/buildbot/donkey/z600fuzz/Private/src/.libs/lt-suricata+0x4c264b)
    #1 0x7fb09c1e8aaa in json_array (/usr/lib/x86_64-linux-gnu/libjansson.so.4+0x6aaa)
    #2 0xd67553 in JsonEmailLogJsonData /home/victor/qa/buildbot/donkey/z600fuzz/Private/src/output-json-email-common.c:290:27
    #3 0xd6a272 in JsonEmailLogJson /home/victor/qa/buildbot/donkey/z600fuzz/Private/src/output-json-email-common.c:370:19
    #4 0xd956b9 in JsonSmtpLogger /home/victor/qa/buildbot/donkey/z600fuzz/Private/src/output-json-smtp.c:103:9
    #5 0xdcedac in OutputTxLog /home/victor/qa/buildbot/donkey/z600fuzz/Private/src/output-tx.c:165:17
    #6 0xff6669 in TmThreadsSlotVarRun /home/victor/qa/buildbot/donkey/z600fuzz/Private/src/tm-threads.c:132:17
    #7 0xffecc1 in TmThreadsSlotVar /home/victor/qa/buildbot/donkey/z600fuzz/Private/src/tm-threads.c:474:17
    #8 0x7fb09bfcc181 in start_thread /build/eglibc-3GlaMS/eglibc-2.19/nptl/pthread_create.c:312
  • Loading branch information
regit authored and victorjulien committed Mar 21, 2016
1 parent 9dec6d9 commit a05cdbd
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/output-json-email-common.c
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,9 @@ static json_t* JsonEmailJsonArrayFromCommaList(const uint8_t *val, size_t len)
sp = SkipWhiteSpaceTill(p, savep);
json_array_append_new(ajs, json_string(sp));
}
} else {
json_decref(ajs);
return NULL;
}
SCFree(to_line);
}
Expand Down

0 comments on commit a05cdbd

Please sign in to comment.