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 -D _GNU_SOURCE -D _GNU_SOURCE -D _REENTRANT -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 -fvisibility hidden -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 | #define STDC_HEADERS 1 |
11 | #define HAVE_SYS_TYPES_H 1 |
12 | #define HAVE_SYS_STAT_H 1 |
13 | #define HAVE_STDLIB_H 1 |
14 | #define HAVE_STRING_H 1 |
15 | #define HAVE_MEMORY_H 1 |
16 | #define HAVE_STRINGS_H 1 |
17 | #define HAVE_INTTYPES_H 1 |
18 | #define HAVE_STDINT_H 1 |
19 | #define HAVE_UNISTD_H 1 |
20 | #define SIZEOF_VOID_P 8 |
21 | #define LG_SIZEOF_PTR 3 |
22 | #define SIZEOF_INT 4 |
23 | #define LG_SIZEOF_INT 2 |
24 | #define SIZEOF_LONG 8 |
25 | #define LG_SIZEOF_LONG 3 |
26 | #define SIZEOF_LONG_LONG 8 |
27 | #define LG_SIZEOF_LONG_LONG 3 |
28 | #define SIZEOF_INTMAX_T 8 |
29 | #define LG_SIZEOF_INTMAX_T 3 |
30 | #define HAVE_CPU_SPINWAIT 1 |
31 | #define CPU_SPINWAIT __asm__ volatile("pause") |
32 | #define LG_VADDR 48 |
33 | #define LG_VADDR 48 |
34 | #define JEMALLOC_PURGE_MADVISE_DONTNEED_ZEROS |
35 | #define JEMALLOC_HAS_ALLOCA_H 1 |
36 | #define JEMALLOC_PROC_SYS_VM_OVERCOMMIT_MEMORY |
37 | #define JEMALLOC_THREADED_INIT |
38 | #define JEMALLOC_USE_CXX_THROW |
39 | #define HAVE_MALLOC_H 1 |
40 | #define JEMALLOC_USABLE_SIZE_CONST |
41 | #define JEMALLOC_HAVE_ATTR |
42 | #define JEMALLOC_HAVE_ATTR_ALLOC_SIZE |
43 | #define JEMALLOC_HAVE_ATTR_FORMAT_GNU_PRINTF |
44 | #define JEMALLOC_HAVE_ATTR_FORMAT_PRINTF |
45 | #define JEMALLOC_PREFIX "je_" |
46 | #define JEMALLOC_CPREFIX "JE_" |
47 | #define JEMALLOC_OVERRIDE_MEMALIGN |
48 | #define JEMALLOC_OVERRIDE_VALLOC |
49 | #define JEMALLOC_PRIVATE_NAMESPACE je_ |
50 | #define JEMALLOC_CONFIG_MALLOC_CONF "" |
51 | #define JEMALLOC_STATS |
52 | #define JEMALLOC_MAPS_COALESCE |
53 | #define JEMALLOC_RETAIN |
54 | #define JEMALLOC_DSS |
55 | #define JEMALLOC_FILL |
56 | #define JEMALLOC_CACHE_OBLIVIOUS |
57 | #define JEMALLOC_INTERNAL_UNREACHABLE __builtin_unreachable |
58 | #define JEMALLOC_INTERNAL_FFSLL __builtin_ffsll |
59 | #define JEMALLOC_INTERNAL_FFSL __builtin_ffsl |
60 | #define JEMALLOC_INTERNAL_FFS __builtin_ffs |
61 | #define LG_QUANTUM 3 |
62 | #define LG_PAGE 12 |
63 | #define LG_HUGEPAGE 21 |
64 | #define JEMALLOC_HAVE_PTHREAD |
65 | #define HAVE_PTHREAD_H 1 |
66 | #define HAVE_DLFCN_H 1 |
67 | #define JEMALLOC_HAVE_DLSYM |
68 | #define JEMALLOC_HAVE_PTHREAD_ATFORK |
69 | #define JEMALLOC_HAVE_PTHREAD_SETNAME_NP |
70 | #define JEMALLOC_HAVE_CLOCK_MONOTONIC_COARSE 1 |
71 | #define JEMALLOC_HAVE_CLOCK_MONOTONIC 1 |
72 | #define JEMALLOC_USE_SYSCALL |
73 | #define JEMALLOC_HAVE_SECURE_GETENV |
74 | #define JEMALLOC_HAVE_SCHED_GETCPU |
75 | #define JEMALLOC_HAVE_SCHED_SETAFFINITY |
76 | #define JEMALLOC_TLS |
77 | #define JEMALLOC_GCC_ATOMIC_ATOMICS 1 |
78 | #define JEMALLOC_GCC_SYNC_ATOMICS 1 |
79 | #define JEMALLOC_HAVE_MADVISE |
80 | #define JEMALLOC_PURGE_MADVISE_FREE |
81 | #define JEMALLOC_PURGE_MADVISE_DONTNEED |
82 | #define JEMALLOC_MADVISE_DONTDUMP |
83 | #define JEMALLOC_HAVE_MADVISE_HUGE |
84 | #define JEMALLOC_HAVE_BUILTIN_CLZ |
85 | #define JEMALLOC_TLS_MODEL __attribute__((tls_model("initial-exec"))) |
86 | #define JEMALLOC_BACKGROUND_THREAD 1 |
87 | #define JEMALLOC_HAVE_PTHREAD_MUTEX_ADAPTIVE_NP |
88 | |
89 | |
90 | #include <errno.h> |
91 | #include <stdio.h> |
92 | #include <stdlib.h> |
93 | #include <string.h> |
94 | |
95 | int |
96 | main () |
97 | { |
98 | |
99 | char *buffer = (char *) malloc(100); |
| |
100 | char *error = strerror_r(EINVAL, buffer, 100); |
| 2 | | Potential leak of memory pointed to by 'buffer' |
|
101 | printf("%s\n", error); |
102 | |
103 | ; |
104 | return 0; |
105 | } |