Bug Summary

File:src/usr.sbin/unbound/obj/conftest.c
Warning:line 94, column 28
Potential memory leak

Annotated Source Code

Press '?' to see keyboard shortcuts

clang -cc1 -cc1 -triple amd64-unknown-openbsd7.4 -analyze -disable-free -clear-ast-before-backend -disable-llvm-verifier -discard-value-names -main-file-name conftest.c -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 pic -pic-level 1 -pic-is-pie -mframe-pointer=all -relaxed-aliasing -ffp-contract=on -fno-rounding-math -mconstructor-aliases -funwind-tables=2 -target-cpu x86-64 -target-feature +retpoline-indirect-calls -target-feature +retpoline-indirect-branches -tune-cpu generic -debugger-tuning=gdb -fcoverage-compilation-dir=/usr/src/usr.sbin/unbound/obj -resource-dir /usr/local/llvm16/lib/clang/16 -I /usr/src/usr.sbin/unbound -internal-isystem /usr/local/llvm16/lib/clang/16/include -internal-externc-isystem /usr/include -O2 -fdebug-compilation-dir=/usr/src/usr.sbin/unbound/obj -ferror-limit 19 -fwrapv -D_RET_PROTECTOR -ret-protector -fcf-protection=branch -fno-jump-tables -fgnuc-version=4.2.1 -vectorize-loops -vectorize-slp -fno-builtin-malloc -fno-builtin-calloc -fno-builtin-realloc -fno-builtin-valloc -fno-builtin-free -fno-builtin-strdup -fno-builtin-strndup -analyzer-output=html -faddrsig -D__GCC_HAVE_DWARF2_CFI_ASM=1 -o /home/ben/Projects/scan/2024-01-11-140451-98009-1 -x c conftest.c
1/* confdefs.h */
2#define PACKAGE_NAME"unbound" "unbound"
3#define PACKAGE_TARNAME"unbound" "unbound"
4#define PACKAGE_VERSION"1.18.0" "1.18.0"
5#define PACKAGE_STRING"unbound 1.18.0" "unbound 1.18.0"
6#define PACKAGE_BUGREPORT"unbound-bugs@nlnetlabs.nl or https://github.com/NLnetLabs/unbound/issues" "unbound-bugs@nlnetlabs.nl or https://github.com/NLnetLabs/unbound/issues"
7#define PACKAGE_URL"" ""
8#define CONFCMDLINE"--enable-allsymbols --with-ssl=/usr --with-libevent=/usr --with-libexpat=/usr --without-pythonmodule --with-chroot-dir=/var/unbound --with-pidfile= --with-rootkey-file=/var/unbound/db/root.key --with-conf-file=/var/unbound/etc/unbound.conf --with-username=_unbound --disable-shared --disable-explicit-port-randomisation --without-pthreads" "--enable-allsymbols --with-ssl=/usr --with-libevent=/usr --with-libexpat=/usr --without-pythonmodule --with-chroot-dir=/var/unbound --with-pidfile= --with-rootkey-file=/var/unbound/db/root.key --with-conf-file=/var/unbound/etc/unbound.conf --with-username=_unbound --disable-shared --disable-explicit-port-randomisation --without-pthreads"
9#define STDC_HEADERS1 1
10#define HAVE_SYS_TYPES_H1 1
11#define HAVE_SYS_STAT_H1 1
12#define HAVE_STDLIB_H1 1
13#define HAVE_STRING_H1 1
14#define HAVE_MEMORY_H1 1
15#define HAVE_STRINGS_H1 1
16#define HAVE_INTTYPES_H1 1
17#define HAVE_STDINT_H1 1
18#define HAVE_UNISTD_H1 1
19#define __EXTENSIONS__1 1
20#define _ALL_SOURCE1 1
21#define _GNU_SOURCE1 1
22#define _POSIX_PTHREAD_SEMANTICS1 1
23#define _TANDEM_SOURCE1 1
24#define CONFIGFILE"/var/unbound/etc/unbound.conf" "/var/unbound/etc/unbound.conf"
25#define RUN_DIR"/var/unbound/etc" "/var/unbound/etc"
26#define CHROOT_DIR"/var/unbound" "/var/unbound"
27#define SHARE_DIR"/var/unbound/etc" "/var/unbound/etc"
28#define PIDFILE"" ""
29#define ROOT_ANCHOR_FILE"/var/unbound/db/root.key" "/var/unbound/db/root.key"
30#define ROOT_CERT_FILE"/var/unbound/etc/icannbundle.pem" "/var/unbound/etc/icannbundle.pem"
31#define UB_USERNAME"_unbound" "_unbound"
32#define WINVER0x0502 0x0502
33#define RSRC_PACKAGE_VERSION1,18,0,0 1,18,0,0
34#define HAVE_GETOPT_H1 1
35#define HAVE_TIME_H1 1
36#define HAVE_ATTR_FORMAT1 1
37#define HAVE_ATTR_UNUSED1 1
38#define HAVE_ATTR_WEAK1 1
39#define ATTR_WEAK__attribute__((weak)) __attribute__((weak))
40#define HAVE_ATTR_NORETURN1 1
41#define ATTR_NORETURN__attribute__((__noreturn__)) __attribute__((__noreturn__))
42#define YYTEXT_POINTER1 1
43#define LEX_HAS_YYLEX_DESTROY1 1
44#define HAVE_DLFCN_H1 1
45#define LT_OBJDIR".libs/" ".libs/"
46#define HAVE_STDARG_H1 1
47#define HAVE_STDBOOL_H1 1
48#define HAVE_NETINET_IN_H1 1
49#define HAVE_NETINET_TCP_H1 1
50#define HAVE_SYS_PARAM_H1 1
51#define HAVE_SYS_SELECT_H1 1
52#define HAVE_SYS_SOCKET_H1 1
53#define HAVE_SYS_UN_H1 1
54#define HAVE_SYS_UIO_H1 1
55#define HAVE_SYS_RESOURCE_H1 1
56#define HAVE_ARPA_INET_H1 1
57#define HAVE_SYSLOG_H1 1
58#define HAVE_NETDB_H1 1
59#define HAVE_SYS_WAIT_H1 1
60#define HAVE_PWD_H1 1
61#define HAVE_GLOB_H1 1
62#define HAVE_GRP_H1 1
63#define HAVE_LOGIN_CAP_H1 1
64#define HAVE_ENDIAN_H1 1
65#define HAVE_SYS_ENDIAN_H1 1
66#define HAVE_SYS_IPC_H1 1
67#define HAVE_SYS_SHM_H1 1
68#define HAVE_IFADDRS_H1 1
69#define HAVE_POLL_H1 1
70#define HAVE_NET_IF_H1 1
71#define SIZEOF_TIME_T8 8
72#define SIZEOF_SIZE_T8 8
73#define HAVE_UNISTD_H1 1
74#define HAVE_CHOWN1 1
75#define HAVE_FORK1 1
76#define HAVE_VFORK1 1
77#define HAVE_WORKING_VFORK1 1
78#define HAVE_WORKING_FORK1 1
79#define RETSIGTYPEvoid void
80#define HAVE_FSEEKO1 1
81#define HAVE_STRPTIME1 1
82#define STRPTIME_WORKS1 1
83#define REUSEPORT_DEFAULT0 0
84/* end confdefs.h. */
85#if defined STDC_HEADERS1 || defined HAVE_STDLIB_H1
86#include <stdlib.h>
87#else
88char *malloc ();
89#endif
90
91int
92main ()
93{
94 if(malloc(0) != 0) return 1;
1
Memory is allocated
2
Assuming the condition is true
3
Taking true branch
4
Potential memory leak
95 ;
96 return 0;
97}
98