Error: GCC_ANALYZER_WARNING (CWE-775): [#def1] liburing-2.13/examples/reg-wait.c:96:15: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘fds[0]’ liburing-2.13/examples/reg-wait.c:69:12: branch_false: following ‘false’ branch (when ‘argc <= 1’)... liburing-2.13/examples/reg-wait.c:74:21: branch_false: ...to here liburing-2.13/examples/reg-wait.c:75:12: branch_false: following ‘false’ branch (when ‘page_size >= 0’)... liburing-2.13/examples/reg-wait.c:80:13: branch_false: ...to here liburing-2.13/examples/reg-wait.c:80:12: branch_false: following ‘false’ branch... liburing-2.13/examples/reg-wait.c:85:15: branch_false: ...to here liburing-2.13/examples/reg-wait.c:86:12: branch_false: following ‘false’ branch... liburing-2.13/examples/reg-wait.c:96:15: branch_false: ...to here liburing-2.13/examples/reg-wait.c:96:15: throw: if ‘t_aligned_alloc’ throws an exception... liburing-2.13/examples/reg-wait.c:96:15: danger: ‘fds[0]’ leaks here # 94| * the rest of the memory can be reused for other purposes. # 95| */ # 96|-> reg = t_aligned_alloc(page_size, page_size); # 97| if (!reg) { # 98| fprintf(stderr, "allocation failed\n"); Error: GCC_ANALYZER_WARNING (CWE-775): [#def2] liburing-2.13/examples/reg-wait.c:96:15: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘fds[1]’ liburing-2.13/examples/reg-wait.c:69:12: branch_false: following ‘false’ branch (when ‘argc <= 1’)... liburing-2.13/examples/reg-wait.c:74:21: branch_false: ...to here liburing-2.13/examples/reg-wait.c:75:12: branch_false: following ‘false’ branch (when ‘page_size >= 0’)... liburing-2.13/examples/reg-wait.c:80:13: branch_false: ...to here liburing-2.13/examples/reg-wait.c:80:12: branch_false: following ‘false’ branch... liburing-2.13/examples/reg-wait.c:85:15: branch_false: ...to here liburing-2.13/examples/reg-wait.c:86:12: branch_false: following ‘false’ branch... liburing-2.13/examples/reg-wait.c:96:15: branch_false: ...to here liburing-2.13/examples/reg-wait.c:96:15: throw: if ‘t_aligned_alloc’ throws an exception... liburing-2.13/examples/reg-wait.c:96:15: danger: ‘fds[1]’ leaks here # 94| * the rest of the memory can be reused for other purposes. # 95| */ # 96|-> reg = t_aligned_alloc(page_size, page_size); # 97| if (!reg) { # 98| fprintf(stderr, "allocation failed\n"); Error: GCC_ANALYZER_WARNING (CWE-775): [#def3] liburing-2.13/examples/zcrx.c:113:17: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘open("/dev/udmabuf", 2)’ liburing-2.13/examples/zcrx.c:337:13: enter_function: entry to ‘run_server’ liburing-2.13/examples/zcrx.c:344:12: branch_true: following ‘true’ branch (when ‘fd == -1’)... liburing-2.13/examples/zcrx.c:345:17: branch_true: ...to here liburing-2.13/examples/zcrx.c:356:12: branch_true: following ‘true’ branch... liburing-2.13/examples/zcrx.c:357:17: branch_true: ...to here liburing-2.13/examples/zcrx.c:369:9: call_function: calling ‘setup_zcrx’ from ‘run_server’ # 111| memfd = memfd_create("udmabuf-test", MFD_ALLOW_SEALING); # 112| if (memfd < 0) # 113|-> t_error(1, memfd, "Failed to open udmabuf dev"); # 114| # 115| ret = fcntl(memfd, F_ADD_SEALS, F_SEAL_SHRINK); Error: GCC_ANALYZER_WARNING (CWE-775): [#def4] liburing-2.13/examples/zcrx.c:115:15: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘open("/dev/udmabuf", 2)’ liburing-2.13/examples/zcrx.c:337:13: enter_function: entry to ‘run_server’ liburing-2.13/examples/zcrx.c:344:12: branch_true: following ‘true’ branch (when ‘fd == -1’)... liburing-2.13/examples/zcrx.c:345:17: branch_true: ...to here liburing-2.13/examples/zcrx.c:356:12: branch_true: following ‘true’ branch... liburing-2.13/examples/zcrx.c:357:17: branch_true: ...to here liburing-2.13/examples/zcrx.c:369:9: call_function: calling ‘setup_zcrx’ from ‘run_server’ # 113| t_error(1, memfd, "Failed to open udmabuf dev"); # 114| # 115|-> ret = fcntl(memfd, F_ADD_SEALS, F_SEAL_SHRINK); # 116| if (ret < 0) # 117| t_error(1, 0, "Failed to set seals"); Error: GCC_ANALYZER_WARNING: [#def5] liburing-2.13/examples/zcrx.c:356:13: warning[-Wanalyzer-fd-use-without-check]: ‘listen’ on possibly invalid file descriptor ‘fd’ liburing-2.13/examples/zcrx.c:344:12: branch_true: following ‘true’ branch (when ‘fd == -1’)... liburing-2.13/examples/zcrx.c:345:17: branch_true: ...to here liburing-2.13/examples/zcrx.c:356:13: danger: ‘fd’ could be invalid # 354| t_error(1, 0, "bind()"); # 355| # 356|-> if (listen(fd, 1024) < 0) # 357| t_error(1, 0, "listen()"); # 358| Error: GCC_ANALYZER_WARNING (CWE-775): [#def6] liburing-2.13/examples/zcrx.c:357:17: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘fd’ liburing-2.13/examples/zcrx.c:343:14: acquire_resource: stream socket created here liburing-2.13/examples/zcrx.c:344:12: branch_false: following ‘false’ branch (when ‘fd != -1’)... liburing-2.13/examples/zcrx.c:347:9: branch_false: ...to here liburing-2.13/examples/zcrx.c:356:12: branch_true: following ‘true’ branch... liburing-2.13/examples/zcrx.c:357:17: branch_true: ...to here liburing-2.13/examples/zcrx.c:357:17: throw: if ‘t_error’ throws an exception... liburing-2.13/examples/zcrx.c:357:17: danger: ‘fd’ leaks here # 355| # 356| if (listen(fd, 1024) < 0) # 357|-> t_error(1, 0, "listen()"); # 358| # 359| flags |= IORING_SETUP_COOP_TASKRUN; Error: GCC_ANALYZER_WARNING (CWE-775): [#def7] liburing-2.13/examples/zcrx.c:365:15: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘fd’ liburing-2.13/examples/zcrx.c:343:14: acquire_resource: stream socket created here liburing-2.13/examples/zcrx.c:344:12: branch_false: following ‘false’ branch (when ‘fd != -1’)... liburing-2.13/examples/zcrx.c:347:9: branch_false: ...to here liburing-2.13/examples/zcrx.c:356:12: branch_false: following ‘false’ branch... liburing-2.13/examples/zcrx.c:365:15: branch_false: ...to here liburing-2.13/examples/zcrx.c:365:15: throw: if ‘io_uring_queue_init’ throws an exception... liburing-2.13/examples/zcrx.c:365:15: danger: ‘fd’ leaks here # 363| flags |= IORING_SETUP_CQE32; # 364| # 365|-> ret = io_uring_queue_init(512, &ring, flags); # 366| if (ret) # 367| t_error(1, ret, "ring init failed"); Error: GCC_ANALYZER_WARNING (CWE-775): [#def8] liburing-2.13/examples/zcrx.c:367:17: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘fd’ liburing-2.13/examples/zcrx.c:343:14: acquire_resource: stream socket created here liburing-2.13/examples/zcrx.c:344:12: branch_false: following ‘false’ branch (when ‘fd != -1’)... liburing-2.13/examples/zcrx.c:347:9: branch_false: ...to here liburing-2.13/examples/zcrx.c:356:12: branch_false: following ‘false’ branch... liburing-2.13/examples/zcrx.c:365:15: branch_false: ...to here liburing-2.13/examples/zcrx.c:366:12: branch_true: following ‘true’ branch... liburing-2.13/examples/zcrx.c:367:17: branch_true: ...to here liburing-2.13/examples/zcrx.c:367:17: throw: if ‘t_error’ throws an exception... liburing-2.13/examples/zcrx.c:367:17: danger: ‘fd’ leaks here # 365| ret = io_uring_queue_init(512, &ring, flags); # 366| if (ret) # 367|-> t_error(1, ret, "ring init failed"); # 368| # 369| setup_zcrx(&ring); Error: CPPCHECK_WARNING (CWE-457): [#def9] liburing-2.13/src/include/liburing.h:945: warning[uninitvar]: Uninitialized variable: events # 943| LIBURING_NOEXCEPT # 944| { # 945|-> io_uring_prep_rw(IORING_OP_EPOLL_WAIT, sqe, fd, events, maxevents, 0); # 946| sqe->rw_flags = flags; # 947| } Error: GCC_ANALYZER_WARNING (CWE-476): [#def10] liburing-2.13/src/include/liburing.h:1532:9: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’ liburing-2.13/test/bind-listen.c:443:12: enter_function: entry to ‘test_bad_sockname’ liburing-2.13/test/bind-listen.c:459:12: branch_false: following ‘false’ branch (when ‘err >= 0’)... liburing-2.13/test/bind-listen.c:464:16: branch_false: ...to here liburing-2.13/test/bind-listen.c:465:12: branch_false: following ‘false’ branch (when ‘sock >= 0’)... liburing-2.13/test/bind-listen.c:470:15: branch_false: ...to here liburing-2.13/test/bind-listen.c:471:12: branch_false: following ‘false’ branch... liburing-2.13/test/bind-listen.c:479:15: call_function: inlined call to ‘io_uring_get_sqe’ from ‘test_bad_sockname’ liburing-2.13/test/bind-listen.c:479:15: call_function: inlined call to ‘io_uring_get_sqe’ from ‘test_bad_sockname’ liburing-2.13/test/bind-listen.c:481:9: call_function: inlined call to ‘io_uring_prep_cmd_getsockname’ from ‘test_bad_sockname’ # 1530| LIBURING_NOEXCEPT # 1531| { # 1532|-> sqe->opcode = (__u8) op; # 1533| sqe->fd = fd; # 1534| sqe->cmd_op = cmd_op; Error: GCC_ANALYZER_WARNING (CWE-775): [#def11] liburing-2.13/src/include/liburing.h:1691:13: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘open(".short-read", 0)’ liburing-2.13/test/short-read.c:18:5: enter_function: entry to ‘main’ liburing-2.13/test/short-read.c:26:12: branch_false: following ‘false’ branch (when ‘argc <= 1’)... liburing-2.13/test/short-read.c:29:24: branch_false: ...to here liburing-2.13/test/short-read.c:34:14: acquire_resource: opened here liburing-2.13/test/short-read.c:38:12: branch_false: following ‘false’ branch... liburing-2.13/test/short-read.c:43:15: branch_false: ...to here liburing-2.13/test/short-read.c:44:12: branch_false: following ‘false’ branch... liburing-2.13/test/short-read.c:49:15: call_function: inlined call to ‘io_uring_get_sqe’ from ‘main’ liburing-2.13/test/short-read.c:49:15: call_function: inlined call to ‘io_uring_get_sqe’ from ‘main’ liburing-2.13/src/include/liburing.h:1691:13: danger: ‘open(".short-read", 0)’ leaks here; was opened at [(4)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/3) # 1689| * non-SQPOLL since then we drive updates. # 1690| */ # 1691|-> if (ring->flags & IORING_SETUP_SQPOLL) # 1692| return io_uring_smp_load_acquire(ring->sq.khead); # 1693| Error: GCC_ANALYZER_WARNING (CWE-775): [#def12] liburing-2.13/src/include/liburing.h:1691:13: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘open(".sync_file_range", 2)’ liburing-2.13/test/fsync.c:146:12: enter_function: entry to ‘test_sync_file_range’ liburing-2.13/test/fsync.c:154:14: acquire_resource: opened here liburing-2.13/test/fsync.c:158:12: branch_false: following ‘false’ branch... liburing-2.13/test/fsync.c:163:15: call_function: inlined call to ‘io_uring_get_sqe’ from ‘test_sync_file_range’ liburing-2.13/test/fsync.c:163:15: call_function: inlined call to ‘io_uring_get_sqe’ from ‘test_sync_file_range’ liburing-2.13/src/include/liburing.h:1691:13: danger: ‘open(".sync_file_range", 2)’ leaks here; was opened at [(2)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/1) # 1689| * non-SQPOLL since then we drive updates. # 1690| */ # 1691|-> if (ring->flags & IORING_SETUP_SQPOLL) # 1692| return io_uring_smp_load_acquire(ring->sq.khead); # 1693| Error: GCC_ANALYZER_WARNING (CWE-775): [#def13] liburing-2.13/src/include/liburing.h:1691:13: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘open(".test_fpos_read", 0)’ liburing-2.13/test/fpos.c:225:5: enter_function: entry to ‘main’ liburing-2.13/test/fpos.c:230:12: branch_false: following ‘false’ branch (when ‘argc <= 1’)... liburing-2.13/test/fpos.c:233:15: branch_false: ...to here liburing-2.13/test/fpos.c:234:12: branch_false: following ‘false’ branch... liburing-2.13/test/fpos.c:234:12: branch_false: ...to here liburing-2.13/test/fpos.c:239:28: branch_true: following ‘true’ branch (when ‘test != 8’)... liburing-2.13/test/fpos.c:240:21: branch_true: ...to here liburing-2.13/test/fpos.c:242:33: branch_false: following ‘false’ branch... liburing-2.13/test/fpos.c:242:33: branch_false: ...to here liburing-2.13/test/fpos.c:244:23: branch_false: following ‘false’ branch (when ‘write == 0’)... liburing-2.13/test/fpos.c:246:27: branch_false: ...to here liburing-2.13/test/fpos.c:246:27: call_function: calling ‘test_read’ from ‘main’ # 1689| * non-SQPOLL since then we drive updates. # 1690| */ # 1691|-> if (ring->flags & IORING_SETUP_SQPOLL) # 1692| return io_uring_smp_load_acquire(ring->sq.khead); # 1693| Error: GCC_ANALYZER_WARNING (CWE-775): [#def14] liburing-2.13/src/include/liburing.h:1691:13: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘open("/tmp", 65536)’ liburing-2.13/test/lfs-openat-write.c:97:5: enter_function: entry to ‘main’ liburing-2.13/test/lfs-openat-write.c:102:12: branch_false: following ‘false’ branch (when ‘argc <= 1’)... liburing-2.13/test/lfs-openat-write.c:105:15: branch_false: ...to here liburing-2.13/test/lfs-openat-write.c:105:15: acquire_resource: opened here liburing-2.13/test/lfs-openat-write.c:106:12: branch_false: following ‘false’ branch... liburing-2.13/test/lfs-openat-write.c:109:15: branch_false: ...to here liburing-2.13/test/lfs-openat-write.c:110:12: branch_false: following ‘false’ branch... liburing-2.13/test/lfs-openat-write.c:113:15: branch_false: ...to here liburing-2.13/test/lfs-openat-write.c:113:15: call_function: calling ‘test_open_write’ from ‘main’ liburing-2.13/test/lfs-openat-write.c:113:15: return_function: returning to ‘main’ from ‘test_open_write’ liburing-2.13/test/lfs-openat-write.c:115:9: throw: if ‘io_uring_queue_exit’ throws an exception... liburing-2.13/src/include/liburing.h:1691:13: danger: ‘open("/tmp", 65536)’ leaks here; was opened at [(4)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/3) # 1689| * non-SQPOLL since then we drive updates. # 1690| */ # 1691|-> if (ring->flags & IORING_SETUP_SQPOLL) # 1692| return io_uring_smp_load_acquire(ring->sq.khead); # 1693| Error: GCC_ANALYZER_WARNING (CWE-775): [#def15] liburing-2.13/src/include/liburing.h:1691:13: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘open(file, 0)’ liburing-2.13/test/kallsyms.c:167:5: enter_function: entry to ‘main’ liburing-2.13/test/kallsyms.c:171:12: branch_false: following ‘false’ branch (when ‘argc <= 1’)... liburing-2.13/test/kallsyms.c:174:16: branch_false: ...to here liburing-2.13/test/kallsyms.c:177:18: call_function: calling ‘has_nonvec_read’ from ‘main’ liburing-2.13/test/kallsyms.c:177:18: return_function: returning to ‘main’ from ‘has_nonvec_read’ liburing-2.13/test/kallsyms.c:179:12: branch_false: following ‘false’ branch... liburing-2.13/test/kallsyms.c:185:15: branch_false: ...to here liburing-2.13/test/kallsyms.c:185:15: call_function: calling ‘test_io’ from ‘main’ # 1689| * non-SQPOLL since then we drive updates. # 1690| */ # 1691|-> if (ring->flags & IORING_SETUP_SQPOLL) # 1692| return io_uring_smp_load_acquire(ring->sq.khead); # 1693| Error: GCC_ANALYZER_WARNING (CWE-775): [#def16] liburing-2.13/src/include/liburing.h:1691:13: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘open(fname, 16384)’ liburing-2.13/test/sqwait.c:42:5: enter_function: entry to ‘main’ liburing-2.13/test/sqwait.c:63:21: branch_true: following ‘true’ branch (when ‘i != 256’)... liburing-2.13/test/sqwait.c:64:21: branch_true: ...to here liburing-2.13/test/sqwait.c:64:21: branch_true: following ‘true’ branch... liburing-2.13/test/sqwait.c:70:12: branch_false: following ‘false’ branch... liburing-2.13/test/sqwait.c:78:14: branch_false: ...to here liburing-2.13/test/sqwait.c:78:14: acquire_resource: opened here liburing-2.13/test/sqwait.c:79:12: branch_false: following ‘false’ branch... liburing-2.13/test/sqwait.c:79:12: branch_false: ...to here liburing-2.13/test/sqwait.c:88:21: branch_true: following ‘true’ branch (when ‘i != 10000’)... liburing-2.13/test/sqwait.c:91:23: call_function: inlined call to ‘io_uring_get_sqe’ from ‘main’ liburing-2.13/test/sqwait.c:91:23: call_function: inlined call to ‘io_uring_get_sqe’ from ‘main’ liburing-2.13/test/sqwait.c:92:20: branch_true: following ‘true’ branch... liburing-2.13/test/sqwait.c:93:31: branch_true: ...to here liburing-2.13/test/sqwait.c:93:31: call_function: calling ‘io_uring_sqring_wait’ from ‘main’ # 1689| * non-SQPOLL since then we drive updates. # 1690| */ # 1691|-> if (ring->flags & IORING_SETUP_SQPOLL) # 1692| return io_uring_smp_load_acquire(ring->sq.khead); # 1693| Error: GCC_ANALYZER_WARNING (CWE-775): [#def17] liburing-2.13/src/include/liburing.h:1691:13: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘open(path, 0)’ liburing-2.13/test/statx.c:155:12: enter_function: entry to ‘test_statx_fd’ liburing-2.13/test/statx.c:162:14: acquire_resource: opened here liburing-2.13/test/statx.c:163:12: branch_false: following ‘false’ branch... liburing-2.13/test/statx.c:170:9: branch_false: ...to here liburing-2.13/test/statx.c:172:15: call_function: inlined call to ‘io_uring_get_sqe’ from ‘test_statx_fd’ liburing-2.13/test/statx.c:172:15: call_function: inlined call to ‘io_uring_get_sqe’ from ‘test_statx_fd’ liburing-2.13/src/include/liburing.h:1691:13: danger: ‘open(path, 0)’ leaks here; was opened at [(2)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/1) # 1689| * non-SQPOLL since then we drive updates. # 1690| */ # 1691|-> if (ring->flags & IORING_SETUP_SQPOLL) # 1692| return io_uring_smp_load_acquire(ring->sq.khead); # 1693| Error: GCC_ANALYZER_WARNING (CWE-401): [#def18] liburing-2.13/src/include/liburing.h:1821:16: warning[-Wanalyzer-malloc-leak]: leak of ‘test_data’ liburing-2.13/test/recv-inc-ooo.c:253:12: enter_function: entry to ‘test_recv_incr’ liburing-2.13/test/recv-inc-ooo.c:261:12: branch_false: following ‘false’ branch (when ‘ret != 1’)... liburing-2.13/test/recv-inc-ooo.c:263:17: branch_false: ...to here liburing-2.13/test/recv-inc-ooo.c:263:17: branch_false: following ‘false’ branch (when ‘ret == 0’)... liburing-2.13/test/recv-inc-ooo.c:268:15: branch_false: ...to here liburing-2.13/test/recv-inc-ooo.c:268:15: call_function: calling ‘setup_buf_ring’ from ‘test_recv_incr’ liburing-2.13/test/recv-inc-ooo.c:268:15: return_function: returning to ‘test_recv_incr’ from ‘setup_buf_ring’ liburing-2.13/test/recv-inc-ooo.c:269:12: branch_false: following ‘false’ branch... liburing-2.13/test/recv-inc-ooo.c:271:17: branch_false: ...to here liburing-2.13/test/recv-inc-ooo.c:271:17: branch_false: following ‘false’ branch... liburing-2.13/test/recv-inc-ooo.c:276:15: branch_false: ...to here liburing-2.13/test/recv-inc-ooo.c:277:9: branch_true: following ‘true’ branch... liburing-2.13/test/recv-inc-ooo.c:279:13: branch_true: ...to here liburing-2.13/test/recv-inc-ooo.c:285:36: call_function: inlined call to ‘io_uring_get_sqe’ from ‘test_recv_incr’ liburing-2.13/test/recv-inc-ooo.c:285:36: call_function: inlined call to ‘io_uring_get_sqe’ from ‘test_recv_incr’ liburing-2.13/test/recv-inc-ooo.c:296:30: acquire_memory: allocated here liburing-2.13/test/recv-inc-ooo.c:297:25: branch_true: following ‘true’ branch (when ‘i != 2048’)... liburing-2.13/test/recv-inc-ooo.c:298:26: branch_true: ...to here liburing-2.13/test/recv-inc-ooo.c:297:25: branch_true: following ‘true’ branch (when ‘i != 2048’)... liburing-2.13/test/recv-inc-ooo.c:298:26: branch_true: ...to here liburing-2.13/test/recv-inc-ooo.c:310:28: branch_true: following ‘true’ branch (when ‘i != 4’)... liburing-2.13/test/recv-inc-ooo.c:311:24: branch_true: ...to here liburing-2.13/test/recv-inc-ooo.c:317:17: call_function: calling ‘write_all’ from ‘test_recv_incr’ liburing-2.13/test/recv-inc-ooo.c:317:17: return_function: returning to ‘test_recv_incr’ from ‘write_all’ liburing-2.13/test/recv-inc-ooo.c:323:24: branch_true: following ‘true’ branch (when ‘remaining_chunk_len != 0’)... liburing-2.13/test/recv-inc-ooo.c:325:31: branch_true: ...to here liburing-2.13/test/recv-inc-ooo.c:325:31: call_function: calling ‘io_uring_wait_cqe’ from ‘test_recv_incr’ # 1819| LIBURING_NOEXCEPT # 1820| { # 1821|-> return __io_uring_get_cqe(ring, cqe_ptr, 0, wait_nr, NULL); # 1822| } # 1823| Error: CPPCHECK_WARNING (CWE-909): [#def19] liburing-2.13/test/bind-listen.c:134: error[uninitStructMember]: Uninitialized struct member: cqe.res # 132| close(fd); # 133| } else if (res < 0) { # 134|-> fprintf(stderr, "getsockname server failed. %d\n", cqe->res); # 135| return T_EXIT_FAIL; # 136| } Error: GCC_ANALYZER_WARNING (CWE-775): [#def20] liburing-2.13/test/bind-listen.c:470:15: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘sock’ liburing-2.13/test/bind-listen.c:459:12: branch_false: following ‘false’ branch (when ‘err >= 0’)... liburing-2.13/test/bind-listen.c:464:16: branch_false: ...to here liburing-2.13/test/bind-listen.c:464:16: acquire_resource: stream socket created here liburing-2.13/test/bind-listen.c:465:12: branch_false: following ‘false’ branch (when ‘sock >= 0’)... liburing-2.13/test/bind-listen.c:470:15: branch_false: ...to here liburing-2.13/test/bind-listen.c:470:15: throw: if ‘t_bind_ephemeral_port’ throws an exception... liburing-2.13/test/bind-listen.c:470:15: danger: ‘sock’ leaks here # 468| } # 469| # 470|-> err = t_bind_ephemeral_port(sock, &saddr); # 471| if (err) { # 472| fprintf(stderr, "bind: %s\n", strerror(-err)); Error: GCC_ANALYZER_WARNING (CWE-775): [#def21] liburing-2.13/test/epwait.c:248:24: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘d.pipes[0][0]’ liburing-2.13/test/epwait.c:247:12: branch_false: following ‘false’ branch (when ‘ret != 1’)... liburing-2.13/test/epwait.c:249:19: branch_false: ...to here liburing-2.13/test/epwait.c:249:19: branch_false: following ‘false’ branch (when ‘ret == 0’)... liburing-2.13/test/epwait.c:249:19: branch_false: ...to here liburing-2.13/test/epwait.c:254:21: branch_true: following ‘true’ branch (when ‘i != 8’)... liburing-2.13/test/epwait.c:255:26: branch_true: ...to here liburing-2.13/test/epwait.c:255:20: branch_false: following ‘false’ branch... liburing-2.13/test/epwait.c:254:33: branch_false: ...to here liburing-2.13/test/epwait.c:254:21: branch_true: following ‘true’ branch (when ‘i != 8’)... liburing-2.13/test/epwait.c:255:26: branch_true: ...to here liburing-2.13/test/epwait.c:255:20: branch_true: following ‘true’ branch... liburing-2.13/test/epwait.c:256:25: branch_true: ...to here liburing-2.13/test/epwait.c:248:24: danger: ‘d.pipes[0][0]’ leaks here # 246| ret = t_create_ring(32, &ring, flags); # 247| if (ret == T_SETUP_SKIP) { # 248|-> return 0; # 249| } else if (ret != T_SETUP_OK) { # 250| fprintf(stderr, "ring create failed %x -> %d\n", flags, ret); Error: GCC_ANALYZER_WARNING (CWE-775): [#def22] liburing-2.13/test/epwait.c:248:24: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘d.pipes[0][1]’ liburing-2.13/test/epwait.c:247:12: branch_false: following ‘false’ branch (when ‘ret != 1’)... liburing-2.13/test/epwait.c:249:19: branch_false: ...to here liburing-2.13/test/epwait.c:249:19: branch_false: following ‘false’ branch (when ‘ret == 0’)... liburing-2.13/test/epwait.c:249:19: branch_false: ...to here liburing-2.13/test/epwait.c:254:21: branch_true: following ‘true’ branch (when ‘i != 8’)... liburing-2.13/test/epwait.c:255:26: branch_true: ...to here liburing-2.13/test/epwait.c:255:20: branch_false: following ‘false’ branch... liburing-2.13/test/epwait.c:254:33: branch_false: ...to here liburing-2.13/test/epwait.c:254:21: branch_true: following ‘true’ branch (when ‘i != 8’)... liburing-2.13/test/epwait.c:255:26: branch_true: ...to here liburing-2.13/test/epwait.c:255:20: branch_true: following ‘true’ branch... liburing-2.13/test/epwait.c:256:25: branch_true: ...to here liburing-2.13/test/epwait.c:248:24: danger: ‘d.pipes[0][1]’ leaks here # 246| ret = t_create_ring(32, &ring, flags); # 247| if (ret == T_SETUP_SKIP) { # 248|-> return 0; # 249| } else if (ret != T_SETUP_OK) { # 250| fprintf(stderr, "ring create failed %x -> %d\n", flags, ret); Error: GCC_ANALYZER_WARNING (CWE-775): [#def23] liburing-2.13/test/epwait.c:248:24: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘d.pipes[1][0]’ liburing-2.13/test/epwait.c:247:12: branch_false: following ‘false’ branch (when ‘ret != 1’)... liburing-2.13/test/epwait.c:249:19: branch_false: ...to here liburing-2.13/test/epwait.c:249:19: branch_false: following ‘false’ branch (when ‘ret == 0’)... liburing-2.13/test/epwait.c:249:19: branch_false: ...to here liburing-2.13/test/epwait.c:254:21: branch_true: following ‘true’ branch (when ‘i != 8’)... liburing-2.13/test/epwait.c:255:26: branch_true: ...to here liburing-2.13/test/epwait.c:255:20: branch_false: following ‘false’ branch... liburing-2.13/test/epwait.c:254:33: branch_false: ...to here liburing-2.13/test/epwait.c:254:21: branch_true: following ‘true’ branch (when ‘i != 8’)... liburing-2.13/test/epwait.c:255:26: branch_true: ...to here liburing-2.13/test/epwait.c:255:20: branch_false: following ‘false’ branch... liburing-2.13/test/epwait.c:254:33: branch_false: ...to here liburing-2.13/test/epwait.c:254:21: branch_true: following ‘true’ branch (when ‘i != 8’)... liburing-2.13/test/epwait.c:255:26: branch_true: ...to here liburing-2.13/test/epwait.c:255:20: branch_true: following ‘true’ branch... liburing-2.13/test/epwait.c:256:25: branch_true: ...to here liburing-2.13/test/epwait.c:248:24: danger: ‘d.pipes[1][0]’ leaks here # 246| ret = t_create_ring(32, &ring, flags); # 247| if (ret == T_SETUP_SKIP) { # 248|-> return 0; # 249| } else if (ret != T_SETUP_OK) { # 250| fprintf(stderr, "ring create failed %x -> %d\n", flags, ret); Error: GCC_ANALYZER_WARNING (CWE-775): [#def24] liburing-2.13/test/epwait.c:248:24: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘d.pipes[1][1]’ liburing-2.13/test/epwait.c:247:12: branch_false: following ‘false’ branch (when ‘ret != 1’)... liburing-2.13/test/epwait.c:249:19: branch_false: ...to here liburing-2.13/test/epwait.c:249:19: branch_false: following ‘false’ branch (when ‘ret == 0’)... liburing-2.13/test/epwait.c:249:19: branch_false: ...to here liburing-2.13/test/epwait.c:254:21: branch_true: following ‘true’ branch (when ‘i != 8’)... liburing-2.13/test/epwait.c:255:26: branch_true: ...to here liburing-2.13/test/epwait.c:255:20: branch_false: following ‘false’ branch... liburing-2.13/test/epwait.c:254:33: branch_false: ...to here liburing-2.13/test/epwait.c:254:21: branch_true: following ‘true’ branch (when ‘i != 8’)... liburing-2.13/test/epwait.c:255:26: branch_true: ...to here liburing-2.13/test/epwait.c:255:20: branch_false: following ‘false’ branch... liburing-2.13/test/epwait.c:254:33: branch_false: ...to here liburing-2.13/test/epwait.c:254:21: branch_true: following ‘true’ branch (when ‘i != 8’)... liburing-2.13/test/epwait.c:255:26: branch_true: ...to here liburing-2.13/test/epwait.c:255:20: branch_true: following ‘true’ branch... liburing-2.13/test/epwait.c:256:25: branch_true: ...to here liburing-2.13/test/epwait.c:248:24: danger: ‘d.pipes[1][1]’ leaks here # 246| ret = t_create_ring(32, &ring, flags); # 247| if (ret == T_SETUP_SKIP) { # 248|-> return 0; # 249| } else if (ret != T_SETUP_OK) { # 250| fprintf(stderr, "ring create failed %x -> %d\n", flags, ret); Error: GCC_ANALYZER_WARNING (CWE-775): [#def25] liburing-2.13/test/epwait.c:248:24: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘d.pipes[2][0]’ liburing-2.13/test/epwait.c:247:12: branch_false: following ‘false’ branch (when ‘ret != 1’)... liburing-2.13/test/epwait.c:249:19: branch_false: ...to here liburing-2.13/test/epwait.c:249:19: branch_false: following ‘false’ branch (when ‘ret == 0’)... liburing-2.13/test/epwait.c:249:19: branch_false: ...to here liburing-2.13/test/epwait.c:254:21: branch_true: following ‘true’ branch (when ‘i != 8’)... liburing-2.13/test/epwait.c:255:26: branch_true: ...to here liburing-2.13/test/epwait.c:255:20: branch_false: following ‘false’ branch... liburing-2.13/test/epwait.c:254:33: branch_false: ...to here liburing-2.13/test/epwait.c:254:21: branch_true: following ‘true’ branch (when ‘i != 8’)... liburing-2.13/test/epwait.c:255:26: branch_true: ...to here liburing-2.13/test/epwait.c:255:20: branch_false: following ‘false’ branch... liburing-2.13/test/epwait.c:254:33: branch_false: ...to here liburing-2.13/test/epwait.c:254:21: branch_true: following ‘true’ branch (when ‘i != 8’)... liburing-2.13/test/epwait.c:255:26: branch_true: ...to here liburing-2.13/test/epwait.c:255:20: branch_false: following ‘false’ branch... liburing-2.13/test/epwait.c:254:33: branch_false: ...to here liburing-2.13/test/epwait.c:254:21: branch_true: following ‘true’ branch (when ‘i != 8’)... liburing-2.13/test/epwait.c:255:26: branch_true: ...to here liburing-2.13/test/epwait.c:255:20: branch_true: following ‘true’ branch... liburing-2.13/test/epwait.c:256:25: branch_true: ...to here liburing-2.13/test/epwait.c:248:24: danger: ‘d.pipes[2][0]’ leaks here # 246| ret = t_create_ring(32, &ring, flags); # 247| if (ret == T_SETUP_SKIP) { # 248|-> return 0; # 249| } else if (ret != T_SETUP_OK) { # 250| fprintf(stderr, "ring create failed %x -> %d\n", flags, ret); Error: GCC_ANALYZER_WARNING (CWE-775): [#def26] liburing-2.13/test/epwait.c:248:24: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘d.pipes[2][1]’ liburing-2.13/test/epwait.c:247:12: branch_false: following ‘false’ branch (when ‘ret != 1’)... liburing-2.13/test/epwait.c:249:19: branch_false: ...to here liburing-2.13/test/epwait.c:249:19: branch_false: following ‘false’ branch (when ‘ret == 0’)... liburing-2.13/test/epwait.c:249:19: branch_false: ...to here liburing-2.13/test/epwait.c:254:21: branch_true: following ‘true’ branch (when ‘i != 8’)... liburing-2.13/test/epwait.c:255:26: branch_true: ...to here liburing-2.13/test/epwait.c:255:20: branch_false: following ‘false’ branch... liburing-2.13/test/epwait.c:254:33: branch_false: ...to here liburing-2.13/test/epwait.c:254:21: branch_true: following ‘true’ branch (when ‘i != 8’)... liburing-2.13/test/epwait.c:255:26: branch_true: ...to here liburing-2.13/test/epwait.c:255:20: branch_false: following ‘false’ branch... liburing-2.13/test/epwait.c:254:33: branch_false: ...to here liburing-2.13/test/epwait.c:254:21: branch_true: following ‘true’ branch (when ‘i != 8’)... liburing-2.13/test/epwait.c:255:26: branch_true: ...to here liburing-2.13/test/epwait.c:255:20: branch_false: following ‘false’ branch... liburing-2.13/test/epwait.c:254:33: branch_false: ...to here liburing-2.13/test/epwait.c:254:21: branch_true: following ‘true’ branch (when ‘i != 8’)... liburing-2.13/test/epwait.c:255:26: branch_true: ...to here liburing-2.13/test/epwait.c:255:20: branch_true: following ‘true’ branch... liburing-2.13/test/epwait.c:256:25: branch_true: ...to here liburing-2.13/test/epwait.c:248:24: danger: ‘d.pipes[2][1]’ leaks here # 246| ret = t_create_ring(32, &ring, flags); # 247| if (ret == T_SETUP_SKIP) { # 248|-> return 0; # 249| } else if (ret != T_SETUP_OK) { # 250| fprintf(stderr, "ring create failed %x -> %d\n", flags, ret); Error: GCC_ANALYZER_WARNING (CWE-775): [#def27] liburing-2.13/test/epwait.c:256:25: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘d.pipes[0][0]’ liburing-2.13/test/epwait.c:247:12: branch_false: following ‘false’ branch (when ‘ret != 1’)... liburing-2.13/test/epwait.c:249:19: branch_false: ...to here liburing-2.13/test/epwait.c:249:19: branch_false: following ‘false’ branch (when ‘ret == 0’)... liburing-2.13/test/epwait.c:249:19: branch_false: ...to here liburing-2.13/test/epwait.c:254:21: branch_true: following ‘true’ branch (when ‘i != 8’)... liburing-2.13/test/epwait.c:255:26: branch_true: ...to here liburing-2.13/test/epwait.c:255:20: branch_false: following ‘false’ branch... liburing-2.13/test/epwait.c:254:33: branch_false: ...to here liburing-2.13/test/epwait.c:254:21: branch_true: following ‘true’ branch (when ‘i != 8’)... liburing-2.13/test/epwait.c:255:26: branch_true: ...to here liburing-2.13/test/epwait.c:255:20: branch_true: following ‘true’ branch... liburing-2.13/test/epwait.c:256:25: branch_true: ...to here liburing-2.13/test/epwait.c:256:25: throw: if ‘perror’ throws an exception... liburing-2.13/test/epwait.c:256:25: danger: ‘d.pipes[0][0]’ leaks here # 254| for (i = 0; i < NPIPES; i++) { # 255| if (pipe(d.pipes[i]) < 0) { # 256|-> perror("pipe"); # 257| return 1; # 258| } Error: GCC_ANALYZER_WARNING (CWE-775): [#def28] liburing-2.13/test/epwait.c:256:25: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘d.pipes[0][1]’ liburing-2.13/test/epwait.c:247:12: branch_false: following ‘false’ branch (when ‘ret != 1’)... liburing-2.13/test/epwait.c:249:19: branch_false: ...to here liburing-2.13/test/epwait.c:249:19: branch_false: following ‘false’ branch (when ‘ret == 0’)... liburing-2.13/test/epwait.c:249:19: branch_false: ...to here liburing-2.13/test/epwait.c:254:21: branch_true: following ‘true’ branch (when ‘i != 8’)... liburing-2.13/test/epwait.c:255:26: branch_true: ...to here liburing-2.13/test/epwait.c:255:20: branch_false: following ‘false’ branch... liburing-2.13/test/epwait.c:254:33: branch_false: ...to here liburing-2.13/test/epwait.c:254:21: branch_true: following ‘true’ branch (when ‘i != 8’)... liburing-2.13/test/epwait.c:255:26: branch_true: ...to here liburing-2.13/test/epwait.c:255:20: branch_true: following ‘true’ branch... liburing-2.13/test/epwait.c:256:25: branch_true: ...to here liburing-2.13/test/epwait.c:256:25: throw: if ‘perror’ throws an exception... liburing-2.13/test/epwait.c:256:25: danger: ‘d.pipes[0][1]’ leaks here # 254| for (i = 0; i < NPIPES; i++) { # 255| if (pipe(d.pipes[i]) < 0) { # 256|-> perror("pipe"); # 257| return 1; # 258| } Error: GCC_ANALYZER_WARNING (CWE-775): [#def29] liburing-2.13/test/epwait.c:256:25: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘d.pipes[1][0]’ liburing-2.13/test/epwait.c:247:12: branch_false: following ‘false’ branch (when ‘ret != 1’)... liburing-2.13/test/epwait.c:249:19: branch_false: ...to here liburing-2.13/test/epwait.c:249:19: branch_false: following ‘false’ branch (when ‘ret == 0’)... liburing-2.13/test/epwait.c:249:19: branch_false: ...to here liburing-2.13/test/epwait.c:254:21: branch_true: following ‘true’ branch (when ‘i != 8’)... liburing-2.13/test/epwait.c:255:26: branch_true: ...to here liburing-2.13/test/epwait.c:255:20: branch_false: following ‘false’ branch... liburing-2.13/test/epwait.c:254:33: branch_false: ...to here liburing-2.13/test/epwait.c:254:21: branch_true: following ‘true’ branch (when ‘i != 8’)... liburing-2.13/test/epwait.c:255:26: branch_true: ...to here liburing-2.13/test/epwait.c:255:20: branch_false: following ‘false’ branch... liburing-2.13/test/epwait.c:254:33: branch_false: ...to here liburing-2.13/test/epwait.c:254:21: branch_true: following ‘true’ branch (when ‘i != 8’)... liburing-2.13/test/epwait.c:255:26: branch_true: ...to here liburing-2.13/test/epwait.c:255:20: branch_true: following ‘true’ branch... liburing-2.13/test/epwait.c:256:25: branch_true: ...to here liburing-2.13/test/epwait.c:256:25: throw: if ‘perror’ throws an exception... liburing-2.13/test/epwait.c:256:25: danger: ‘d.pipes[1][0]’ leaks here # 254| for (i = 0; i < NPIPES; i++) { # 255| if (pipe(d.pipes[i]) < 0) { # 256|-> perror("pipe"); # 257| return 1; # 258| } Error: GCC_ANALYZER_WARNING (CWE-775): [#def30] liburing-2.13/test/epwait.c:256:25: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘d.pipes[1][1]’ liburing-2.13/test/epwait.c:247:12: branch_false: following ‘false’ branch (when ‘ret != 1’)... liburing-2.13/test/epwait.c:249:19: branch_false: ...to here liburing-2.13/test/epwait.c:249:19: branch_false: following ‘false’ branch (when ‘ret == 0’)... liburing-2.13/test/epwait.c:249:19: branch_false: ...to here liburing-2.13/test/epwait.c:254:21: branch_true: following ‘true’ branch (when ‘i != 8’)... liburing-2.13/test/epwait.c:255:26: branch_true: ...to here liburing-2.13/test/epwait.c:255:20: branch_false: following ‘false’ branch... liburing-2.13/test/epwait.c:254:33: branch_false: ...to here liburing-2.13/test/epwait.c:254:21: branch_true: following ‘true’ branch (when ‘i != 8’)... liburing-2.13/test/epwait.c:255:26: branch_true: ...to here liburing-2.13/test/epwait.c:255:20: branch_false: following ‘false’ branch... liburing-2.13/test/epwait.c:254:33: branch_false: ...to here liburing-2.13/test/epwait.c:254:21: branch_true: following ‘true’ branch (when ‘i != 8’)... liburing-2.13/test/epwait.c:255:26: branch_true: ...to here liburing-2.13/test/epwait.c:255:20: branch_true: following ‘true’ branch... liburing-2.13/test/epwait.c:256:25: branch_true: ...to here liburing-2.13/test/epwait.c:256:25: throw: if ‘perror’ throws an exception... liburing-2.13/test/epwait.c:256:25: danger: ‘d.pipes[1][1]’ leaks here # 254| for (i = 0; i < NPIPES; i++) { # 255| if (pipe(d.pipes[i]) < 0) { # 256|-> perror("pipe"); # 257| return 1; # 258| } Error: GCC_ANALYZER_WARNING (CWE-775): [#def31] liburing-2.13/test/epwait.c:256:25: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘d.pipes[2][0]’ liburing-2.13/test/epwait.c:247:12: branch_false: following ‘false’ branch (when ‘ret != 1’)... liburing-2.13/test/epwait.c:249:19: branch_false: ...to here liburing-2.13/test/epwait.c:249:19: branch_false: following ‘false’ branch (when ‘ret == 0’)... liburing-2.13/test/epwait.c:249:19: branch_false: ...to here liburing-2.13/test/epwait.c:254:21: branch_true: following ‘true’ branch (when ‘i != 8’)... liburing-2.13/test/epwait.c:255:26: branch_true: ...to here liburing-2.13/test/epwait.c:255:20: branch_false: following ‘false’ branch... liburing-2.13/test/epwait.c:254:33: branch_false: ...to here liburing-2.13/test/epwait.c:254:21: branch_true: following ‘true’ branch (when ‘i != 8’)... liburing-2.13/test/epwait.c:255:26: branch_true: ...to here liburing-2.13/test/epwait.c:255:20: branch_false: following ‘false’ branch... liburing-2.13/test/epwait.c:254:33: branch_false: ...to here liburing-2.13/test/epwait.c:254:21: branch_true: following ‘true’ branch (when ‘i != 8’)... liburing-2.13/test/epwait.c:255:26: branch_true: ...to here liburing-2.13/test/epwait.c:255:20: branch_false: following ‘false’ branch... liburing-2.13/test/epwait.c:254:33: branch_false: ...to here liburing-2.13/test/epwait.c:254:21: branch_true: following ‘true’ branch (when ‘i != 8’)... liburing-2.13/test/epwait.c:255:26: branch_true: ...to here liburing-2.13/test/epwait.c:255:20: branch_true: following ‘true’ branch... liburing-2.13/test/epwait.c:256:25: branch_true: ...to here liburing-2.13/test/epwait.c:256:25: throw: if ‘perror’ throws an exception... liburing-2.13/test/epwait.c:256:25: danger: ‘d.pipes[2][0]’ leaks here # 254| for (i = 0; i < NPIPES; i++) { # 255| if (pipe(d.pipes[i]) < 0) { # 256|-> perror("pipe"); # 257| return 1; # 258| } Error: GCC_ANALYZER_WARNING (CWE-775): [#def32] liburing-2.13/test/epwait.c:256:25: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘d.pipes[2][1]’ liburing-2.13/test/epwait.c:247:12: branch_false: following ‘false’ branch (when ‘ret != 1’)... liburing-2.13/test/epwait.c:249:19: branch_false: ...to here liburing-2.13/test/epwait.c:249:19: branch_false: following ‘false’ branch (when ‘ret == 0’)... liburing-2.13/test/epwait.c:249:19: branch_false: ...to here liburing-2.13/test/epwait.c:254:21: branch_true: following ‘true’ branch (when ‘i != 8’)... liburing-2.13/test/epwait.c:255:26: branch_true: ...to here liburing-2.13/test/epwait.c:255:20: branch_false: following ‘false’ branch... liburing-2.13/test/epwait.c:254:33: branch_false: ...to here liburing-2.13/test/epwait.c:254:21: branch_true: following ‘true’ branch (when ‘i != 8’)... liburing-2.13/test/epwait.c:255:26: branch_true: ...to here liburing-2.13/test/epwait.c:255:20: branch_false: following ‘false’ branch... liburing-2.13/test/epwait.c:254:33: branch_false: ...to here liburing-2.13/test/epwait.c:254:21: branch_true: following ‘true’ branch (when ‘i != 8’)... liburing-2.13/test/epwait.c:255:26: branch_true: ...to here liburing-2.13/test/epwait.c:255:20: branch_false: following ‘false’ branch... liburing-2.13/test/epwait.c:254:33: branch_false: ...to here liburing-2.13/test/epwait.c:254:21: branch_true: following ‘true’ branch (when ‘i != 8’)... liburing-2.13/test/epwait.c:255:26: branch_true: ...to here liburing-2.13/test/epwait.c:255:20: branch_true: following ‘true’ branch... liburing-2.13/test/epwait.c:256:25: branch_true: ...to here liburing-2.13/test/epwait.c:256:25: throw: if ‘perror’ throws an exception... liburing-2.13/test/epwait.c:256:25: danger: ‘d.pipes[2][1]’ leaks here # 254| for (i = 0; i < NPIPES; i++) { # 255| if (pipe(d.pipes[i]) < 0) { # 256|-> perror("pipe"); # 257| return 1; # 258| } Error: GCC_ANALYZER_WARNING (CWE-401): [#def33] liburing-2.13/test/fdinfo-sqpoll.c:39:14: warning[-Wanalyzer-malloc-leak]: leak of ‘buf’ liburing-2.13/test/fdinfo-sqpoll.c:36:15: acquire_memory: allocated here liburing-2.13/test/fdinfo-sqpoll.c:39:14: throw: if ‘open’ throws an exception... liburing-2.13/test/fdinfo-sqpoll.c:39:14: danger: ‘buf’ leaks here; was allocated at [(1)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/0) # 37| # 38| sprintf(fd_name, "/proc/self/fdinfo/%d", d->ring.ring_fd); # 39|-> fd = open(fd_name, O_RDONLY); # 40| if (fd < 0) { # 41| perror("open"); Error: GCC_ANALYZER_WARNING (CWE-401): [#def34] liburing-2.13/test/fdinfo-sqpoll.c:41:17: warning[-Wanalyzer-malloc-leak]: leak of ‘buf’ liburing-2.13/test/fdinfo-sqpoll.c:36:15: acquire_memory: allocated here liburing-2.13/test/fdinfo-sqpoll.c:40:12: branch_true: following ‘true’ branch... liburing-2.13/test/fdinfo-sqpoll.c:41:17: branch_true: ...to here liburing-2.13/test/fdinfo-sqpoll.c:41:17: throw: if ‘perror’ throws an exception... liburing-2.13/test/fdinfo-sqpoll.c:41:17: danger: ‘buf’ leaks here; was allocated at [(1)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/0) # 39| fd = open(fd_name, O_RDONLY); # 40| if (fd < 0) { # 41|-> perror("open"); # 42| return NULL; # 43| } Error: CPPCHECK_WARNING (CWE-401): [#def35] liburing-2.13/test/fdinfo-sqpoll.c:42: error[memleak]: Memory leak: buf # 40| if (fd < 0) { # 41| perror("open"); # 42|-> return NULL; # 43| } # 44| Error: GCC_ANALYZER_WARNING (CWE-775): [#def36] liburing-2.13/test/fdinfo-sqpoll.c:45:9: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘open(&fd_name, 0)’ liburing-2.13/test/fdinfo-sqpoll.c:39:14: acquire_resource: opened here liburing-2.13/test/fdinfo-sqpoll.c:40:12: branch_false: following ‘false’ branch... liburing-2.13/test/fdinfo-sqpoll.c:45:9: branch_false: ...to here liburing-2.13/test/fdinfo-sqpoll.c:51:25: throw: if ‘perror’ throws an exception... liburing-2.13/test/fdinfo-sqpoll.c:45:9: danger: ‘open(&fd_name, 0)’ leaks here; was opened at [(1)](sarif:/runs/0/results/2/codeFlows/0/threadFlows/0/locations/0) # 43| } # 44| # 45|-> pthread_barrier_wait(&d->barrier); # 46| # 47| do { Error: GCC_ANALYZER_WARNING (CWE-401): [#def37] liburing-2.13/test/fdinfo-sqpoll.c:51:25: warning[-Wanalyzer-malloc-leak]: leak of ‘buf’ liburing-2.13/test/fdinfo-sqpoll.c:36:15: acquire_memory: allocated here liburing-2.13/test/fdinfo-sqpoll.c:40:12: branch_false: following ‘false’ branch... liburing-2.13/test/fdinfo-sqpoll.c:45:9: branch_false: ...to here liburing-2.13/test/fdinfo-sqpoll.c:51:25: throw: if ‘perror’ throws an exception... liburing-2.13/test/fdinfo-sqpoll.c:51:25: danger: ‘buf’ leaks here; was allocated at [(1)](sarif:/runs/0/results/4/codeFlows/0/threadFlows/0/locations/0) # 49| # 50| if (ret < 0) { # 51|-> perror("fdinfo read"); # 52| break; # 53| } Error: GCC_ANALYZER_WARNING (CWE-401): [#def38] liburing-2.13/test/fdinfo-sqpoll.c:56:9: warning[-Wanalyzer-malloc-leak]: leak of ‘buf’ liburing-2.13/test/fdinfo-sqpoll.c:36:15: acquire_memory: allocated here liburing-2.13/test/fdinfo-sqpoll.c:40:12: branch_false: following ‘false’ branch... liburing-2.13/test/fdinfo-sqpoll.c:45:9: branch_false: ...to here liburing-2.13/test/fdinfo-sqpoll.c:56:9: throw: if ‘close’ throws an exception... liburing-2.13/test/fdinfo-sqpoll.c:56:9: danger: ‘buf’ leaks here; was allocated at [(1)](sarif:/runs/0/results/5/codeFlows/0/threadFlows/0/locations/0) # 54| } while (!d->done); # 55| # 56|-> close(fd); # 57| free(buf); # 58| return NULL; Error: GCC_ANALYZER_WARNING (CWE-401): [#def39] liburing-2.13/test/fdinfo-sqpoll.c:59:1: warning[-Wanalyzer-malloc-leak]: leak of ‘buf’ liburing-2.13/test/fdinfo-sqpoll.c:36:15: acquire_memory: allocated here liburing-2.13/test/fdinfo-sqpoll.c:40:12: branch_true: following ‘true’ branch... liburing-2.13/test/fdinfo-sqpoll.c:41:17: branch_true: ...to here liburing-2.13/test/fdinfo-sqpoll.c:59:1: danger: ‘buf’ leaks here; was allocated at [(1)](sarif:/runs/0/results/6/codeFlows/0/threadFlows/0/locations/0) # 57| free(buf); # 58| return NULL; # 59|-> } # 60| # 61| static int __test(void) Error: GCC_ANALYZER_WARNING (CWE-775): [#def40] liburing-2.13/test/fifo-futex-poll.c:47:15: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘pipe’ liburing-2.13/test/fifo-futex-poll.c:27:12: branch_false: following ‘false’ branch (when ‘argc <= 1’)... liburing-2.13/test/fifo-futex-poll.c:35:15: branch_false: ...to here liburing-2.13/test/fifo-futex-poll.c:36:12: branch_false: following ‘false’ branch (when ‘ret >= 0’)... liburing-2.13/test/fifo-futex-poll.c:40:16: branch_false: ...to here liburing-2.13/test/fifo-futex-poll.c:40:16: acquire_resource: opened here liburing-2.13/test/fifo-futex-poll.c:41:12: branch_false: following ‘false’ branch... liburing-2.13/test/fifo-futex-poll.c:47:15: branch_false: ...to here liburing-2.13/test/fifo-futex-poll.c:47:15: throw: if ‘io_uring_queue_init’ throws an exception... liburing-2.13/test/fifo-futex-poll.c:47:15: danger: ‘pipe’ leaks here; was opened at [(5)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/4) # 45| } # 46| # 47|-> ret = io_uring_queue_init(64, &ring, 0); # 48| if (ret) { # 49| ret = T_EXIT_FAIL; Error: GCC_ANALYZER_WARNING (CWE-775): [#def41] liburing-2.13/test/fifo-futex-poll.c:111:17: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘pipe’ liburing-2.13/test/fifo-futex-poll.c:27:12: branch_false: following ‘false’ branch (when ‘argc <= 1’)... liburing-2.13/test/fifo-futex-poll.c:35:15: branch_false: ...to here liburing-2.13/test/fifo-futex-poll.c:36:12: branch_false: following ‘false’ branch (when ‘ret >= 0’)... liburing-2.13/test/fifo-futex-poll.c:40:16: branch_false: ...to here liburing-2.13/test/fifo-futex-poll.c:40:16: acquire_resource: opened here liburing-2.13/test/fifo-futex-poll.c:41:12: branch_false: following ‘false’ branch... liburing-2.13/test/fifo-futex-poll.c:47:15: branch_false: ...to here liburing-2.13/test/fifo-futex-poll.c:48:12: branch_true: following ‘true’ branch... liburing-2.13/test/fifo-futex-poll.c:50:17: branch_true: ...to here liburing-2.13/test/fifo-futex-poll.c:110:12: branch_true: following ‘true’ branch... liburing-2.13/test/fifo-futex-poll.c:111:17: branch_true: ...to here liburing-2.13/test/fifo-futex-poll.c:111:17: throw: if ‘close’ throws an exception... liburing-2.13/test/fifo-futex-poll.c:111:17: danger: ‘pipe’ leaks here; was opened at [(5)](sarif:/runs/0/results/2/codeFlows/0/threadFlows/0/locations/4) # 109| err: # 110| if (pipe != -1) # 111|-> close(pipe); # 112| unlink("fifo"); # 113| return ret; Error: GCC_ANALYZER_WARNING (CWE-775): [#def42] liburing-2.13/test/fifo-nonblock-read.c:30:9: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘fds[0]’ liburing-2.13/test/fifo-nonblock-read.c:25:12: branch_false: following ‘false’ branch... liburing-2.13/test/fifo-nonblock-read.c:30:9: branch_false: ...to here liburing-2.13/test/fifo-nonblock-read.c:30:9: throw: if ‘t_set_nonblock’ throws an exception... liburing-2.13/test/fifo-nonblock-read.c:30:9: danger: ‘fds[0]’ leaks here # 28| } # 29| # 30|-> t_set_nonblock(fds[0]); # 31| # 32| sqe = io_uring_get_sqe(&ring); Error: GCC_ANALYZER_WARNING (CWE-775): [#def43] liburing-2.13/test/fifo-nonblock-read.c:30:9: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘fds[1]’ liburing-2.13/test/fifo-nonblock-read.c:25:12: branch_false: following ‘false’ branch... liburing-2.13/test/fifo-nonblock-read.c:30:9: branch_false: ...to here liburing-2.13/test/fifo-nonblock-read.c:30:9: throw: if ‘t_set_nonblock’ throws an exception... liburing-2.13/test/fifo-nonblock-read.c:30:9: danger: ‘fds[1]’ leaks here # 28| } # 29| # 30|-> t_set_nonblock(fds[0]); # 31| # 32| sqe = io_uring_get_sqe(&ring); Error: GCC_ANALYZER_WARNING (CWE-775): [#def44] liburing-2.13/test/file-register.c:832:15: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘fds[0]’ liburing-2.13/test/file-register.c:814:12: branch_false: following ‘false’ branch... liburing-2.13/test/file-register.c:818:13: branch_false: ...to here liburing-2.13/test/file-register.c:818:12: branch_false: following ‘false’ branch... liburing-2.13/test/file-register.c:827:22: branch_false: ...to here liburing-2.13/test/file-register.c:832:15: throw: if ‘io_uring_register_files’ throws an exception... liburing-2.13/test/file-register.c:832:15: danger: ‘fds[0]’ leaks here # 830| reg_fds[3] = ring.ring_fd; # 831| reg_fds[4] = -1; # 832|-> ret = io_uring_register_files(&ring, reg_fds, 5); # 833| if (!ret) { # 834| fprintf(stderr, "file_register unexpectedly succeeded\n"); Error: GCC_ANALYZER_WARNING (CWE-775): [#def45] liburing-2.13/test/file-register.c:832:15: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘fds[1]’ liburing-2.13/test/file-register.c:814:12: branch_false: following ‘false’ branch... liburing-2.13/test/file-register.c:818:13: branch_false: ...to here liburing-2.13/test/file-register.c:818:12: branch_false: following ‘false’ branch... liburing-2.13/test/file-register.c:827:22: branch_false: ...to here liburing-2.13/test/file-register.c:832:15: throw: if ‘io_uring_register_files’ throws an exception... liburing-2.13/test/file-register.c:832:15: danger: ‘fds[1]’ leaks here # 830| reg_fds[3] = ring.ring_fd; # 831| reg_fds[4] = -1; # 832|-> ret = io_uring_register_files(&ring, reg_fds, 5); # 833| if (!ret) { # 834| fprintf(stderr, "file_register unexpectedly succeeded\n"); Error: GCC_ANALYZER_WARNING (CWE-775): [#def46] liburing-2.13/test/fixed-seg.c:135:13: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘open("/dev/urandom", 0)’ liburing-2.13/test/fixed-seg.c:117:12: branch_false: following ‘false’ branch... liburing-2.13/test/fixed-seg.c:121:15: branch_false: ...to here liburing-2.13/test/fixed-seg.c:124:12: branch_true: following ‘true’ branch... liburing-2.13/test/fixed-seg.c:124:20: branch_true: ...to here liburing-2.13/test/fixed-seg.c:124:13: branch_false: following ‘false’ branch... liburing-2.13/test/fixed-seg.c:129:18: branch_false: ...to here liburing-2.13/test/fixed-seg.c:129:18: acquire_resource: opened here liburing-2.13/test/fixed-seg.c:135:13: danger: ‘open("/dev/urandom", 0)’ leaks here; was opened at [(7)](sarif:/runs/0/results/2/codeFlows/0/threadFlows/0/locations/6) # 133| } # 134| # 135|-> if (posix_memalign(&wvec.iov_base, 4096, 512*1024)) # 136| goto err; # 137| wvec.iov_len = 512*1024; Error: GCC_ANALYZER_WARNING: [#def47] liburing-2.13/test/fixed-seg.c:139:15: warning[-Wanalyzer-fd-use-without-check]: ‘read’ on possibly invalid file descriptor ‘open("/dev/urandom", 0)’ liburing-2.13/test/fixed-seg.c:117:12: branch_false: following ‘false’ branch... liburing-2.13/test/fixed-seg.c:121:15: branch_false: ...to here liburing-2.13/test/fixed-seg.c:124:12: branch_true: following ‘true’ branch... liburing-2.13/test/fixed-seg.c:124:20: branch_true: ...to here liburing-2.13/test/fixed-seg.c:124:13: branch_false: following ‘false’ branch... liburing-2.13/test/fixed-seg.c:129:18: branch_false: ...to here liburing-2.13/test/fixed-seg.c:129:18: acquire_resource: opened here liburing-2.13/test/fixed-seg.c:135:13: branch_true: following ‘true’ branch... liburing-2.13/test/fixed-seg.c:135:13: branch_true: ...to here liburing-2.13/test/fixed-seg.c:139:15: danger: ‘open("/dev/urandom", 0)’ could be invalid: unchecked value from [(7)](sarif:/runs/0/results/3/codeFlows/0/threadFlows/0/locations/6) # 137| wvec.iov_len = 512*1024; # 138| # 139|-> ret = read(rnd_fd, wvec.iov_base, wvec.iov_len); # 140| if (ret != wvec.iov_len) { # 141| fprintf(stderr, "Precondition, urandom read failed, ret: %d\n", ret); Error: CPPCHECK_WARNING (CWE-476): [#def48] liburing-2.13/test/futex-kill.c:41: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: futex # 39| # 40| futex = malloc(sizeof(*futex)); # 41|-> *futex = 0; # 42| fw.uaddr = (unsigned long) futex; # 43| fw.flags = FUTEX2_SIZE_U32|FUTEX2_PRIVATE; Error: GCC_ANALYZER_WARNING (CWE-476): [#def49] liburing-2.13/test/futex-kill.c:41:9: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘futex’ liburing-2.13/test/futex-kill.c:79:5: enter_function: entry to ‘main’ liburing-2.13/test/futex-kill.c:83:15: call_function: calling ‘test’ from ‘main’ # 39| # 40| futex = malloc(sizeof(*futex)); # 41|-> *futex = 0; # 42| fw.uaddr = (unsigned long) futex; # 43| fw.flags = FUTEX2_SIZE_U32|FUTEX2_PRIVATE; Error: GCC_ANALYZER_WARNING (CWE-775): [#def50] liburing-2.13/test/iowait.c:54:24: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘fds[0]’ liburing-2.13/test/iowait.c:56:12: branch_false: following ‘false’ branch... liburing-2.13/test/iowait.c:61:15: branch_false: ...to here liburing-2.13/test/iowait.c:62:12: branch_true: following ‘true’ branch... liburing-2.13/test/iowait.c:63:17: branch_true: ...to here liburing-2.13/test/iowait.c:54:24: danger: ‘fds[0]’ leaks here # 52| # 53| if (!(ring->features & IORING_FEAT_NO_IOWAIT)) # 54|-> return T_EXIT_SKIP; # 55| # 56| if (pipe(fds) < 0) { Error: GCC_ANALYZER_WARNING (CWE-775): [#def51] liburing-2.13/test/iowait.c:54:24: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘fds[1]’ liburing-2.13/test/iowait.c:56:12: branch_false: following ‘false’ branch... liburing-2.13/test/iowait.c:61:15: branch_false: ...to here liburing-2.13/test/iowait.c:62:12: branch_true: following ‘true’ branch... liburing-2.13/test/iowait.c:63:17: branch_true: ...to here liburing-2.13/test/iowait.c:54:24: danger: ‘fds[1]’ leaks here # 52| # 53| if (!(ring->features & IORING_FEAT_NO_IOWAIT)) # 54|-> return T_EXIT_SKIP; # 55| # 56| if (pipe(fds) < 0) { Error: GCC_ANALYZER_WARNING (CWE-775): [#def52] liburing-2.13/test/iowait.c:54:24: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘fds[with_iowait]’ liburing-2.13/test/iowait.c:106:5: enter_function: entry to ‘main’ liburing-2.13/test/iowait.c:114:12: branch_false: following ‘false’ branch... liburing-2.13/test/iowait.c:117:15: branch_false: ...to here liburing-2.13/test/iowait.c:118:12: branch_false: following ‘false’ branch (when ‘ret != 1’)... liburing-2.13/test/iowait.c:120:17: branch_false: ...to here liburing-2.13/test/iowait.c:120:17: branch_false: following ‘false’ branch (when ‘ret == 0’)... liburing-2.13/test/iowait.c:123:15: branch_false: ...to here liburing-2.13/test/iowait.c:123:15: call_function: calling ‘test’ from ‘main’ # 52| # 53| if (!(ring->features & IORING_FEAT_NO_IOWAIT)) # 54|-> return T_EXIT_SKIP; # 55| # 56| if (pipe(fds) < 0) { Error: GCC_ANALYZER_WARNING (CWE-775): [#def53] liburing-2.13/test/iowait.c:61:15: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘fds[0]’ liburing-2.13/test/iowait.c:56:12: branch_false: following ‘false’ branch... liburing-2.13/test/iowait.c:61:15: branch_false: ...to here liburing-2.13/test/iowait.c:61:15: throw: if ‘io_uring_set_iowait’ throws an exception... liburing-2.13/test/iowait.c:61:15: danger: ‘fds[0]’ leaks here # 59| } # 60| # 61|-> ret = io_uring_set_iowait(ring, with_iowait); # 62| if (ret) { # 63| fprintf(stderr, "set_iowait=%d\n", ret); Error: GCC_ANALYZER_WARNING (CWE-775): [#def54] liburing-2.13/test/iowait.c:61:15: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘fds[1]’ liburing-2.13/test/iowait.c:56:12: branch_false: following ‘false’ branch... liburing-2.13/test/iowait.c:61:15: branch_false: ...to here liburing-2.13/test/iowait.c:61:15: throw: if ‘io_uring_set_iowait’ throws an exception... liburing-2.13/test/iowait.c:61:15: danger: ‘fds[1]’ leaks here # 59| } # 60| # 61|-> ret = io_uring_set_iowait(ring, with_iowait); # 62| if (ret) { # 63| fprintf(stderr, "set_iowait=%d\n", ret); Error: GCC_ANALYZER_WARNING (CWE-775): [#def55] liburing-2.13/test/iowait.c:61:15: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘fds[with_iowait]’ liburing-2.13/test/iowait.c:106:5: enter_function: entry to ‘main’ liburing-2.13/test/iowait.c:114:12: branch_false: following ‘false’ branch... liburing-2.13/test/iowait.c:117:15: branch_false: ...to here liburing-2.13/test/iowait.c:118:12: branch_false: following ‘false’ branch (when ‘ret != 1’)... liburing-2.13/test/iowait.c:120:17: branch_false: ...to here liburing-2.13/test/iowait.c:120:17: branch_false: following ‘false’ branch (when ‘ret == 0’)... liburing-2.13/test/iowait.c:123:15: branch_false: ...to here liburing-2.13/test/iowait.c:123:15: call_function: calling ‘test’ from ‘main’ # 59| } # 60| # 61|-> ret = io_uring_set_iowait(ring, with_iowait); # 62| if (ret) { # 63| fprintf(stderr, "set_iowait=%d\n", ret); Error: GCC_ANALYZER_WARNING (CWE-401): [#def56] liburing-2.13/test/mock_file.c:75:15: warning[-Wanalyzer-malloc-leak]: leak of ‘buffer’ liburing-2.13/test/mock_file.c:289:12: enter_function: entry to ‘test_rw’ liburing-2.13/test/mock_file.c:295:12: branch_false: following ‘false’ branch... liburing-2.13/test/mock_file.c:300:18: branch_false: ...to here liburing-2.13/test/mock_file.c:300:18: acquire_memory: allocated here liburing-2.13/test/mock_file.c:301:12: branch_false: following ‘false’ branch (when ‘buffer’ is non-NULL)... liburing-2.13/test/mock_file.c:306:15: branch_false: ...to here liburing-2.13/test/mock_file.c:307:12: branch_false: following ‘false’ branch... liburing-2.13/test/mock_file.c:307:12: branch_false: ...to here liburing-2.13/test/mock_file.c:312:21: branch_true: following ‘true’ branch (when ‘i != 8’)... liburing-2.13/test/mock_file.c:314:22: branch_true: ...to here liburing-2.13/test/mock_file.c:320:20: branch_false: following ‘false’ branch... liburing-2.13/test/mock_file.c:325:20: branch_false: ...to here liburing-2.13/test/mock_file.c:325:20: branch_false: following ‘false’ branch (when ‘nowait == 0’)... liburing-2.13/test/mock_file.c:330:20: branch_false: ...to here liburing-2.13/test/mock_file.c:330:20: branch_false: following ‘false’ branch... liburing-2.13/test/mock_file.c:335:17: branch_false: ...to here liburing-2.13/test/mock_file.c:336:21: call_function: calling ‘create_mock_file’ from ‘test_rw’ # 73| sqe->len = sizeof(*mc); # 74| # 75|-> ret = t_submit_and_wait_single(&mgr_ring, &cqe); # 76| if (ret || cqe->res) { # 77| fprintf(stderr, "file create cmd failed %i %i\n", ret, cqe->res); Error: CPPCHECK_WARNING (CWE-476): [#def57] liburing-2.13/test/mock_file.c:148: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: buf_src # 146| # 147| for (i = 0; i < size; i++) # 148|-> buf_src[i] = 'a' + (i % 26); # 149| # 150| buf_iovec[0].iov_base = buf_src; Error: GCC_ANALYZER_WARNING (CWE-401): [#def58] liburing-2.13/test/mock_file.c:306:15: warning[-Wanalyzer-malloc-leak]: leak of ‘buffer’ liburing-2.13/test/mock_file.c:295:12: branch_false: following ‘false’ branch... liburing-2.13/test/mock_file.c:300:18: branch_false: ...to here liburing-2.13/test/mock_file.c:300:18: acquire_memory: allocated here liburing-2.13/test/mock_file.c:301:12: branch_false: following ‘false’ branch (when ‘buffer’ is non-NULL)... liburing-2.13/test/mock_file.c:306:15: branch_false: ...to here liburing-2.13/test/mock_file.c:306:15: throw: if ‘io_uring_queue_init’ throws an exception... liburing-2.13/test/mock_file.c:306:15: danger: ‘buffer’ leaks here; was allocated at [(3)](sarif:/runs/0/results/4/codeFlows/0/threadFlows/0/locations/2) # 304| } # 305| # 306|-> ret = io_uring_queue_init(32, &ring, 0); # 307| if (ret) { # 308| fprintf(stderr, "ring setup failed: %d\n", ret); Error: CPPCHECK_WARNING (CWE-401): [#def59] liburing-2.13/test/mock_file.c:309: error[memleak]: Memory leak: buffer # 307| if (ret) { # 308| fprintf(stderr, "ring setup failed: %d\n", ret); # 309|-> return 1; # 310| } # 311| Error: GCC_ANALYZER_WARNING (CWE-401): [#def60] liburing-2.13/test/mock_file.c:353:1: warning[-Wanalyzer-malloc-leak]: leak of ‘buffer’ liburing-2.13/test/mock_file.c:295:12: branch_false: following ‘false’ branch... liburing-2.13/test/mock_file.c:300:18: branch_false: ...to here liburing-2.13/test/mock_file.c:300:18: acquire_memory: allocated here liburing-2.13/test/mock_file.c:301:12: branch_false: following ‘false’ branch (when ‘buffer’ is non-NULL)... liburing-2.13/test/mock_file.c:306:15: branch_false: ...to here liburing-2.13/test/mock_file.c:353:1: danger: ‘buffer’ leaks here; was allocated at [(3)](sarif:/runs/0/results/5/codeFlows/0/threadFlows/0/locations/2) # 351| io_uring_queue_exit(&ring); # 352| return 0; # 353|-> } # 354| # 355| int main(int argc, char *argv[]) Error: GCC_ANALYZER_WARNING (CWE-775): [#def61] liburing-2.13/test/pipe-bug.c:40:24: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘fds[0]’ liburing-2.13/test/pipe-bug.c:25:12: enter_function: entry to ‘pipe_bug’ liburing-2.13/test/pipe-bug.c:38:12: branch_false: following ‘false’ branch... liburing-2.13/test/pipe-bug.c:41:19: branch_false: ...to here liburing-2.13/test/pipe-bug.c:41:19: branch_false: following ‘false’ branch... liburing-2.13/test/pipe-bug.c:46:9: branch_false: ...to here liburing-2.13/test/pipe-bug.c:46:9: branch_false: following ‘false’ branch... liburing-2.13/test/pipe-bug.c:49:15: call_function: inlined call to ‘io_uring_get_sqe’ from ‘pipe_bug’ liburing-2.13/test/pipe-bug.c:49:15: call_function: inlined call to ‘io_uring_get_sqe’ from ‘pipe_bug’ liburing-2.13/test/pipe-bug.c:50:9: branch_true: following ‘true’ branch... liburing-2.13/test/pipe-bug.c:50:9: branch_true: ...to here liburing-2.13/test/pipe-bug.c:40:24: danger: ‘fds[0]’ leaks here # 38| if (ret == -ENOMEM) { # 39| usleep(1000); # 40|-> return 0; # 41| } else if (ret) { # 42| fprintf(stderr, "ring_init: %d\n", ret); Error: GCC_ANALYZER_WARNING (CWE-775): [#def62] liburing-2.13/test/pipe-bug.c:40:24: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘fds[1]’ liburing-2.13/test/pipe-bug.c:25:12: enter_function: entry to ‘pipe_bug’ liburing-2.13/test/pipe-bug.c:38:12: branch_false: following ‘false’ branch... liburing-2.13/test/pipe-bug.c:41:19: branch_false: ...to here liburing-2.13/test/pipe-bug.c:41:19: branch_false: following ‘false’ branch... liburing-2.13/test/pipe-bug.c:46:9: branch_false: ...to here liburing-2.13/test/pipe-bug.c:46:9: branch_false: following ‘false’ branch... liburing-2.13/test/pipe-bug.c:49:15: call_function: inlined call to ‘io_uring_get_sqe’ from ‘pipe_bug’ liburing-2.13/test/pipe-bug.c:49:15: call_function: inlined call to ‘io_uring_get_sqe’ from ‘pipe_bug’ liburing-2.13/test/pipe-bug.c:50:9: branch_true: following ‘true’ branch... liburing-2.13/test/pipe-bug.c:50:9: branch_true: ...to here liburing-2.13/test/pipe-bug.c:40:24: danger: ‘fds[1]’ leaks here # 38| if (ret == -ENOMEM) { # 39| usleep(1000); # 40|-> return 0; # 41| } else if (ret) { # 42| fprintf(stderr, "ring_init: %d\n", ret); Error: GCC_ANALYZER_WARNING (CWE-775): [#def63] liburing-2.13/test/pipe-bug.c:40:24: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘fds[i]’ liburing-2.13/test/pipe-bug.c:88:5: enter_function: entry to ‘main’ liburing-2.13/test/pipe-bug.c:92:12: branch_false: following ‘false’ branch (when ‘argc <= 1’)... liburing-2.13/test/pipe-bug.c:92:12: branch_false: ...to here liburing-2.13/test/pipe-bug.c:95:21: branch_true: following ‘true’ branch (when ‘i != 10000’)... liburing-2.13/test/pipe-bug.c:96:21: branch_true: ...to here liburing-2.13/test/pipe-bug.c:96:21: call_function: calling ‘pipe_bug’ from ‘main’ # 38| if (ret == -ENOMEM) { # 39| usleep(1000); # 40|-> return 0; # 41| } else if (ret) { # 42| fprintf(stderr, "ring_init: %d\n", ret); Error: GCC_ANALYZER_WARNING (CWE-775): [#def64] liburing-2.13/test/pipe-eof.c:54:15: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘d.fds[0]’ liburing-2.13/test/pipe-eof.c:45:12: branch_false: following ‘false’ branch (when ‘argc <= 1’)... liburing-2.13/test/pipe-eof.c:48:13: branch_false: ...to here liburing-2.13/test/pipe-eof.c:48:12: branch_false: following ‘false’ branch... liburing-2.13/test/pipe-eof.c:52:9: branch_false: ...to here liburing-2.13/test/pipe-eof.c:54:15: throw: if ‘io_uring_queue_init’ throws an exception... liburing-2.13/test/pipe-eof.c:54:15: danger: ‘d.fds[0]’ leaks here # 52| d.str = buf; # 53| # 54|-> ret = io_uring_queue_init(8, &ring, 0); # 55| if (ret == -ENOMEM) { # 56| return T_EXIT_SKIP; Error: GCC_ANALYZER_WARNING (CWE-775): [#def65] liburing-2.13/test/pipe-eof.c:54:15: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘d.fds[1]’ liburing-2.13/test/pipe-eof.c:45:12: branch_false: following ‘false’ branch (when ‘argc <= 1’)... liburing-2.13/test/pipe-eof.c:48:13: branch_false: ...to here liburing-2.13/test/pipe-eof.c:48:12: branch_false: following ‘false’ branch... liburing-2.13/test/pipe-eof.c:52:9: branch_false: ...to here liburing-2.13/test/pipe-eof.c:54:15: throw: if ‘io_uring_queue_init’ throws an exception... liburing-2.13/test/pipe-eof.c:54:15: danger: ‘d.fds[1]’ leaks here # 52| d.str = buf; # 53| # 54|-> ret = io_uring_queue_init(8, &ring, 0); # 55| if (ret == -ENOMEM) { # 56| return T_EXIT_SKIP; Error: GCC_ANALYZER_WARNING (CWE-401): [#def66] liburing-2.13/test/recv-bundle-short-ooo.c:276:24: warning[-Wanalyzer-malloc-leak]: leak of ‘test_data’ liburing-2.13/test/recv-bundle-short-ooo.c:293:12: enter_function: entry to ‘test_recv_multi_large_packet_isolate_ring’ liburing-2.13/test/recv-bundle-short-ooo.c:301:12: branch_false: following ‘false’ branch (when ‘ret != 1’)... liburing-2.13/test/recv-bundle-short-ooo.c:303:17: branch_false: ...to here liburing-2.13/test/recv-bundle-short-ooo.c:303:17: branch_false: following ‘false’ branch (when ‘ret == 0’)... liburing-2.13/test/recv-bundle-short-ooo.c:308:15: branch_false: ...to here liburing-2.13/test/recv-bundle-short-ooo.c:308:15: call_function: calling ‘setup_buf_ring’ from ‘test_recv_multi_large_packet_isolate_ring’ liburing-2.13/test/recv-bundle-short-ooo.c:308:15: return_function: returning to ‘test_recv_multi_large_packet_isolate_ring’ from ‘setup_buf_ring’ liburing-2.13/test/recv-bundle-short-ooo.c:309:12: branch_false: following ‘false’ branch... liburing-2.13/test/recv-bundle-short-ooo.c:311:17: branch_false: ...to here liburing-2.13/test/recv-bundle-short-ooo.c:311:17: branch_false: following ‘false’ branch... liburing-2.13/test/recv-bundle-short-ooo.c:316:15: branch_false: ...to here liburing-2.13/test/recv-bundle-short-ooo.c:317:9: branch_true: following ‘true’ branch... liburing-2.13/test/recv-bundle-short-ooo.c:319:13: branch_true: ...to here liburing-2.13/test/recv-bundle-short-ooo.c:323:30: acquire_memory: allocated here liburing-2.13/test/recv-bundle-short-ooo.c:324:25: branch_true: following ‘true’ branch (when ‘i != 1048576’)... liburing-2.13/test/recv-bundle-short-ooo.c:325:26: branch_true: ...to here liburing-2.13/test/recv-bundle-short-ooo.c:324:25: branch_true: following ‘true’ branch (when ‘i != 1048576’)... liburing-2.13/test/recv-bundle-short-ooo.c:325:26: branch_true: ...to here liburing-2.13/test/recv-bundle-short-ooo.c:324:25: branch_false: following ‘false’ branch (when ‘i == 1048576’)... liburing-2.13/test/recv-bundle-short-ooo.c:328:9: branch_false: ...to here liburing-2.13/test/recv-bundle-short-ooo.c:328:9: call_function: calling ‘write_all’ from ‘test_recv_multi_large_packet_isolate_ring’ # 274| ssize_t sent; # 275| # 276|-> sent = write(fd, buf + bytes_sent, size - bytes_sent); # 277| assert(sent > 0); /* Ensure write succeeded */ # 278| bytes_sent += sent; Error: CPPCHECK_WARNING (CWE-476): [#def67] liburing-2.13/test/recv-bundle-short-ooo.c:325: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: test_data # 323| uint8_t *test_data = malloc(ONE_MB); # 324| for (int i = 0; i < ONE_MB; i++) # 325|-> test_data[i] = i % 256; /* Create repeating pattern */ # 326| # 327| /* Send test data through the socket */ Error: GCC_ANALYZER_WARNING (CWE-476): [#def68] liburing-2.13/test/recv-bundle-short-ooo.c:325:17: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘test_data’ liburing-2.13/test/recv-bundle-short-ooo.c:293:12: enter_function: entry to ‘test_recv_multi_large_packet_isolate_ring’ liburing-2.13/test/recv-bundle-short-ooo.c:301:12: branch_false: following ‘false’ branch (when ‘ret != 1’)... liburing-2.13/test/recv-bundle-short-ooo.c:303:17: branch_false: ...to here liburing-2.13/test/recv-bundle-short-ooo.c:303:17: branch_false: following ‘false’ branch (when ‘ret == 0’)... liburing-2.13/test/recv-bundle-short-ooo.c:308:15: branch_false: ...to here liburing-2.13/test/recv-bundle-short-ooo.c:308:15: call_function: calling ‘setup_buf_ring’ from ‘test_recv_multi_large_packet_isolate_ring’ liburing-2.13/test/recv-bundle-short-ooo.c:308:15: return_function: returning to ‘test_recv_multi_large_packet_isolate_ring’ from ‘setup_buf_ring’ liburing-2.13/test/recv-bundle-short-ooo.c:309:12: branch_false: following ‘false’ branch... liburing-2.13/test/recv-bundle-short-ooo.c:311:17: branch_false: ...to here liburing-2.13/test/recv-bundle-short-ooo.c:311:17: branch_false: following ‘false’ branch... liburing-2.13/test/recv-bundle-short-ooo.c:316:15: branch_false: ...to here liburing-2.13/test/recv-bundle-short-ooo.c:317:9: branch_true: following ‘true’ branch... liburing-2.13/test/recv-bundle-short-ooo.c:319:13: branch_true: ...to here liburing-2.13/test/recv-bundle-short-ooo.c:323:30: acquire_memory: this call could return NULL liburing-2.13/test/recv-bundle-short-ooo.c:324:25: branch_true: following ‘true’ branch (when ‘i != 1048576’)... liburing-2.13/test/recv-bundle-short-ooo.c:325:26: branch_true: ...to here liburing-2.13/test/recv-bundle-short-ooo.c:325:17: danger: ‘test_data + (sizetype)i’ could be NULL: unchecked value from [(26)](sarif:/runs/0/results/3/codeFlows/0/threadFlows/0/locations/25) # 323| uint8_t *test_data = malloc(ONE_MB); # 324| for (int i = 0; i < ONE_MB; i++) # 325|-> test_data[i] = i % 256; /* Create repeating pattern */ # 326| # 327| /* Send test data through the socket */ Error: GCC_ANALYZER_WARNING (CWE-401): [#def69] liburing-2.13/test/recv-bundle-short-ooo.c:331:9: warning[-Wanalyzer-malloc-leak]: leak of ‘test_data’ liburing-2.13/test/recv-bundle-short-ooo.c:293:12: enter_function: entry to ‘test_recv_multi_large_packet_isolate_ring’ liburing-2.13/test/recv-bundle-short-ooo.c:301:12: branch_false: following ‘false’ branch (when ‘ret != 1’)... liburing-2.13/test/recv-bundle-short-ooo.c:303:17: branch_false: ...to here liburing-2.13/test/recv-bundle-short-ooo.c:303:17: branch_false: following ‘false’ branch (when ‘ret == 0’)... liburing-2.13/test/recv-bundle-short-ooo.c:308:15: branch_false: ...to here liburing-2.13/test/recv-bundle-short-ooo.c:308:15: call_function: calling ‘setup_buf_ring’ from ‘test_recv_multi_large_packet_isolate_ring’ liburing-2.13/test/recv-bundle-short-ooo.c:308:15: return_function: returning to ‘test_recv_multi_large_packet_isolate_ring’ from ‘setup_buf_ring’ liburing-2.13/test/recv-bundle-short-ooo.c:309:12: branch_false: following ‘false’ branch... liburing-2.13/test/recv-bundle-short-ooo.c:311:17: branch_false: ...to here liburing-2.13/test/recv-bundle-short-ooo.c:311:17: branch_false: following ‘false’ branch... liburing-2.13/test/recv-bundle-short-ooo.c:316:15: branch_false: ...to here liburing-2.13/test/recv-bundle-short-ooo.c:317:9: branch_true: following ‘true’ branch... liburing-2.13/test/recv-bundle-short-ooo.c:319:13: branch_true: ...to here liburing-2.13/test/recv-bundle-short-ooo.c:323:30: acquire_memory: allocated here liburing-2.13/test/recv-bundle-short-ooo.c:324:25: branch_true: following ‘true’ branch (when ‘i != 1048576’)... liburing-2.13/test/recv-bundle-short-ooo.c:325:26: branch_true: ...to here liburing-2.13/test/recv-bundle-short-ooo.c:324:25: branch_true: following ‘true’ branch (when ‘i != 1048576’)... liburing-2.13/test/recv-bundle-short-ooo.c:325:26: branch_true: ...to here liburing-2.13/test/recv-bundle-short-ooo.c:324:25: branch_false: following ‘false’ branch (when ‘i == 1048576’)... liburing-2.13/test/recv-bundle-short-ooo.c:328:9: branch_false: ...to here liburing-2.13/test/recv-bundle-short-ooo.c:328:9: call_function: calling ‘write_all’ from ‘test_recv_multi_large_packet_isolate_ring’ liburing-2.13/test/recv-bundle-short-ooo.c:328:9: return_function: returning to ‘test_recv_multi_large_packet_isolate_ring’ from ‘write_all’ liburing-2.13/test/recv-bundle-short-ooo.c:331:9: throw: if ‘close’ throws an exception... liburing-2.13/test/recv-bundle-short-ooo.c:331:9: danger: ‘test_data’ leaks here; was allocated at [(26)](sarif:/runs/0/results/4/codeFlows/0/threadFlows/0/locations/25) # 329| # 330| /* Close sender side to signal EOF to receiver */ # 331|-> close(sender_fd); # 332| # 333| /* Initialize pointer to track our position in expected data */ Error: GCC_ANALYZER_WARNING (CWE-401): [#def70] liburing-2.13/test/recv-inc-ooo.c:181:9: warning[-Wanalyzer-malloc-leak]: leak of ‘current_expect’ liburing-2.13/test/recv-inc-ooo.c:253:12: enter_function: entry to ‘test_recv_incr’ liburing-2.13/test/recv-inc-ooo.c:261:12: branch_false: following ‘false’ branch (when ‘ret != 1’)... liburing-2.13/test/recv-inc-ooo.c:263:17: branch_false: ...to here liburing-2.13/test/recv-inc-ooo.c:263:17: branch_false: following ‘false’ branch (when ‘ret == 0’)... liburing-2.13/test/recv-inc-ooo.c:268:15: branch_false: ...to here liburing-2.13/test/recv-inc-ooo.c:268:15: call_function: calling ‘setup_buf_ring’ from ‘test_recv_incr’ liburing-2.13/test/recv-inc-ooo.c:268:15: return_function: returning to ‘test_recv_incr’ from ‘setup_buf_ring’ liburing-2.13/test/recv-inc-ooo.c:269:12: branch_false: following ‘false’ branch... liburing-2.13/test/recv-inc-ooo.c:271:17: branch_false: ...to here liburing-2.13/test/recv-inc-ooo.c:271:17: branch_false: following ‘false’ branch... liburing-2.13/test/recv-inc-ooo.c:276:15: branch_false: ...to here liburing-2.13/test/recv-inc-ooo.c:277:9: branch_true: following ‘true’ branch... liburing-2.13/test/recv-inc-ooo.c:279:13: branch_true: ...to here liburing-2.13/test/recv-inc-ooo.c:285:36: call_function: inlined call to ‘io_uring_get_sqe’ from ‘test_recv_incr’ liburing-2.13/test/recv-inc-ooo.c:285:36: call_function: inlined call to ‘io_uring_get_sqe’ from ‘test_recv_incr’ liburing-2.13/test/recv-inc-ooo.c:296:30: acquire_memory: allocated here liburing-2.13/test/recv-inc-ooo.c:297:25: branch_true: following ‘true’ branch (when ‘i != 2048’)... liburing-2.13/test/recv-inc-ooo.c:298:26: branch_true: ...to here liburing-2.13/test/recv-inc-ooo.c:297:25: branch_true: following ‘true’ branch (when ‘i != 2048’)... liburing-2.13/test/recv-inc-ooo.c:298:26: branch_true: ...to here liburing-2.13/test/recv-inc-ooo.c:310:28: branch_true: following ‘true’ branch (when ‘i != 4’)... liburing-2.13/test/recv-inc-ooo.c:311:24: branch_true: ...to here liburing-2.13/test/recv-inc-ooo.c:317:17: call_function: calling ‘write_all’ from ‘test_recv_incr’ liburing-2.13/test/recv-inc-ooo.c:317:17: return_function: returning to ‘test_recv_incr’ from ‘write_all’ liburing-2.13/test/recv-inc-ooo.c:323:24: branch_true: following ‘true’ branch (when ‘remaining_chunk_len != 0’)... liburing-2.13/test/recv-inc-ooo.c:325:31: branch_true: ...to here liburing-2.13/test/recv-inc-ooo.c:325:31: call_function: calling ‘io_uring_wait_cqe’ from ‘test_recv_incr’ liburing-2.13/test/recv-inc-ooo.c:325:31: return_function: returning to ‘test_recv_incr’ from ‘io_uring_wait_cqe’ liburing-2.13/test/recv-inc-ooo.c:326:28: branch_false: following ‘false’ branch... liburing-2.13/test/recv-inc-ooo.c:333:59: branch_false: ...to here liburing-2.13/test/recv-inc-ooo.c:335:29: call_function: calling ‘process_completion’ from ‘test_recv_incr’ # 179| uint8_t **current_expect) # 180| { # 181|-> usleep(1); # 182| # 183| if (cqe->res <= 0) { Error: GCC_ANALYZER_WARNING (CWE-401): [#def71] liburing-2.13/test/recv-inc-ooo.c:236:24: warning[-Wanalyzer-malloc-leak]: leak of ‘test_data’ liburing-2.13/test/recv-inc-ooo.c:253:12: enter_function: entry to ‘test_recv_incr’ liburing-2.13/test/recv-inc-ooo.c:261:12: branch_false: following ‘false’ branch (when ‘ret != 1’)... liburing-2.13/test/recv-inc-ooo.c:263:17: branch_false: ...to here liburing-2.13/test/recv-inc-ooo.c:263:17: branch_false: following ‘false’ branch (when ‘ret == 0’)... liburing-2.13/test/recv-inc-ooo.c:268:15: branch_false: ...to here liburing-2.13/test/recv-inc-ooo.c:268:15: call_function: calling ‘setup_buf_ring’ from ‘test_recv_incr’ liburing-2.13/test/recv-inc-ooo.c:268:15: return_function: returning to ‘test_recv_incr’ from ‘setup_buf_ring’ liburing-2.13/test/recv-inc-ooo.c:269:12: branch_false: following ‘false’ branch... liburing-2.13/test/recv-inc-ooo.c:271:17: branch_false: ...to here liburing-2.13/test/recv-inc-ooo.c:271:17: branch_false: following ‘false’ branch... liburing-2.13/test/recv-inc-ooo.c:276:15: branch_false: ...to here liburing-2.13/test/recv-inc-ooo.c:277:9: branch_true: following ‘true’ branch... liburing-2.13/test/recv-inc-ooo.c:279:13: branch_true: ...to here liburing-2.13/test/recv-inc-ooo.c:285:36: call_function: inlined call to ‘io_uring_get_sqe’ from ‘test_recv_incr’ liburing-2.13/test/recv-inc-ooo.c:285:36: call_function: inlined call to ‘io_uring_get_sqe’ from ‘test_recv_incr’ liburing-2.13/test/recv-inc-ooo.c:296:30: acquire_memory: allocated here liburing-2.13/test/recv-inc-ooo.c:297:25: branch_true: following ‘true’ branch (when ‘i != 2048’)... liburing-2.13/test/recv-inc-ooo.c:298:26: branch_true: ...to here liburing-2.13/test/recv-inc-ooo.c:297:25: branch_true: following ‘true’ branch (when ‘i != 2048’)... liburing-2.13/test/recv-inc-ooo.c:298:26: branch_true: ...to here liburing-2.13/test/recv-inc-ooo.c:310:28: branch_true: following ‘true’ branch (when ‘i != 4’)... liburing-2.13/test/recv-inc-ooo.c:311:24: branch_true: ...to here liburing-2.13/test/recv-inc-ooo.c:317:17: call_function: calling ‘write_all’ from ‘test_recv_incr’ # 234| ssize_t sent; # 235| # 236|-> sent = write(fd, buf + bytes_sent, size - bytes_sent); # 237| assert(sent > 0); /* Ensure write succeeded */ # 238| bytes_sent += sent; Error: CPPCHECK_WARNING (CWE-476): [#def72] liburing-2.13/test/recv-inc-ooo.c:298: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: test_data # 296| uint8_t *test_data = malloc(total_bytes); # 297| for (int i = 0; i < total_bytes; i++) # 298|-> test_data[i] = i % 256; /* Create repeating pattern */ # 299| # 300| /* Send data in chunks to test buffer boundary handling, intentionally misaligned with buffer size */ Error: GCC_ANALYZER_WARNING (CWE-476): [#def73] liburing-2.13/test/recv-inc-ooo.c:298:17: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘test_data’ liburing-2.13/test/recv-inc-ooo.c:253:12: enter_function: entry to ‘test_recv_incr’ liburing-2.13/test/recv-inc-ooo.c:261:12: branch_false: following ‘false’ branch (when ‘ret != 1’)... liburing-2.13/test/recv-inc-ooo.c:263:17: branch_false: ...to here liburing-2.13/test/recv-inc-ooo.c:263:17: branch_false: following ‘false’ branch (when ‘ret == 0’)... liburing-2.13/test/recv-inc-ooo.c:268:15: branch_false: ...to here liburing-2.13/test/recv-inc-ooo.c:268:15: call_function: calling ‘setup_buf_ring’ from ‘test_recv_incr’ liburing-2.13/test/recv-inc-ooo.c:268:15: return_function: returning to ‘test_recv_incr’ from ‘setup_buf_ring’ liburing-2.13/test/recv-inc-ooo.c:269:12: branch_false: following ‘false’ branch... liburing-2.13/test/recv-inc-ooo.c:271:17: branch_false: ...to here liburing-2.13/test/recv-inc-ooo.c:271:17: branch_false: following ‘false’ branch... liburing-2.13/test/recv-inc-ooo.c:276:15: branch_false: ...to here liburing-2.13/test/recv-inc-ooo.c:277:9: branch_true: following ‘true’ branch... liburing-2.13/test/recv-inc-ooo.c:279:13: branch_true: ...to here liburing-2.13/test/recv-inc-ooo.c:285:36: call_function: inlined call to ‘io_uring_get_sqe’ from ‘test_recv_incr’ liburing-2.13/test/recv-inc-ooo.c:285:36: call_function: inlined call to ‘io_uring_get_sqe’ from ‘test_recv_incr’ liburing-2.13/test/recv-inc-ooo.c:296:30: acquire_memory: this call could return NULL liburing-2.13/test/recv-inc-ooo.c:297:25: branch_true: following ‘true’ branch (when ‘i != 2048’)... liburing-2.13/test/recv-inc-ooo.c:298:26: branch_true: ...to here liburing-2.13/test/recv-inc-ooo.c:298:17: danger: ‘test_data + (long unsigned int)i’ could be NULL: unchecked value from [(31)](sarif:/runs/0/results/4/codeFlows/0/threadFlows/0/locations/30) # 296| uint8_t *test_data = malloc(total_bytes); # 297| for (int i = 0; i < total_bytes; i++) # 298|-> test_data[i] = i % 256; /* Create repeating pattern */ # 299| # 300| /* Send data in chunks to test buffer boundary handling, intentionally misaligned with buffer size */ Error: GCC_ANALYZER_WARNING (CWE-775): [#def74] liburing-2.13/test/recv-mshot-fair.c:109:17: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘sockfd’ liburing-2.13/test/recv-mshot-fair.c:92:18: acquire_resource: stream socket created here liburing-2.13/test/recv-mshot-fair.c:93:12: branch_false: following ‘false’ branch (when ‘sockfd >= 0’)... liburing-2.13/test/recv-mshot-fair.c:98:9: branch_false: ...to here liburing-2.13/test/recv-mshot-fair.c:102:12: branch_false: following ‘false’ branch (when ‘ret >= 0’)... liburing-2.13/test/recv-mshot-fair.c:107:15: branch_false: ...to here liburing-2.13/test/recv-mshot-fair.c:108:12: branch_true: following ‘true’ branch (when ‘ret < 0’)... liburing-2.13/test/recv-mshot-fair.c:109:17: branch_true: ...to here liburing-2.13/test/recv-mshot-fair.c:109:17: throw: if ‘perror’ throws an exception... liburing-2.13/test/recv-mshot-fair.c:109:17: danger: ‘sockfd’ leaks here # 107| ret = listen(sockfd, 1); # 108| if (ret < 0) { # 109|-> perror("listen"); # 110| goto err; # 111| } Error: GCC_ANALYZER_WARNING (CWE-775): [#def75] liburing-2.13/test/recv-mshot-fair.c:116:18: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘sockfd’ liburing-2.13/test/recv-mshot-fair.c:92:18: acquire_resource: stream socket created here liburing-2.13/test/recv-mshot-fair.c:93:12: branch_false: following ‘false’ branch (when ‘sockfd >= 0’)... liburing-2.13/test/recv-mshot-fair.c:98:9: branch_false: ...to here liburing-2.13/test/recv-mshot-fair.c:102:12: branch_false: following ‘false’ branch (when ‘ret >= 0’)... liburing-2.13/test/recv-mshot-fair.c:107:15: branch_false: ...to here liburing-2.13/test/recv-mshot-fair.c:108:12: branch_false: following ‘false’ branch (when ‘ret >= 0’)... liburing-2.13/test/recv-mshot-fair.c:113:9: branch_false: ...to here liburing-2.13/test/recv-mshot-fair.c:116:18: throw: if ‘accept’ throws an exception... liburing-2.13/test/recv-mshot-fair.c:116:18: danger: ‘sockfd’ leaks here # 114| # 115| socklen = sizeof(saddr); # 116|-> use_fd = accept(sockfd, (struct sockaddr *)&saddr, &socklen); # 117| if (use_fd < 0) { # 118| perror("accept"); Error: GCC_ANALYZER_WARNING (CWE-775): [#def76] liburing-2.13/test/recv-mshot-fair.c:131:9: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘sockfd’ liburing-2.13/test/recv-mshot-fair.c:92:18: acquire_resource: stream socket created here liburing-2.13/test/recv-mshot-fair.c:93:12: branch_false: following ‘false’ branch (when ‘sockfd >= 0’)... liburing-2.13/test/recv-mshot-fair.c:98:9: branch_false: ...to here liburing-2.13/test/recv-mshot-fair.c:102:12: branch_false: following ‘false’ branch (when ‘ret >= 0’)... liburing-2.13/test/recv-mshot-fair.c:107:15: branch_false: ...to here liburing-2.13/test/recv-mshot-fair.c:108:12: branch_true: following ‘true’ branch (when ‘ret < 0’)... liburing-2.13/test/recv-mshot-fair.c:109:17: branch_true: ...to here liburing-2.13/test/recv-mshot-fair.c:131:9: throw: if ‘close’ throws an exception... liburing-2.13/test/recv-mshot-fair.c:131:9: danger: ‘sockfd’ leaks here # 129| return 0; # 130| err: # 131|-> close(sockfd); # 132| return 1; # 133| } Error: CPPCHECK_WARNING (CWE-476): [#def77] liburing-2.13/test/recv-mshot-fair.c:344: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: buf # 342| # 343| buf = malloc(4096); # 344|-> memset(buf, 0xa5, 4096); # 345| # 346| saddr.sin_family = AF_INET; Error: GCC_ANALYZER_WARNING (CWE-688): [#def78] liburing-2.13/test/recv-mshot-fair.c:344:9: warning[-Wanalyzer-possible-null-argument]: use of possibly-NULL ‘buf’ where non-null expected liburing-2.13/test/recv-mshot-fair.c:343:15: acquire_memory: this call could return NULL liburing-2.13/test/recv-mshot-fair.c:344:9: danger: argument 1 (‘buf’) from [(1)](sarif:/runs/0/results/4/codeFlows/0/threadFlows/0/locations/0) could be NULL where non-null expected # 342| # 343| buf = malloc(4096); # 344|-> memset(buf, 0xa5, 4096); # 345| # 346| saddr.sin_family = AF_INET; Error: GCC_ANALYZER_WARNING (CWE-401): [#def79] liburing-2.13/test/recv-mshot-fair.c:352:17: warning[-Wanalyzer-malloc-leak]: leak of ‘buf’ liburing-2.13/test/recv-mshot-fair.c:343:15: acquire_memory: allocated here liburing-2.13/test/recv-mshot-fair.c:351:12: branch_true: following ‘true’ branch (when ‘sockfd < 0’)... liburing-2.13/test/recv-mshot-fair.c:352:17: branch_true: ...to here liburing-2.13/test/recv-mshot-fair.c:352:17: throw: if ‘perror’ throws an exception... liburing-2.13/test/recv-mshot-fair.c:352:17: danger: ‘buf’ leaks here; was allocated at [(1)](sarif:/runs/0/results/5/codeFlows/0/threadFlows/0/locations/0) # 350| sockfd = socket(AF_INET, SOCK_STREAM, 0); # 351| if (sockfd < 0) { # 352|-> perror("socket"); # 353| goto err2; # 354| } Error: GCC_ANALYZER_WARNING (CWE-775): [#def80] liburing-2.13/test/recv-mshot-fair.c:358:15: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘sockfd’ liburing-2.13/test/recv-mshot-fair.c:350:18: acquire_resource: stream socket created here liburing-2.13/test/recv-mshot-fair.c:351:12: branch_false: following ‘false’ branch (when ‘sockfd >= 0’)... liburing-2.13/test/recv-mshot-fair.c:356:9: branch_false: ...to here liburing-2.13/test/recv-mshot-fair.c:358:15: throw: if ‘connect’ throws an exception... liburing-2.13/test/recv-mshot-fair.c:358:15: danger: ‘sockfd’ leaks here # 356| pthread_barrier_wait(&rd->connect); # 357| # 358|-> ret = connect(sockfd, (struct sockaddr *)&saddr, sizeof(saddr)); # 359| if (ret < 0) { # 360| perror("connect"); Error: GCC_ANALYZER_WARNING (CWE-401): [#def81] liburing-2.13/test/recv-mshot-fair.c:358:15: warning[-Wanalyzer-malloc-leak]: leak of ‘buf’ liburing-2.13/test/recv-mshot-fair.c:343:15: acquire_memory: allocated here liburing-2.13/test/recv-mshot-fair.c:351:12: branch_false: following ‘false’ branch (when ‘sockfd >= 0’)... liburing-2.13/test/recv-mshot-fair.c:356:9: branch_false: ...to here liburing-2.13/test/recv-mshot-fair.c:358:15: throw: if ‘connect’ throws an exception... liburing-2.13/test/recv-mshot-fair.c:358:15: danger: ‘buf’ leaks here; was allocated at [(1)](sarif:/runs/0/results/7/codeFlows/0/threadFlows/0/locations/0) # 356| pthread_barrier_wait(&rd->connect); # 357| # 358|-> ret = connect(sockfd, (struct sockaddr *)&saddr, sizeof(saddr)); # 359| if (ret < 0) { # 360| perror("connect"); Error: GCC_ANALYZER_WARNING (CWE-401): [#def82] liburing-2.13/test/recv-mshot-fair.c:360:17: warning[-Wanalyzer-malloc-leak]: leak of ‘buf’ liburing-2.13/test/recv-mshot-fair.c:343:15: acquire_memory: allocated here liburing-2.13/test/recv-mshot-fair.c:351:12: branch_false: following ‘false’ branch (when ‘sockfd >= 0’)... liburing-2.13/test/recv-mshot-fair.c:356:9: branch_false: ...to here liburing-2.13/test/recv-mshot-fair.c:359:12: branch_true: following ‘true’ branch... liburing-2.13/test/recv-mshot-fair.c:360:17: branch_true: ...to here liburing-2.13/test/recv-mshot-fair.c:360:17: throw: if ‘perror’ throws an exception... liburing-2.13/test/recv-mshot-fair.c:360:17: danger: ‘buf’ leaks here; was allocated at [(1)](sarif:/runs/0/results/8/codeFlows/0/threadFlows/0/locations/0) # 358| ret = connect(sockfd, (struct sockaddr *)&saddr, sizeof(saddr)); # 359| if (ret < 0) { # 360|-> perror("connect"); # 361| goto err; # 362| } Error: GCC_ANALYZER_WARNING (CWE-401): [#def83] liburing-2.13/test/recv-mshot-fair.c:367:23: warning[-Wanalyzer-malloc-leak]: leak of ‘buf’ liburing-2.13/test/recv-mshot-fair.c:343:15: acquire_memory: allocated here liburing-2.13/test/recv-mshot-fair.c:351:12: branch_false: following ‘false’ branch (when ‘sockfd >= 0’)... liburing-2.13/test/recv-mshot-fair.c:356:9: branch_false: ...to here liburing-2.13/test/recv-mshot-fair.c:359:12: branch_false: following ‘false’ branch... liburing-2.13/test/recv-mshot-fair.c:364:9: branch_false: ...to here liburing-2.13/test/recv-mshot-fair.c:366:21: branch_true: following ‘true’ branch... liburing-2.13/test/recv-mshot-fair.c:367:23: branch_true: ...to here liburing-2.13/test/recv-mshot-fair.c:367:23: throw: if ‘send’ throws an exception... liburing-2.13/test/recv-mshot-fair.c:367:23: danger: ‘buf’ leaks here; was allocated at [(1)](sarif:/runs/0/results/9/codeFlows/0/threadFlows/0/locations/0) # 365| # 366| for (i = 0; i < rd->max_sends; i++) { # 367|-> ret = send(sockfd, buf, 4096, 0); # 368| if (ret < 0) { # 369| perror("send"); Error: GCC_ANALYZER_WARNING (CWE-401): [#def84] liburing-2.13/test/recv-mshot-fair.c:369:25: warning[-Wanalyzer-malloc-leak]: leak of ‘buf’ liburing-2.13/test/recv-mshot-fair.c:343:15: acquire_memory: allocated here liburing-2.13/test/recv-mshot-fair.c:351:12: branch_false: following ‘false’ branch (when ‘sockfd >= 0’)... liburing-2.13/test/recv-mshot-fair.c:356:9: branch_false: ...to here liburing-2.13/test/recv-mshot-fair.c:359:12: branch_false: following ‘false’ branch... liburing-2.13/test/recv-mshot-fair.c:364:9: branch_false: ...to here liburing-2.13/test/recv-mshot-fair.c:366:21: branch_true: following ‘true’ branch... liburing-2.13/test/recv-mshot-fair.c:367:23: branch_true: ...to here liburing-2.13/test/recv-mshot-fair.c:369:25: throw: if ‘perror’ throws an exception... liburing-2.13/test/recv-mshot-fair.c:369:25: danger: ‘buf’ leaks here; was allocated at [(1)](sarif:/runs/0/results/10/codeFlows/0/threadFlows/0/locations/0) # 367| ret = send(sockfd, buf, 4096, 0); # 368| if (ret < 0) { # 369|-> perror("send"); # 370| return 1; # 371| } else if (ret != 4096) { Error: GCC_ANALYZER_WARNING (CWE-401): [#def85] liburing-2.13/test/recv-mshot-fair.c:378:9: warning[-Wanalyzer-malloc-leak]: leak of ‘buf’ liburing-2.13/test/recv-mshot-fair.c:343:15: acquire_memory: allocated here liburing-2.13/test/recv-mshot-fair.c:351:12: branch_false: following ‘false’ branch (when ‘sockfd >= 0’)... liburing-2.13/test/recv-mshot-fair.c:356:9: branch_false: ...to here liburing-2.13/test/recv-mshot-fair.c:359:12: branch_false: following ‘false’ branch... liburing-2.13/test/recv-mshot-fair.c:364:9: branch_false: ...to here liburing-2.13/test/recv-mshot-fair.c:378:9: throw: if ‘close’ throws an exception... liburing-2.13/test/recv-mshot-fair.c:378:9: danger: ‘buf’ leaks here; was allocated at [(1)](sarif:/runs/0/results/11/codeFlows/0/threadFlows/0/locations/0) # 376| # 377| pthread_barrier_wait(&rd->barrier); # 378|-> close(sockfd); # 379| free(buf); # 380| return 0; Error: GCC_ANALYZER_WARNING (CWE-401): [#def86] liburing-2.13/test/recv-mshot-fair.c:382:9: warning[-Wanalyzer-malloc-leak]: leak of ‘buf’ liburing-2.13/test/recv-mshot-fair.c:343:15: acquire_memory: allocated here liburing-2.13/test/recv-mshot-fair.c:351:12: branch_false: following ‘false’ branch (when ‘sockfd >= 0’)... liburing-2.13/test/recv-mshot-fair.c:356:9: branch_false: ...to here liburing-2.13/test/recv-mshot-fair.c:382:9: throw: if ‘close’ throws an exception... liburing-2.13/test/recv-mshot-fair.c:382:9: danger: ‘buf’ leaks here; was allocated at [(1)](sarif:/runs/0/results/12/codeFlows/0/threadFlows/0/locations/0) # 380| return 0; # 381| err: # 382|-> close(sockfd); # 383| err2: # 384| free(buf); Error: GCC_ANALYZER_WARNING (CWE-401): [#def87] liburing-2.13/test/recv-mshot-fair.c:386:1: warning[-Wanalyzer-malloc-leak]: leak of ‘buf’ liburing-2.13/test/recv-mshot-fair.c:343:15: acquire_memory: allocated here liburing-2.13/test/recv-mshot-fair.c:351:12: branch_false: following ‘false’ branch (when ‘sockfd >= 0’)... liburing-2.13/test/recv-mshot-fair.c:356:9: branch_false: ...to here liburing-2.13/test/recv-mshot-fair.c:359:12: branch_false: following ‘false’ branch... liburing-2.13/test/recv-mshot-fair.c:364:9: branch_false: ...to here liburing-2.13/test/recv-mshot-fair.c:366:21: branch_true: following ‘true’ branch... liburing-2.13/test/recv-mshot-fair.c:367:23: branch_true: ...to here liburing-2.13/test/recv-mshot-fair.c:386:1: danger: ‘buf’ leaks here; was allocated at [(1)](sarif:/runs/0/results/13/codeFlows/0/threadFlows/0/locations/0) # 384| free(buf); # 385| return 1; # 386|-> } # 387| # 388| struct res { Error: GCC_ANALYZER_WARNING (CWE-775): [#def88] liburing-2.13/test/ring-leak.c:196:23: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘fds[0]’ liburing-2.13/test/ring-leak.c:163:12: branch_false: following ‘false’ branch... liburing-2.13/test/ring-leak.c:167:15: branch_false: ...to here liburing-2.13/test/ring-leak.c:168:12: branch_false: following ‘false’ branch... liburing-2.13/test/ring-leak.c:172:13: branch_false: ...to here liburing-2.13/test/ring-leak.c:172:12: branch_false: following ‘false’ branch... liburing-2.13/test/ring-leak.c:176:15: branch_false: ...to here liburing-2.13/test/ring-leak.c:177:12: branch_false: following ‘false’ branch... liburing-2.13/test/ring-leak.c:181:12: branch_false: ...to here liburing-2.13/test/ring-leak.c:182:29: branch_true: following ‘true’ branch (when ‘i != 4’)... liburing-2.13/test/ring-leak.c:183:25: branch_true: ...to here liburing-2.13/test/ring-leak.c:185:20: branch_false: following ‘false’ branch... liburing-2.13/test/ring-leak.c:191:22: branch_false: ...to here liburing-2.13/test/ring-leak.c:195:12: branch_true: following ‘true’ branch (when ‘update != 0’)... liburing-2.13/test/ring-leak.c:196:23: branch_true: ...to here liburing-2.13/test/ring-leak.c:196:23: throw: if ‘io_uring_register_files_update’ throws an exception... liburing-2.13/test/ring-leak.c:196:23: danger: ‘fds[0]’ leaks here # 194| reg_fds[3] = sp[1]; # 195| if (update) { # 196|-> ret = io_uring_register_files_update(&ring, 0, reg_fds, 4); # 197| if (ret != 4) { # 198| fprintf(stderr, "file_register: %d\n", ret); Error: GCC_ANALYZER_WARNING (CWE-775): [#def89] liburing-2.13/test/ring-leak.c:196:23: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘fds[1]’ liburing-2.13/test/ring-leak.c:163:12: branch_false: following ‘false’ branch... liburing-2.13/test/ring-leak.c:167:15: branch_false: ...to here liburing-2.13/test/ring-leak.c:168:12: branch_false: following ‘false’ branch... liburing-2.13/test/ring-leak.c:172:13: branch_false: ...to here liburing-2.13/test/ring-leak.c:172:12: branch_false: following ‘false’ branch... liburing-2.13/test/ring-leak.c:176:15: branch_false: ...to here liburing-2.13/test/ring-leak.c:177:12: branch_false: following ‘false’ branch... liburing-2.13/test/ring-leak.c:181:12: branch_false: ...to here liburing-2.13/test/ring-leak.c:182:29: branch_true: following ‘true’ branch (when ‘i != 4’)... liburing-2.13/test/ring-leak.c:183:25: branch_true: ...to here liburing-2.13/test/ring-leak.c:185:20: branch_false: following ‘false’ branch... liburing-2.13/test/ring-leak.c:191:22: branch_false: ...to here liburing-2.13/test/ring-leak.c:195:12: branch_true: following ‘true’ branch (when ‘update != 0’)... liburing-2.13/test/ring-leak.c:196:23: branch_true: ...to here liburing-2.13/test/ring-leak.c:196:23: throw: if ‘io_uring_register_files_update’ throws an exception... liburing-2.13/test/ring-leak.c:196:23: danger: ‘fds[1]’ leaks here # 194| reg_fds[3] = sp[1]; # 195| if (update) { # 196|-> ret = io_uring_register_files_update(&ring, 0, reg_fds, 4); # 197| if (ret != 4) { # 198| fprintf(stderr, "file_register: %d\n", ret); Error: CPPCHECK_WARNING (CWE-457): [#def90] liburing-2.13/test/ring-query.c:42: error[uninitvar]: Uninitialized variable: &op # 40| struct io_uring_query_hdr hdr = { # 41| .query_op = IO_URING_QUERY_OPCODES, # 42|-> .query_data = uring_ptr_to_u64(&op), # 43| .size = sizeof(op), # 44| }; Error: CPPCHECK_WARNING (CWE-457): [#def91] liburing-2.13/test/ring-query.c:82: error[uninitvar]: Uninitialized variable: &op # 80| struct io_uring_query_hdr invalid_hdr = { # 81| .query_op = -1U, # 82|-> .query_data = uring_ptr_to_u64(&op), # 83| .size = sizeof(struct io_uring_query_opcode), # 84| }; Error: CPPCHECK_WARNING (CWE-457): [#def92] liburing-2.13/test/ring-query.c:125: error[uninitvar]: Uninitialized variable: &op3 # 123| struct io_uring_query_hdr hdr3 = { # 124| .query_op = IO_URING_QUERY_OPCODES, # 125|-> .query_data = uring_ptr_to_u64(&op3), # 126| .size = sizeof(struct io_uring_query_opcode), # 127| }; Error: CPPCHECK_WARNING (CWE-457): [#def93] liburing-2.13/test/ring-query.c:130: error[uninitvar]: Uninitialized variable: &op2 # 128| struct io_uring_query_hdr hdr2 = { # 129| .query_op = IO_URING_QUERY_OPCODES, # 130|-> .query_data = uring_ptr_to_u64(&op2), # 131| .size = sizeof(struct io_uring_query_opcode), # 132| .next_entry = uring_ptr_to_u64(&hdr3), Error: CPPCHECK_WARNING (CWE-457): [#def94] liburing-2.13/test/ring-query.c:136: error[uninitvar]: Uninitialized variable: &op1 # 134| struct io_uring_query_hdr hdr1 = { # 135| .query_op = IO_URING_QUERY_OPCODES, # 136|-> .query_data = uring_ptr_to_u64(&op1), # 137| .size = sizeof(struct io_uring_query_opcode), # 138| .next_entry = uring_ptr_to_u64(&hdr2), Error: CPPCHECK_WARNING (CWE-457): [#def95] liburing-2.13/test/ring-query.c:169: error[uninitvar]: Uninitialized variable: &op2 # 167| struct io_uring_query_hdr hdr2 = { # 168| .query_op = IO_URING_QUERY_OPCODES, # 169|-> .query_data = uring_ptr_to_u64(&op2), # 170| .size = sizeof(struct io_uring_query_opcode), # 171| }; Error: CPPCHECK_WARNING (CWE-457): [#def96] liburing-2.13/test/ring-query.c:174: error[uninitvar]: Uninitialized variable: &op1 # 172| struct io_uring_query_hdr hdr1 = { # 173| .query_op = IO_URING_QUERY_OPCODES, # 174|-> .query_data = uring_ptr_to_u64(&op1), # 175| .size = sizeof(struct io_uring_query_opcode), # 176| }; Error: CPPCHECK_WARNING (CWE-457): [#def97] liburing-2.13/test/ring-query.c:207: error[uninitvar]: Uninitialized variable: &op # 205| struct io_uring_query_hdr hdr = { # 206| .query_op = IO_URING_QUERY_OPCODES, # 207|-> .query_data = uring_ptr_to_u64(&op), # 208| .size = sizeof(op), # 209| }; Error: CPPCHECK_WARNING (CWE-457): [#def98] liburing-2.13/test/ring-query.c:240: error[uninitvar]: Uninitialized variable: &op # 238| struct io_uring_query_hdr hdr = { # 239| .query_op = IO_URING_QUERY_OPCODES, # 240|-> .query_data = uring_ptr_to_u64(&op), # 241| .size = sizeof(op), # 242| }; Error: GCC_ANALYZER_WARNING (CWE-401): [#def99] liburing-2.13/test/ringbuf-loop.c:66:15: warning[-Wanalyzer-malloc-leak]: leak of ‘send_buf’ liburing-2.13/test/ringbuf-loop.c:23:5: enter_function: entry to ‘main’ liburing-2.13/test/ringbuf-loop.c:31:12: branch_false: following ‘false’ branch (when ‘argc <= 1’)... liburing-2.13/test/ringbuf-loop.c:34:15: branch_false: ...to here liburing-2.13/test/ringbuf-loop.c:35:12: branch_false: following ‘false’ branch... liburing-2.13/test/ringbuf-loop.c:42:14: branch_false: ...to here liburing-2.13/test/ringbuf-loop.c:43:12: branch_false: following ‘false’ branch... liburing-2.13/test/ringbuf-loop.c:54:9: call_function: inlined call to ‘io_uring_buf_ring_add’ from ‘main’ liburing-2.13/test/ringbuf-loop.c:57:12: branch_false: following ‘false’ branch... liburing-2.13/test/ringbuf-loop.c:65:20: branch_false: ...to here liburing-2.13/test/ringbuf-loop.c:65:20: acquire_memory: allocated here liburing-2.13/test/ringbuf-loop.c:66:15: throw: if ‘send’ throws an exception... liburing-2.13/test/ringbuf-loop.c:66:15: danger: ‘send_buf’ leaks here; was allocated at [(11)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/10) # 64| */ # 65| send_buf = calloc(1, 32); # 66|-> ret = send(fds[0], send_buf, 32, MSG_DONTWAIT); # 67| if (ret < 0) { # 68| perror("send"); Error: GCC_ANALYZER_WARNING (CWE-401): [#def100] liburing-2.13/test/ringbuf-loop.c:68:17: warning[-Wanalyzer-malloc-leak]: leak of ‘send_buf’ liburing-2.13/test/ringbuf-loop.c:23:5: enter_function: entry to ‘main’ liburing-2.13/test/ringbuf-loop.c:31:12: branch_false: following ‘false’ branch (when ‘argc <= 1’)... liburing-2.13/test/ringbuf-loop.c:34:15: branch_false: ...to here liburing-2.13/test/ringbuf-loop.c:35:12: branch_false: following ‘false’ branch... liburing-2.13/test/ringbuf-loop.c:42:14: branch_false: ...to here liburing-2.13/test/ringbuf-loop.c:43:12: branch_false: following ‘false’ branch... liburing-2.13/test/ringbuf-loop.c:54:9: call_function: inlined call to ‘io_uring_buf_ring_add’ from ‘main’ liburing-2.13/test/ringbuf-loop.c:57:12: branch_false: following ‘false’ branch... liburing-2.13/test/ringbuf-loop.c:65:20: branch_false: ...to here liburing-2.13/test/ringbuf-loop.c:65:20: acquire_memory: allocated here liburing-2.13/test/ringbuf-loop.c:67:12: branch_true: following ‘true’ branch... liburing-2.13/test/ringbuf-loop.c:68:17: branch_true: ...to here liburing-2.13/test/ringbuf-loop.c:68:17: throw: if ‘perror’ throws an exception... liburing-2.13/test/ringbuf-loop.c:68:17: danger: ‘send_buf’ leaks here; was allocated at [(11)](sarif:/runs/0/results/2/codeFlows/0/threadFlows/0/locations/10) # 66| ret = send(fds[0], send_buf, 32, MSG_DONTWAIT); # 67| if (ret < 0) { # 68|-> perror("send"); # 69| return T_EXIT_FAIL; # 70| } Error: GCC_ANALYZER_WARNING (CWE-401): [#def101] liburing-2.13/test/ringbuf-loop.c:81:9: warning[-Wanalyzer-malloc-leak]: leak of ‘send_buf’ liburing-2.13/test/ringbuf-loop.c:23:5: enter_function: entry to ‘main’ liburing-2.13/test/ringbuf-loop.c:31:12: branch_false: following ‘false’ branch (when ‘argc <= 1’)... liburing-2.13/test/ringbuf-loop.c:34:15: branch_false: ...to here liburing-2.13/test/ringbuf-loop.c:35:12: branch_false: following ‘false’ branch... liburing-2.13/test/ringbuf-loop.c:42:14: branch_false: ...to here liburing-2.13/test/ringbuf-loop.c:43:12: branch_false: following ‘false’ branch... liburing-2.13/test/ringbuf-loop.c:54:9: call_function: inlined call to ‘io_uring_buf_ring_add’ from ‘main’ liburing-2.13/test/ringbuf-loop.c:57:12: branch_false: following ‘false’ branch... liburing-2.13/test/ringbuf-loop.c:65:20: branch_false: ...to here liburing-2.13/test/ringbuf-loop.c:65:20: acquire_memory: allocated here liburing-2.13/test/ringbuf-loop.c:67:12: branch_false: following ‘false’ branch... liburing-2.13/test/ringbuf-loop.c:77:15: call_function: inlined call to ‘io_uring_get_sqe’ from ‘main’ liburing-2.13/test/ringbuf-loop.c:77:15: call_function: inlined call to ‘io_uring_get_sqe’ from ‘main’ liburing-2.13/test/ringbuf-loop.c:81:9: throw: if ‘io_uring_submit_and_wait’ throws an exception... liburing-2.13/test/ringbuf-loop.c:81:9: danger: ‘send_buf’ leaks here; was allocated at [(11)](sarif:/runs/0/results/3/codeFlows/0/threadFlows/0/locations/10) # 79| sqe->flags |= IOSQE_BUFFER_SELECT; # 80| sqe->buf_index = BGID; # 81|-> io_uring_submit_and_wait(&ring, 1); # 82| # 83| io_uring_free_buf_ring(&ring, br, RENTRIES, BGID); Error: GCC_ANALYZER_WARNING (CWE-401): [#def102] liburing-2.13/test/ringbuf-loop.c:83:9: warning[-Wanalyzer-malloc-leak]: leak of ‘send_buf’ liburing-2.13/test/ringbuf-loop.c:23:5: enter_function: entry to ‘main’ liburing-2.13/test/ringbuf-loop.c:31:12: branch_false: following ‘false’ branch (when ‘argc <= 1’)... liburing-2.13/test/ringbuf-loop.c:34:15: branch_false: ...to here liburing-2.13/test/ringbuf-loop.c:35:12: branch_false: following ‘false’ branch... liburing-2.13/test/ringbuf-loop.c:42:14: branch_false: ...to here liburing-2.13/test/ringbuf-loop.c:43:12: branch_false: following ‘false’ branch... liburing-2.13/test/ringbuf-loop.c:54:9: call_function: inlined call to ‘io_uring_buf_ring_add’ from ‘main’ liburing-2.13/test/ringbuf-loop.c:57:12: branch_false: following ‘false’ branch... liburing-2.13/test/ringbuf-loop.c:65:20: branch_false: ...to here liburing-2.13/test/ringbuf-loop.c:65:20: acquire_memory: allocated here liburing-2.13/test/ringbuf-loop.c:67:12: branch_false: following ‘false’ branch... liburing-2.13/test/ringbuf-loop.c:77:15: call_function: inlined call to ‘io_uring_get_sqe’ from ‘main’ liburing-2.13/test/ringbuf-loop.c:77:15: call_function: inlined call to ‘io_uring_get_sqe’ from ‘main’ liburing-2.13/test/ringbuf-loop.c:83:9: throw: if ‘io_uring_free_buf_ring’ throws an exception... liburing-2.13/test/ringbuf-loop.c:83:9: danger: ‘send_buf’ leaks here; was allocated at [(11)](sarif:/runs/0/results/4/codeFlows/0/threadFlows/0/locations/10) # 81| io_uring_submit_and_wait(&ring, 1); # 82| # 83|-> io_uring_free_buf_ring(&ring, br, RENTRIES, BGID); # 84| io_uring_queue_exit(&ring); # 85| free(send_buf); Error: GCC_ANALYZER_WARNING (CWE-401): [#def103] liburing-2.13/test/ringbuf-loop.c:84:9: warning[-Wanalyzer-malloc-leak]: leak of ‘send_buf’ liburing-2.13/test/ringbuf-loop.c:23:5: enter_function: entry to ‘main’ liburing-2.13/test/ringbuf-loop.c:31:12: branch_false: following ‘false’ branch (when ‘argc <= 1’)... liburing-2.13/test/ringbuf-loop.c:34:15: branch_false: ...to here liburing-2.13/test/ringbuf-loop.c:35:12: branch_false: following ‘false’ branch... liburing-2.13/test/ringbuf-loop.c:42:14: branch_false: ...to here liburing-2.13/test/ringbuf-loop.c:43:12: branch_false: following ‘false’ branch... liburing-2.13/test/ringbuf-loop.c:54:9: call_function: inlined call to ‘io_uring_buf_ring_add’ from ‘main’ liburing-2.13/test/ringbuf-loop.c:57:12: branch_false: following ‘false’ branch... liburing-2.13/test/ringbuf-loop.c:65:20: branch_false: ...to here liburing-2.13/test/ringbuf-loop.c:65:20: acquire_memory: allocated here liburing-2.13/test/ringbuf-loop.c:67:12: branch_false: following ‘false’ branch... liburing-2.13/test/ringbuf-loop.c:77:15: call_function: inlined call to ‘io_uring_get_sqe’ from ‘main’ liburing-2.13/test/ringbuf-loop.c:77:15: call_function: inlined call to ‘io_uring_get_sqe’ from ‘main’ liburing-2.13/test/ringbuf-loop.c:84:9: throw: if ‘io_uring_queue_exit’ throws an exception... liburing-2.13/test/ringbuf-loop.c:84:9: danger: ‘send_buf’ leaks here; was allocated at [(11)](sarif:/runs/0/results/5/codeFlows/0/threadFlows/0/locations/10) # 82| # 83| io_uring_free_buf_ring(&ring, br, RENTRIES, BGID); # 84|-> io_uring_queue_exit(&ring); # 85| free(send_buf); # 86| return T_EXIT_PASS; Error: GCC_ANALYZER_WARNING (CWE-775): [#def104] liburing-2.13/test/sendmsg_iov_clean.c:49:15: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘sockfd’ liburing-2.13/test/sendmsg_iov_clean.c:43:18: acquire_resource: stream socket created here liburing-2.13/test/sendmsg_iov_clean.c:44:12: branch_false: following ‘false’ branch (when ‘sockfd >= 0’)... liburing-2.13/test/sendmsg_iov_clean.c:49:15: branch_false: ...to here liburing-2.13/test/sendmsg_iov_clean.c:49:15: throw: if ‘connect’ throws an exception... liburing-2.13/test/sendmsg_iov_clean.c:49:15: danger: ‘sockfd’ leaks here # 47| } # 48| # 49|-> ret = connect(sockfd, (struct sockaddr *) &saddr, sizeof(saddr)); # 50| if (ret < 0) { # 51| perror("connect"); Error: GCC_ANALYZER_WARNING (CWE-775): [#def105] liburing-2.13/test/sendmsg_iov_clean.c:153:17: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘sockfd’ liburing-2.13/test/sendmsg_iov_clean.c:126:12: branch_false: following ‘false’ branch (when ‘argc <= 1’)... liburing-2.13/test/sendmsg_iov_clean.c:129:9: branch_false: ...to here liburing-2.13/test/sendmsg_iov_clean.c:134:18: acquire_resource: stream socket created here liburing-2.13/test/sendmsg_iov_clean.c:135:12: branch_false: following ‘false’ branch (when ‘sockfd >= 0’)... liburing-2.13/test/sendmsg_iov_clean.c:140:9: branch_false: ...to here liburing-2.13/test/sendmsg_iov_clean.c:145:12: branch_false: following ‘false’ branch (when ‘ret >= 0’)... liburing-2.13/test/sendmsg_iov_clean.c:151:15: branch_false: ...to here liburing-2.13/test/sendmsg_iov_clean.c:152:12: branch_true: following ‘true’ branch (when ‘ret < 0’)... liburing-2.13/test/sendmsg_iov_clean.c:153:17: branch_true: ...to here liburing-2.13/test/sendmsg_iov_clean.c:153:17: throw: if ‘perror’ throws an exception... liburing-2.13/test/sendmsg_iov_clean.c:153:17: danger: ‘sockfd’ leaks here # 151| ret = listen(sockfd, 1); # 152| if (ret < 0) { # 153|-> perror("listen"); # 154| close(sockfd); # 155| return T_EXIT_FAIL; Error: GCC_ANALYZER_WARNING (CWE-775): [#def106] liburing-2.13/test/sendmsg_iov_clean.c:154:17: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘sockfd’ liburing-2.13/test/sendmsg_iov_clean.c:126:12: branch_false: following ‘false’ branch (when ‘argc <= 1’)... liburing-2.13/test/sendmsg_iov_clean.c:129:9: branch_false: ...to here liburing-2.13/test/sendmsg_iov_clean.c:134:18: acquire_resource: stream socket created here liburing-2.13/test/sendmsg_iov_clean.c:135:12: branch_false: following ‘false’ branch (when ‘sockfd >= 0’)... liburing-2.13/test/sendmsg_iov_clean.c:140:9: branch_false: ...to here liburing-2.13/test/sendmsg_iov_clean.c:145:12: branch_false: following ‘false’ branch (when ‘ret >= 0’)... liburing-2.13/test/sendmsg_iov_clean.c:151:15: branch_false: ...to here liburing-2.13/test/sendmsg_iov_clean.c:152:12: branch_true: following ‘true’ branch (when ‘ret < 0’)... liburing-2.13/test/sendmsg_iov_clean.c:153:17: branch_true: ...to here liburing-2.13/test/sendmsg_iov_clean.c:154:17: throw: if ‘close’ throws an exception... liburing-2.13/test/sendmsg_iov_clean.c:154:17: danger: ‘sockfd’ leaks here # 152| if (ret < 0) { # 153| perror("listen"); # 154|-> close(sockfd); # 155| return T_EXIT_FAIL; # 156| } Error: GCC_ANALYZER_WARNING (CWE-775): [#def107] liburing-2.13/test/sendmsg_iov_clean.c:158:15: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘sockfd’ liburing-2.13/test/sendmsg_iov_clean.c:126:12: branch_false: following ‘false’ branch (when ‘argc <= 1’)... liburing-2.13/test/sendmsg_iov_clean.c:129:9: branch_false: ...to here liburing-2.13/test/sendmsg_iov_clean.c:134:18: acquire_resource: stream socket created here liburing-2.13/test/sendmsg_iov_clean.c:135:12: branch_false: following ‘false’ branch (when ‘sockfd >= 0’)... liburing-2.13/test/sendmsg_iov_clean.c:140:9: branch_false: ...to here liburing-2.13/test/sendmsg_iov_clean.c:145:12: branch_false: following ‘false’ branch (when ‘ret >= 0’)... liburing-2.13/test/sendmsg_iov_clean.c:151:15: branch_false: ...to here liburing-2.13/test/sendmsg_iov_clean.c:152:12: branch_false: following ‘false’ branch (when ‘ret >= 0’)... liburing-2.13/test/sendmsg_iov_clean.c:158:15: branch_false: ...to here liburing-2.13/test/sendmsg_iov_clean.c:158:15: throw: if ‘io_uring_queue_init’ throws an exception... liburing-2.13/test/sendmsg_iov_clean.c:158:15: danger: ‘sockfd’ leaks here # 156| } # 157| # 158|-> ret = io_uring_queue_init(INFLIGHT, &ring, IORING_SETUP_SINGLE_ISSUER | # 159| IORING_SETUP_DEFER_TASKRUN); # 160| if (ret == -EINVAL) { Error: GCC_ANALYZER_WARNING (CWE-775): [#def108] liburing-2.13/test/sendmsg_iov_clean.c:161:17: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘sockfd’ liburing-2.13/test/sendmsg_iov_clean.c:126:12: branch_false: following ‘false’ branch (when ‘argc <= 1’)... liburing-2.13/test/sendmsg_iov_clean.c:129:9: branch_false: ...to here liburing-2.13/test/sendmsg_iov_clean.c:134:18: acquire_resource: stream socket created here liburing-2.13/test/sendmsg_iov_clean.c:135:12: branch_false: following ‘false’ branch (when ‘sockfd >= 0’)... liburing-2.13/test/sendmsg_iov_clean.c:140:9: branch_false: ...to here liburing-2.13/test/sendmsg_iov_clean.c:145:12: branch_false: following ‘false’ branch (when ‘ret >= 0’)... liburing-2.13/test/sendmsg_iov_clean.c:151:15: branch_false: ...to here liburing-2.13/test/sendmsg_iov_clean.c:152:12: branch_false: following ‘false’ branch (when ‘ret >= 0’)... liburing-2.13/test/sendmsg_iov_clean.c:158:15: branch_false: ...to here liburing-2.13/test/sendmsg_iov_clean.c:160:12: branch_true: following ‘true’ branch... liburing-2.13/test/sendmsg_iov_clean.c:161:17: branch_true: ...to here liburing-2.13/test/sendmsg_iov_clean.c:161:17: throw: if ‘close’ throws an exception... liburing-2.13/test/sendmsg_iov_clean.c:161:17: danger: ‘sockfd’ leaks here # 159| IORING_SETUP_DEFER_TASKRUN); # 160| if (ret == -EINVAL) { # 161|-> close(sockfd); # 162| return T_EXIT_SKIP; # 163| } Error: GCC_ANALYZER_WARNING (CWE-775): [#def109] liburing-2.13/test/shutdown.c:61:9: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘recv_s0’ liburing-2.13/test/shutdown.c:35:12: branch_false: following ‘false’ branch (when ‘argc <= 1’)... liburing-2.13/test/shutdown.c:38:15: branch_false: ...to here liburing-2.13/test/shutdown.c:40:19: acquire_resource: socket created here liburing-2.13/test/shutdown.c:43:9: branch_true: following ‘true’ branch (when ‘ret != -1’)... liburing-2.13/test/shutdown.c:44:15: branch_true: ...to here liburing-2.13/test/shutdown.c:45:9: branch_true: following ‘true’ branch (when ‘ret != -1’)... liburing-2.13/test/shutdown.c:47:9: branch_true: ...to here liburing-2.13/test/shutdown.c:51:9: branch_true: following ‘true’ branch... liburing-2.13/test/shutdown.c:52:15: branch_true: ...to here liburing-2.13/test/shutdown.c:53:9: branch_true: following ‘true’ branch (when ‘ret != -1’)... liburing-2.13/test/shutdown.c:55:19: branch_true: ...to here liburing-2.13/test/shutdown.c:59:9: branch_true: following ‘true’ branch (when ‘ret != -1’)... liburing-2.13/test/shutdown.c:61:9: branch_true: ...to here liburing-2.13/test/shutdown.c:61:9: throw: if ‘t_set_nonblock’ throws an exception... liburing-2.13/test/shutdown.c:61:9: danger: ‘recv_s0’ leaks here # 59| assert(ret != -1); # 60| # 61|-> t_set_nonblock(p_fd[1]); # 62| # 63| ret = connect(p_fd[1], (struct sockaddr*)&addr, sizeof(addr)); Error: GCC_ANALYZER_WARNING (CWE-775): [#def110] liburing-2.13/test/shutdown.c:66:9: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘recv_s0’ liburing-2.13/test/shutdown.c:35:12: branch_false: following ‘false’ branch (when ‘argc <= 1’)... liburing-2.13/test/shutdown.c:38:15: branch_false: ...to here liburing-2.13/test/shutdown.c:40:19: acquire_resource: socket created here liburing-2.13/test/shutdown.c:43:9: branch_true: following ‘true’ branch (when ‘ret != -1’)... liburing-2.13/test/shutdown.c:44:15: branch_true: ...to here liburing-2.13/test/shutdown.c:45:9: branch_true: following ‘true’ branch (when ‘ret != -1’)... liburing-2.13/test/shutdown.c:47:9: branch_true: ...to here liburing-2.13/test/shutdown.c:51:9: branch_true: following ‘true’ branch... liburing-2.13/test/shutdown.c:52:15: branch_true: ...to here liburing-2.13/test/shutdown.c:53:9: branch_true: following ‘true’ branch (when ‘ret != -1’)... liburing-2.13/test/shutdown.c:55:19: branch_true: ...to here liburing-2.13/test/shutdown.c:59:9: branch_true: following ‘true’ branch (when ‘ret != -1’)... liburing-2.13/test/shutdown.c:61:9: branch_true: ...to here liburing-2.13/test/shutdown.c:64:9: branch_true: following ‘true’ branch... liburing-2.13/test/shutdown.c:66:9: branch_true: ...to here liburing-2.13/test/shutdown.c:66:9: throw: if ‘t_clear_nonblock’ throws an exception... liburing-2.13/test/shutdown.c:66:9: danger: ‘recv_s0’ leaks here # 64| assert(ret == -1); # 65| # 66|-> t_clear_nonblock(p_fd[1]); # 67| # 68| p_fd[0] = accept(recv_s0, NULL, NULL); Error: GCC_ANALYZER_WARNING (CWE-775): [#def111] liburing-2.13/test/socket-nb.c:54:9: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘recv_s0’ liburing-2.13/test/socket-nb.c:33:19: acquire_resource: socket created here liburing-2.13/test/socket-nb.c:37:9: branch_true: following ‘true’ branch (when ‘ret != -1’)... liburing-2.13/test/socket-nb.c:38:15: branch_true: ...to here liburing-2.13/test/socket-nb.c:39:9: branch_true: following ‘true’ branch (when ‘ret != -1’)... liburing-2.13/test/socket-nb.c:41:9: branch_true: ...to here liburing-2.13/test/socket-nb.c:44:9: branch_true: following ‘true’ branch... liburing-2.13/test/socket-nb.c:45:15: branch_true: ...to here liburing-2.13/test/socket-nb.c:46:9: branch_true: following ‘true’ branch (when ‘ret != -1’)... liburing-2.13/test/socket-nb.c:48:19: branch_true: ...to here liburing-2.13/test/socket-nb.c:52:9: branch_true: following ‘true’ branch (when ‘ret != -1’)... liburing-2.13/test/socket-nb.c:54:9: branch_true: ...to here liburing-2.13/test/socket-nb.c:54:9: throw: if ‘t_set_nonblock’ throws an exception... liburing-2.13/test/socket-nb.c:54:9: danger: ‘recv_s0’ leaks here # 52| assert(ret != -1); # 53| # 54|-> t_set_nonblock(p_fd[1]); # 55| # 56| ret = connect(p_fd[1], (struct sockaddr *) &addr, sizeof(addr)); Error: GCC_ANALYZER_WARNING (CWE-775): [#def112] liburing-2.13/test/socket-rw-eagain.c:56:9: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘recv_s0’ liburing-2.13/test/socket-rw-eagain.c:31:12: branch_false: following ‘false’ branch (when ‘argc <= 1’)... liburing-2.13/test/socket-rw-eagain.c:34:15: branch_false: ...to here liburing-2.13/test/socket-rw-eagain.c:36:19: acquire_resource: socket created here liburing-2.13/test/socket-rw-eagain.c:39:9: branch_true: following ‘true’ branch (when ‘ret != -1’)... liburing-2.13/test/socket-rw-eagain.c:40:15: branch_true: ...to here liburing-2.13/test/socket-rw-eagain.c:41:9: branch_true: following ‘true’ branch (when ‘ret != -1’)... liburing-2.13/test/socket-rw-eagain.c:43:9: branch_true: ...to here liburing-2.13/test/socket-rw-eagain.c:46:9: branch_true: following ‘true’ branch... liburing-2.13/test/socket-rw-eagain.c:47:15: branch_true: ...to here liburing-2.13/test/socket-rw-eagain.c:48:9: branch_true: following ‘true’ branch (when ‘ret != -1’)... liburing-2.13/test/socket-rw-eagain.c:50:19: branch_true: ...to here liburing-2.13/test/socket-rw-eagain.c:54:9: branch_true: following ‘true’ branch (when ‘ret != -1’)... liburing-2.13/test/socket-rw-eagain.c:56:9: branch_true: ...to here liburing-2.13/test/socket-rw-eagain.c:56:9: throw: if ‘t_set_nonblock’ throws an exception... liburing-2.13/test/socket-rw-eagain.c:56:9: danger: ‘recv_s0’ leaks here # 54| assert(ret != -1); # 55| # 56|-> t_set_nonblock(p_fd[1]); # 57| # 58| ret = connect(p_fd[1], (struct sockaddr*)&addr, sizeof(addr)); Error: GCC_ANALYZER_WARNING (CWE-775): [#def113] liburing-2.13/test/socket-rw-offset.c:59:9: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘recv_s0’ liburing-2.13/test/socket-rw-offset.c:33:12: branch_false: following ‘false’ branch (when ‘argc <= 1’)... liburing-2.13/test/socket-rw-offset.c:36:15: branch_false: ...to here liburing-2.13/test/socket-rw-offset.c:38:19: acquire_resource: socket created here liburing-2.13/test/socket-rw-offset.c:41:9: branch_true: following ‘true’ branch (when ‘ret != -1’)... liburing-2.13/test/socket-rw-offset.c:42:15: branch_true: ...to here liburing-2.13/test/socket-rw-offset.c:43:9: branch_true: following ‘true’ branch (when ‘ret != -1’)... liburing-2.13/test/socket-rw-offset.c:45:9: branch_true: ...to here liburing-2.13/test/socket-rw-offset.c:48:9: branch_true: following ‘true’ branch... liburing-2.13/test/socket-rw-offset.c:49:15: branch_true: ...to here liburing-2.13/test/socket-rw-offset.c:50:9: branch_true: following ‘true’ branch (when ‘ret != -1’)... liburing-2.13/test/socket-rw-offset.c:53:19: branch_true: ...to here liburing-2.13/test/socket-rw-offset.c:57:9: branch_true: following ‘true’ branch (when ‘ret != -1’)... liburing-2.13/test/socket-rw-offset.c:59:9: branch_true: ...to here liburing-2.13/test/socket-rw-offset.c:59:9: throw: if ‘t_set_nonblock’ throws an exception... liburing-2.13/test/socket-rw-offset.c:59:9: danger: ‘recv_s0’ leaks here # 57| assert(ret != -1); # 58| # 59|-> t_set_nonblock(p_fd[1]); # 60| # 61| ret = connect(p_fd[1], (struct sockaddr*)&addr, sizeof(addr)); Error: GCC_ANALYZER_WARNING (CWE-775): [#def114] liburing-2.13/test/socket-rw-offset.c:64:9: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘recv_s0’ liburing-2.13/test/socket-rw-offset.c:33:12: branch_false: following ‘false’ branch (when ‘argc <= 1’)... liburing-2.13/test/socket-rw-offset.c:36:15: branch_false: ...to here liburing-2.13/test/socket-rw-offset.c:38:19: acquire_resource: socket created here liburing-2.13/test/socket-rw-offset.c:41:9: branch_true: following ‘true’ branch (when ‘ret != -1’)... liburing-2.13/test/socket-rw-offset.c:42:15: branch_true: ...to here liburing-2.13/test/socket-rw-offset.c:43:9: branch_true: following ‘true’ branch (when ‘ret != -1’)... liburing-2.13/test/socket-rw-offset.c:45:9: branch_true: ...to here liburing-2.13/test/socket-rw-offset.c:48:9: branch_true: following ‘true’ branch... liburing-2.13/test/socket-rw-offset.c:49:15: branch_true: ...to here liburing-2.13/test/socket-rw-offset.c:50:9: branch_true: following ‘true’ branch (when ‘ret != -1’)... liburing-2.13/test/socket-rw-offset.c:53:19: branch_true: ...to here liburing-2.13/test/socket-rw-offset.c:57:9: branch_true: following ‘true’ branch (when ‘ret != -1’)... liburing-2.13/test/socket-rw-offset.c:59:9: branch_true: ...to here liburing-2.13/test/socket-rw-offset.c:62:9: branch_true: following ‘true’ branch... liburing-2.13/test/socket-rw-offset.c:64:9: branch_true: ...to here liburing-2.13/test/socket-rw-offset.c:64:9: throw: if ‘t_clear_nonblock’ throws an exception... liburing-2.13/test/socket-rw-offset.c:64:9: danger: ‘recv_s0’ leaks here # 62| assert(ret == -1); # 63| # 64|-> t_clear_nonblock(p_fd[1]); # 65| # 66| p_fd[0] = accept(recv_s0, NULL, NULL); Error: GCC_ANALYZER_WARNING (CWE-775): [#def115] liburing-2.13/test/socket-rw.c:59:9: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘recv_s0’ liburing-2.13/test/socket-rw.c:33:12: branch_false: following ‘false’ branch (when ‘argc <= 1’)... liburing-2.13/test/socket-rw.c:36:15: branch_false: ...to here liburing-2.13/test/socket-rw.c:38:19: acquire_resource: socket created here liburing-2.13/test/socket-rw.c:41:9: branch_true: following ‘true’ branch (when ‘ret != -1’)... liburing-2.13/test/socket-rw.c:42:15: branch_true: ...to here liburing-2.13/test/socket-rw.c:43:9: branch_true: following ‘true’ branch (when ‘ret != -1’)... liburing-2.13/test/socket-rw.c:45:9: branch_true: ...to here liburing-2.13/test/socket-rw.c:48:9: branch_true: following ‘true’ branch... liburing-2.13/test/socket-rw.c:49:15: branch_true: ...to here liburing-2.13/test/socket-rw.c:50:9: branch_true: following ‘true’ branch (when ‘ret != -1’)... liburing-2.13/test/socket-rw.c:53:19: branch_true: ...to here liburing-2.13/test/socket-rw.c:57:9: branch_true: following ‘true’ branch (when ‘ret != -1’)... liburing-2.13/test/socket-rw.c:59:9: branch_true: ...to here liburing-2.13/test/socket-rw.c:59:9: throw: if ‘t_set_nonblock’ throws an exception... liburing-2.13/test/socket-rw.c:59:9: danger: ‘recv_s0’ leaks here # 57| assert(ret != -1); # 58| # 59|-> t_set_nonblock(p_fd[1]); # 60| # 61| ret = connect(p_fd[1], (struct sockaddr*)&addr, sizeof(addr)); Error: GCC_ANALYZER_WARNING (CWE-775): [#def116] liburing-2.13/test/socket-rw.c:64:9: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘recv_s0’ liburing-2.13/test/socket-rw.c:33:12: branch_false: following ‘false’ branch (when ‘argc <= 1’)... liburing-2.13/test/socket-rw.c:36:15: branch_false: ...to here liburing-2.13/test/socket-rw.c:38:19: acquire_resource: socket created here liburing-2.13/test/socket-rw.c:41:9: branch_true: following ‘true’ branch (when ‘ret != -1’)... liburing-2.13/test/socket-rw.c:42:15: branch_true: ...to here liburing-2.13/test/socket-rw.c:43:9: branch_true: following ‘true’ branch (when ‘ret != -1’)... liburing-2.13/test/socket-rw.c:45:9: branch_true: ...to here liburing-2.13/test/socket-rw.c:48:9: branch_true: following ‘true’ branch... liburing-2.13/test/socket-rw.c:49:15: branch_true: ...to here liburing-2.13/test/socket-rw.c:50:9: branch_true: following ‘true’ branch (when ‘ret != -1’)... liburing-2.13/test/socket-rw.c:53:19: branch_true: ...to here liburing-2.13/test/socket-rw.c:57:9: branch_true: following ‘true’ branch (when ‘ret != -1’)... liburing-2.13/test/socket-rw.c:59:9: branch_true: ...to here liburing-2.13/test/socket-rw.c:62:9: branch_true: following ‘true’ branch... liburing-2.13/test/socket-rw.c:64:9: branch_true: ...to here liburing-2.13/test/socket-rw.c:64:9: throw: if ‘t_clear_nonblock’ throws an exception... liburing-2.13/test/socket-rw.c:64:9: danger: ‘recv_s0’ leaks here # 62| assert(ret == -1); # 63| # 64|-> t_clear_nonblock(p_fd[1]); # 65| # 66| p_fd[0] = accept(recv_s0, NULL, NULL); Error: GCC_ANALYZER_WARNING (CWE-401): [#def117] liburing-2.13/test/vec-regbuf.c:96:15: warning[-Wanalyzer-malloc-leak]: leak of ‘bd.buf_rd’ liburing-2.13/test/vec-regbuf.c:576:5: enter_function: entry to ‘main’ liburing-2.13/test/vec-regbuf.c:581:12: branch_false: following ‘false’ branch (when ‘argc <= 1’)... liburing-2.13/test/vec-regbuf.c:584:19: branch_false: ...to here liburing-2.13/test/vec-regbuf.c:586:9: call_function: calling ‘probe_support’ from ‘main’ liburing-2.13/test/vec-regbuf.c:586:9: return_function: returning to ‘main’ from ‘probe_support’ liburing-2.13/test/vec-regbuf.c:587:12: branch_true: following ‘true’ branch... liburing-2.13/test/vec-regbuf.c:592:27: branch_true: ...to here liburing-2.13/test/vec-regbuf.c:592:9: call_function: calling ‘init_buffers’ from ‘main’ liburing-2.13/test/vec-regbuf.c:592:9: return_function: returning to ‘main’ from ‘init_buffers’ liburing-2.13/test/vec-regbuf.c:595:21: branch_true: following ‘true’ branch (when ‘i != 2’)... liburing-2.13/test/vec-regbuf.c:596:22: branch_true: ...to here liburing-2.13/test/vec-regbuf.c:600:17: call_function: calling ‘test_basic’ from ‘main’ # 94| } # 95| # 96|-> ret = io_uring_queue_init(32, ring, 0); # 97| if (ret) { # 98| fprintf(stderr, "ring init error %i\n", ret); Error: GCC_ANALYZER_WARNING (CWE-775): [#def118] liburing-2.13/test/zcrx.c:514:17: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘sockfd’ liburing-2.13/test/zcrx.c:497:18: acquire_resource: stream socket created here liburing-2.13/test/zcrx.c:498:12: branch_false: following ‘false’ branch (when ‘sockfd >= 0’)... liburing-2.13/test/zcrx.c:503:9: branch_false: ...to here liburing-2.13/test/zcrx.c:507:12: branch_false: following ‘false’ branch (when ‘ret >= 0’)... liburing-2.13/test/zcrx.c:512:15: branch_false: ...to here liburing-2.13/test/zcrx.c:513:12: branch_true: following ‘true’ branch (when ‘ret < 0’)... liburing-2.13/test/zcrx.c:514:17: branch_true: ...to here liburing-2.13/test/zcrx.c:514:17: throw: if ‘perror’ throws an exception... liburing-2.13/test/zcrx.c:514:17: danger: ‘sockfd’ leaks here # 512| ret = listen(sockfd, 1); # 513| if (ret < 0) { # 514|-> perror("listen"); # 515| goto err; # 516| } Error: GCC_ANALYZER_WARNING (CWE-775): [#def119] liburing-2.13/test/zcrx.c:521:18: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘sockfd’ liburing-2.13/test/zcrx.c:497:18: acquire_resource: stream socket created here liburing-2.13/test/zcrx.c:498:12: branch_false: following ‘false’ branch (when ‘sockfd >= 0’)... liburing-2.13/test/zcrx.c:503:9: branch_false: ...to here liburing-2.13/test/zcrx.c:507:12: branch_false: following ‘false’ branch (when ‘ret >= 0’)... liburing-2.13/test/zcrx.c:512:15: branch_false: ...to here liburing-2.13/test/zcrx.c:513:12: branch_false: following ‘false’ branch (when ‘ret >= 0’)... liburing-2.13/test/zcrx.c:518:9: branch_false: ...to here liburing-2.13/test/zcrx.c:521:18: throw: if ‘accept’ throws an exception... liburing-2.13/test/zcrx.c:521:18: danger: ‘sockfd’ leaks here # 519| # 520| socklen = sizeof(saddr); # 521|-> use_fd = accept(sockfd, (struct sockaddr *)&saddr, &socklen); # 522| if (use_fd < 0) { # 523| perror("accept"); Error: GCC_ANALYZER_WARNING (CWE-775): [#def120] liburing-2.13/test/zcrx.c:546:9: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘sockfd’ liburing-2.13/test/zcrx.c:497:18: acquire_resource: stream socket created here liburing-2.13/test/zcrx.c:498:12: branch_false: following ‘false’ branch (when ‘sockfd >= 0’)... liburing-2.13/test/zcrx.c:503:9: branch_false: ...to here liburing-2.13/test/zcrx.c:507:12: branch_false: following ‘false’ branch (when ‘ret >= 0’)... liburing-2.13/test/zcrx.c:512:15: branch_false: ...to here liburing-2.13/test/zcrx.c:513:12: branch_true: following ‘true’ branch (when ‘ret < 0’)... liburing-2.13/test/zcrx.c:514:17: branch_true: ...to here liburing-2.13/test/zcrx.c:546:9: throw: if ‘close’ throws an exception... liburing-2.13/test/zcrx.c:546:9: danger: ‘sockfd’ leaks here # 544| return 0; # 545| err: # 546|-> close(sockfd); # 547| return 1; # 548| } Error: GCC_ANALYZER_WARNING (CWE-775): [#def121] liburing-2.13/test/zcrx.c:746:15: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘sockfd’ liburing-2.13/test/zcrx.c:728:12: branch_false: following ‘false’ branch... liburing-2.13/test/zcrx.c:733:9: branch_false: ...to here liburing-2.13/test/zcrx.c:738:18: acquire_resource: stream socket created here liburing-2.13/test/zcrx.c:739:12: branch_false: following ‘false’ branch (when ‘sockfd >= 0’)... liburing-2.13/test/zcrx.c:744:9: branch_false: ...to here liburing-2.13/test/zcrx.c:746:15: throw: if ‘connect’ throws an exception... liburing-2.13/test/zcrx.c:746:15: danger: ‘sockfd’ leaks here # 744| pthread_barrier_wait(&rd->connect); # 745| # 746|-> ret = connect(sockfd, (struct sockaddr *)&saddr, sizeof(saddr)); # 747| if (ret < 0) { # 748| perror("connect");
| analyzer-version-clippy | 1.92.0 |
| analyzer-version-cppcheck | 2.19.1 |
| analyzer-version-gcc | 16.0.0 |
| analyzer-version-gcc-analyzer | 16.0.0 |
| analyzer-version-shellcheck | 0.11.0 |
| analyzer-version-unicontrol | 0.0.2 |
| diffbase-analyzer-version-clippy | 1.92.0 |
| diffbase-analyzer-version-cppcheck | 2.19.1 |
| diffbase-analyzer-version-gcc | 16.0.0 |
| diffbase-analyzer-version-gcc-analyzer | 16.0.0 |
| diffbase-analyzer-version-shellcheck | 0.11.0 |
| diffbase-analyzer-version-unicontrol | 0.0.2 |
| diffbase-enabled-plugins | clippy, cppcheck, gcc, shellcheck, unicontrol |
| diffbase-exit-code | 0 |
| diffbase-host | ip-172-16-1-54.us-west-2.compute.internal |
| diffbase-known-false-positives | /usr/share/csmock/known-false-positives.js |
| diffbase-known-false-positives-rpm | known-false-positives-0.0.0.20250521.132812.g8eff701.main-1.el9.noarch |
| diffbase-mock-config | fedora-rawhide-x86_64 |
| diffbase-project-name | liburing-2.9-2.fc43 |
| diffbase-store-results-to | /tmp/tmp20fjtfr1/liburing-2.9-2.fc43.tar.xz |
| diffbase-time-created | 2026-01-08 19:20:50 |
| diffbase-time-finished | 2026-01-08 19:23:07 |
| diffbase-tool | csmock |
| diffbase-tool-args | '/usr/bin/csmock' '-r' 'fedora-rawhide-x86_64' '-t' 'gcc,cppcheck,clippy,shellcheck,unicontrol' '-o' '/tmp/tmp20fjtfr1/liburing-2.9-2.fc43.tar.xz' '--gcc-analyze' '--unicontrol-notests' '--unicontrol-bidi-only' '--install' 'pam' '--gcc-analyzer-bin=/usr/bin/gcc' '/tmp/tmp20fjtfr1/liburing-2.9-2.fc43.src.rpm' |
| diffbase-tool-version | csmock-3.8.3.20251215.161544.g62de9a5-1.el9 |
| enabled-plugins | clippy, cppcheck, gcc, shellcheck, unicontrol |
| exit-code | 0 |
| host | ip-172-16-1-54.us-west-2.compute.internal |
| known-false-positives | /usr/share/csmock/known-false-positives.js |
| known-false-positives-rpm | known-false-positives-0.0.0.20250521.132812.g8eff701.main-1.el9.noarch |
| mock-config | fedora-rawhide-x86_64 |
| project-name | liburing-2.13-1.fc44 |
| store-results-to | /tmp/tmpeajeqw92/liburing-2.13-1.fc44.tar.xz |
| time-created | 2026-01-08 19:23:37 |
| time-finished | 2026-01-08 19:25:33 |
| title | Newly introduced findings |
| tool | csmock |
| tool-args | '/usr/bin/csmock' '-r' 'fedora-rawhide-x86_64' '-t' 'gcc,cppcheck,clippy,shellcheck,unicontrol' '-o' '/tmp/tmpeajeqw92/liburing-2.13-1.fc44.tar.xz' '--gcc-analyze' '--unicontrol-notests' '--unicontrol-bidi-only' '--install' 'pam' '--gcc-analyzer-bin=/usr/bin/gcc' '/tmp/tmpeajeqw92/liburing-2.13-1.fc44.src.rpm' |
| tool-version | csmock-3.8.3.20251215.161544.g62de9a5-1.el9 |