clang -cc1 -triple x86_64-pc-linux-gnu -analyze -disable-free -disable-llvm-verifier -discard-value-names -main-file-name conftest.c -analyzer-store=region -analyzer-opt-analyze-nested-blocks -analyzer-checker=core -analyzer-checker=apiModeling -analyzer-checker=unix -analyzer-checker=deadcode -analyzer-checker=security.insecureAPI.UncheckedReturn -analyzer-checker=security.insecureAPI.getpw -analyzer-checker=security.insecureAPI.gets -analyzer-checker=security.insecureAPI.mktemp -analyzer-checker=security.insecureAPI.mkstemp -analyzer-checker=security.insecureAPI.vfork -analyzer-checker=nullability.NullPassedToNonnull -analyzer-checker=nullability.NullReturnedFromNonnull -analyzer-output plist -w -setup-static-analyzer -mrelocation-model static -mthread-model posix -mframe-pointer=none -fmath-errno -fno-rounding-math -masm-verbose -mconstructor-aliases -munwind-tables -target-cpu x86-64 -dwarf-column-info -fno-split-dwarf-inlining -debugger-tuning=gdb -resource-dir /usr/lib/llvm-10/lib/clang/10.0.0 -internal-isystem /usr/local/include -internal-isystem /usr/lib/llvm-10/lib/clang/10.0.0/include -internal-externc-isystem /usr/include/x86_64-linux-gnu -internal-externc-isystem /include -internal-externc-isystem /usr/include -O3 -Wno-format-zero-length -std=gnu99 -fdebug-compilation-dir /home/netto/Desktop/redis-6.2.1/deps/jemalloc -ferror-limit 19 -fmessage-length 0 -funroll-loops -fgnuc-version=4.2.1 -fobjc-runtime=gcc -fdiagnostics-show-option -vectorize-loops -vectorize-slp -analyzer-output=html -faddrsig -o /tmp/scan-build-2021-03-14-133648-8817-1 -x c conftest.c
1 | |
2 | #define PACKAGE_NAME "" |
3 | #define PACKAGE_TARNAME "" |
4 | #define PACKAGE_VERSION "" |
5 | #define PACKAGE_STRING "" |
6 | #define PACKAGE_BUGREPORT "" |
7 | #define PACKAGE_URL "" |
8 | #define JEMALLOC_HAS_RESTRICT 1 |
9 | #define HAVE_CXX14 1 |
10 | |
11 | |
12 | #include <stdlib.h> |
13 | |
14 | int |
15 | main () |
16 | { |
17 | |
18 | int *arr = (int *)malloc(sizeof(int) * 42); |
| |
19 | if (arr == NULL) |
| 2 | | Assuming 'arr' is not equal to NULL | |
|
| |
20 | return 1; |
21 | |
22 | ; |
23 | return 0; |
| 4 | | Potential leak of memory pointed to by 'arr' |
|
24 | } |