]> git.ipfire.org Git - thirdparty/suricata.git/commit
log-pcap: remove redundant check 7369/head
authorVictor Julien <vjulien@oisf.net>
Wed, 27 Apr 2022 09:36:21 +0000 (11:36 +0200)
committerVictor Julien <vjulien@oisf.net>
Tue, 3 May 2022 11:30:21 +0000 (13:30 +0200)
commit1deba233762198ae09c21936dad97307d310ccb3
tree2086a21b74360f006afa7fab1fc6d030277b7428
parentbd66679b2ee354f2470785c8429f4078b4b8a4a9
log-pcap: remove redundant check

Check is always true but confuses cppcheck:

src/log-pcap.c:1224:32: warning: Either the condition 'filename' is redundant or there is possible null pointer dereference: filename. [nullPointerRedundantCheck]
    if ((pl->prefix = SCStrdup(filename)) == NULL) {
                               ^
src/log-pcap.c:1421:9: note: Assuming that condition 'filename' is not redundant
    if (filename) {
        ^
src/log-pcap.c:1224:32: note: Null pointer dereference
    if ((pl->prefix = SCStrdup(filename)) == NULL) {
                               ^

Bug: #5291.
(cherry picked from commit 3dfbf0bf1124aab7c7060f46b364877ab25455ee)
src/log-pcap.c