]> git.ipfire.org Git - thirdparty/suricata.git/commit
detect/ipv6: remove useless code
authorVictor Julien <vjulien@oisf.net>
Tue, 26 Apr 2022 18:02:19 +0000 (20:02 +0200)
committerVictor Julien <vjulien@oisf.net>
Tue, 3 May 2022 11:30:18 +0000 (13:30 +0200)
commit6a3517ce5d75562d176b1e989c6c36ed417d79f6
tree438e877120d1a1c286b306f3939ac2e0504676c5
parent0cc9d2445dd5cdc7afde81dccbe69ea122ff209c
detect/ipv6: remove useless code

Remove useless allocation and free.

Found by cppcheck as a potential issue:

src/detect-engine-address-ipv6.c:385:12: warning: Either the condition 'tmp!=NULL' is redundant or there is possible null pointer dereference: tmp. [nullPointerRedundantCheck]
    memset(tmp,0,sizeof(DetectAddress));
           ^
src/detect-engine-address-ipv6.c:525:13: note: Assuming that condition 'tmp!=NULL' is not redundant
    if (tmp != NULL)
            ^
src/detect-engine-address-ipv6.c:385:12: note: Null pointer dereference
    memset(tmp,0,sizeof(DetectAddress));
           ^

But code turned out not to do anything, so removed.

Bug: #5291.
(cherry picked from commit bad900516133a81afb0a6d3982fa3de5871e6ba7)
src/detect-engine-address-ipv6.c