]> git.ipfire.org Git - thirdparty/suricata.git/commit
mime: address scan-build warnings
authorVictor Julien <vjulien@oisf.net>
Fri, 21 Apr 2023 12:12:36 +0000 (14:12 +0200)
committerVictor Julien <vjulien@oisf.net>
Mon, 24 Apr 2023 05:17:22 +0000 (07:17 +0200)
commit9224b3435b94e848cc677103573439e505e808b3
tree4d2dad0965830ac52c3349907ee443701e3c9715
parentb625aa9748db38f6905576be9a22d3125afad868
mime: address scan-build warnings

util-decode-mime.c:189:31: warning: Use of memory after it is freed [unix.Malloc]
            lastSibling->next = entity->child;
            ~~~~~~~~~~~~~~~~~ ^
util-decode-mime.c:827:24: warning: Potential leak of memory pointed to by 'val' [unix.Malloc]
        state->hname = NULL;
                       ^~~~
/usr/lib/llvm-16/lib/clang/16/include/stddef.h:89:24: note: expanded from macro 'NULL'
 #  define NULL ((void*)0)
                       ^
2 warnings generated.

Improve error handling and add assert to avoid these warnings.

Bug: #3147.
src/util-decode-mime.c