libdrm-2.4.128-3.fc44

List of Findings

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1]
libdrm-2.4.128/amdgpu/amdgpu_bo.c:54:13: warning[-Wanalyzer-malloc-leak]: leak of ‘bo’
libdrm-2.4.128/amdgpu/amdgpu_bo.c:50:14: acquire_memory: allocated here
libdrm-2.4.128/amdgpu/amdgpu_bo.c:51:12: branch_false: following ‘false’ branch (when ‘bo’ is non-NULL)...
libdrm-2.4.128/amdgpu/amdgpu_bo.c:54:13: branch_false: ...to here
libdrm-2.4.128/amdgpu/amdgpu_bo.c:54:13: throw: if ‘handle_table_insert’ throws an exception...
libdrm-2.4.128/amdgpu/amdgpu_bo.c:54:13: danger: ‘bo’ leaks here; was allocated at [(1)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/0)
#   52|   		return -ENOMEM;
#   53|   
#   54|-> 	r = handle_table_insert(&dev->bo_handles, handle, bo);
#   55|   	if (r) {
#   56|   		free(bo);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def2]
libdrm-2.4.128/amdgpu/amdgpu_bo.c:682:13: warning[-Wanalyzer-malloc-leak]: leak of ‘list’
libdrm-2.4.128/amdgpu/amdgpu_bo.c:651:12: branch_false: following ‘false’ branch...
libdrm-2.4.128/amdgpu/amdgpu_bo.c:655:12: branch_false: ...to here
libdrm-2.4.128/amdgpu/amdgpu_bo.c:655:12: branch_false: following ‘false’ branch (when ‘number_of_resources <= 536870911’)...
libdrm-2.4.128/amdgpu/amdgpu_bo.c:658:16: branch_false: ...to here
libdrm-2.4.128/amdgpu/amdgpu_bo.c:658:16: acquire_memory: allocated here
libdrm-2.4.128/amdgpu/amdgpu_bo.c:659:12: branch_false: following ‘false’ branch (when ‘list’ is non-NULL)...
libdrm-2.4.128/amdgpu/amdgpu_bo.c:662:19: branch_false: ...to here
libdrm-2.4.128/amdgpu/amdgpu_bo.c:663:12: branch_false: following ‘false’ branch...
libdrm-2.4.128/amdgpu/amdgpu_bo.c:668:9: branch_false: ...to here
libdrm-2.4.128/amdgpu/amdgpu_bo.c:682:13: throw: if ‘drmCommandWriteRead’ throws an exception...
libdrm-2.4.128/amdgpu/amdgpu_bo.c:682:13: danger: ‘list’ leaks here; was allocated at [(5)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/4)
#  680|   	}
#  681|   
#  682|-> 	r = drmCommandWriteRead(dev->fd, DRM_AMDGPU_BO_LIST,
#  683|   				&args, sizeof(args));
#  684|   	free(list);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def3]
libdrm-2.4.128/amdgpu/amdgpu_bo.c:748:13: warning[-Wanalyzer-malloc-leak]: leak of ‘list’
libdrm-2.4.128/amdgpu/amdgpu_bo.c:723:12: branch_false: following ‘false’ branch (when ‘number_of_resources != 0’)...
libdrm-2.4.128/amdgpu/amdgpu_bo.c:727:12: branch_false: ...to here
libdrm-2.4.128/amdgpu/amdgpu_bo.c:727:12: branch_false: following ‘false’ branch (when ‘number_of_resources <= 536870911’)...
libdrm-2.4.128/amdgpu/amdgpu_bo.c:730:16: branch_false: ...to here
libdrm-2.4.128/amdgpu/amdgpu_bo.c:730:16: acquire_memory: allocated here
libdrm-2.4.128/amdgpu/amdgpu_bo.c:731:12: branch_false: following ‘false’ branch (when ‘list’ is non-NULL)...
libdrm-2.4.128/amdgpu/amdgpu_bo.c:734:9: branch_false: ...to here
libdrm-2.4.128/amdgpu/amdgpu_bo.c:748:13: throw: if ‘drmCommandWriteRead’ throws an exception...
libdrm-2.4.128/amdgpu/amdgpu_bo.c:748:13: danger: ‘list’ leaks here; was allocated at [(5)](sarif:/runs/0/results/2/codeFlows/0/threadFlows/0/locations/4)
#  746|   	}
#  747|   
#  748|-> 	r = drmCommandWriteRead(handle->dev->fd, DRM_AMDGPU_BO_LIST,
#  749|   				&args, sizeof(args));
#  750|   	free(list);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def4]
libdrm-2.4.128/amdgpu/amdgpu_device.c:207:19: warning[-Wanalyzer-malloc-leak]: leak of ‘dev’
libdrm-2.4.128/amdgpu/amdgpu_device.c:165:12: branch_false: following ‘false’ branch...
libdrm-2.4.128/amdgpu/amdgpu_device.c:172:12: branch_false: ...to here
libdrm-2.4.128/amdgpu/amdgpu_device.c:195:15: acquire_memory: allocated here
libdrm-2.4.128/amdgpu/amdgpu_device.c:196:12: branch_false: following ‘false’ branch (when ‘dev’ is non-NULL)...
libdrm-2.4.128/amdgpu/amdgpu_device.c:202:9: branch_false: ...to here
libdrm-2.4.128/amdgpu/amdgpu_device.c:207:19: throw: if ‘drmGetVersion’ throws an exception...
libdrm-2.4.128/amdgpu/amdgpu_device.c:207:19: danger: ‘dev’ leaks here; was allocated at [(3)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/2)
#  205|   	atomic_set(&dev->refcount, 1);
#  206|   
#  207|-> 	version = drmGetVersion(fd);
#  208|   	if (version->version_major != 3) {
#  209|   		fprintf(stderr, "%s: DRM version is %d.%d.%d but this driver is "

Error: GCC_ANALYZER_WARNING (CWE-401): [#def5]
libdrm-2.4.128/amdgpu/amdgpu_device.c:215:17: warning[-Wanalyzer-malloc-leak]: leak of ‘dev’
libdrm-2.4.128/amdgpu/amdgpu_device.c:165:12: branch_false: following ‘false’ branch...
libdrm-2.4.128/amdgpu/amdgpu_device.c:172:12: branch_false: ...to here
libdrm-2.4.128/amdgpu/amdgpu_device.c:195:15: acquire_memory: allocated here
libdrm-2.4.128/amdgpu/amdgpu_device.c:196:12: branch_false: following ‘false’ branch (when ‘dev’ is non-NULL)...
libdrm-2.4.128/amdgpu/amdgpu_device.c:202:9: branch_false: ...to here
libdrm-2.4.128/amdgpu/amdgpu_device.c:208:12: branch_true: following ‘true’ branch...
libdrm-2.4.128/amdgpu/amdgpu_device.c:209:17: branch_true: ...to here
libdrm-2.4.128/amdgpu/amdgpu_device.c:215:17: throw: if ‘drmFreeVersion’ throws an exception...
libdrm-2.4.128/amdgpu/amdgpu_device.c:215:17: danger: ‘dev’ leaks here; was allocated at [(3)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/2)
#  213|   			version->version_minor,
#  214|   			version->version_patchlevel);
#  215|-> 		drmFreeVersion(version);
#  216|   		r = -EBADF;
#  217|   		goto cleanup;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def6]
libdrm-2.4.128/amdgpu/amdgpu_device.c:220:19: warning[-Wanalyzer-malloc-leak]: leak of ‘dev’
libdrm-2.4.128/amdgpu/amdgpu_device.c:165:12: branch_false: following ‘false’ branch...
libdrm-2.4.128/amdgpu/amdgpu_device.c:172:12: branch_false: ...to here
libdrm-2.4.128/amdgpu/amdgpu_device.c:195:15: acquire_memory: allocated here
libdrm-2.4.128/amdgpu/amdgpu_device.c:196:12: branch_false: following ‘false’ branch (when ‘dev’ is non-NULL)...
libdrm-2.4.128/amdgpu/amdgpu_device.c:202:9: branch_false: ...to here
libdrm-2.4.128/amdgpu/amdgpu_device.c:208:12: branch_false: following ‘false’ branch...
libdrm-2.4.128/amdgpu/amdgpu_device.c:220:19: branch_false: ...to here
libdrm-2.4.128/amdgpu/amdgpu_device.c:220:19: throw: if ‘fcntl’ throws an exception...
libdrm-2.4.128/amdgpu/amdgpu_device.c:220:19: danger: ‘dev’ leaks here; was allocated at [(3)](sarif:/runs/0/results/2/codeFlows/0/threadFlows/0/locations/2)
#  218|   	}
#  219|   
#  220|-> 	dev->fd = fcntl(fd, F_DUPFD_CLOEXEC, 0);
#  221|   	dev->flink_fd = dev->fd;
#  222|   	dev->major_version = version->version_major;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def7]
libdrm-2.4.128/amdgpu/amdgpu_device.c:224:9: warning[-Wanalyzer-malloc-leak]: leak of ‘dev’
libdrm-2.4.128/amdgpu/amdgpu_device.c:165:12: branch_false: following ‘false’ branch...
libdrm-2.4.128/amdgpu/amdgpu_device.c:172:12: branch_false: ...to here
libdrm-2.4.128/amdgpu/amdgpu_device.c:195:15: acquire_memory: allocated here
libdrm-2.4.128/amdgpu/amdgpu_device.c:196:12: branch_false: following ‘false’ branch (when ‘dev’ is non-NULL)...
libdrm-2.4.128/amdgpu/amdgpu_device.c:202:9: branch_false: ...to here
libdrm-2.4.128/amdgpu/amdgpu_device.c:208:12: branch_false: following ‘false’ branch...
libdrm-2.4.128/amdgpu/amdgpu_device.c:220:19: branch_false: ...to here
libdrm-2.4.128/amdgpu/amdgpu_device.c:224:9: throw: if ‘drmFreeVersion’ throws an exception...
libdrm-2.4.128/amdgpu/amdgpu_device.c:224:9: danger: ‘dev’ leaks here; was allocated at [(3)](sarif:/runs/0/results/3/codeFlows/0/threadFlows/0/locations/2)
#  222|   	dev->major_version = version->version_major;
#  223|   	dev->minor_version = version->version_minor;
#  224|-> 	drmFreeVersion(version);
#  225|   
#  226|   	pthread_mutex_init(&dev->bo_table_mutex, NULL);

Error: CPPCHECK_WARNING (CWE-476): [#def8]
libdrm-2.4.128/amdgpu/amdgpu_vamgr.c:56: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: n
#   54|   	pthread_mutex_lock(&mgr->bo_va_mutex);
#   55|   	n = calloc(1, sizeof(struct amdgpu_bo_va_hole));
#   56|-> 	n->size = mgr->va_max - start;
#   57|   	n->offset = start;
#   58|   	list_add(&n->list, &mgr->va_holes);

Error: GCC_ANALYZER_WARNING (CWE-476): [#def9]
libdrm-2.4.128/amdgpu/amdgpu_vamgr.c:56:9: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘n’
libdrm-2.4.128/amdgpu/amdgpu_vamgr.c:325:17: enter_function: entry to ‘amdgpu_va_manager_init’
libdrm-2.4.128/amdgpu/amdgpu_vamgr.c:334:9: call_function: calling ‘amdgpu_vamgr_init’ from ‘amdgpu_va_manager_init’
#   54|   	pthread_mutex_lock(&mgr->bo_va_mutex);
#   55|   	n = calloc(1, sizeof(struct amdgpu_bo_va_hole));
#   56|-> 	n->size = mgr->va_max - start;
#   57|   	n->offset = start;
#   58|   	list_add(&n->list, &mgr->va_holes);

Error: CPPCHECK_WARNING (CWE-476): [#def10]
libdrm-2.4.128/amdgpu/amdgpu_vamgr.c:57: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: n
#   55|   	n = calloc(1, sizeof(struct amdgpu_bo_va_hole));
#   56|   	n->size = mgr->va_max - start;
#   57|-> 	n->offset = start;
#   58|   	list_add(&n->list, &mgr->va_holes);
#   59|   	pthread_mutex_unlock(&mgr->bo_va_mutex);

Error: CPPCHECK_WARNING (CWE-401): [#def11]
libdrm-2.4.128/amdgpu/amdgpu_vamgr.c:87: error[memleak]: Memory leak: n
#   85|   		hole->size -= (end_va - hole->offset);
#   86|   		hole->offset = end_va;
#   87|-> 	} else if (start_va > hole->offset) {
#   88|   		hole->size = start_va - hole->offset;
#   89|   	} else if (end_va - hole->offset < hole->size) {

Error: COMPILER_WARNING: [#def12]
libdrm-2.4.128/intel/intel_bufmgr.c:34: included_from: Included from here.
libdrm-2.4.128/include/drm/i915_drm.h:2233:1: warning[-Wpacked]: packed attribute is unnecessary for ‘i915_context_engines_load_balance’
# 2233 | } __attribute__((packed));
#      | ^
# 2231|   
# 2232|   	struct i915_engine_class_instance engines[];
# 2233|-> } __attribute__((packed));
# 2234|   
# 2235|   #define I915_DEFINE_CONTEXT_ENGINES_LOAD_BALANCE(name__, N__) struct { \

Error: COMPILER_WARNING: [#def13]
libdrm-2.4.128/include/drm/i915_drm.h:2271:1: warning[-Wpacked]: packed attribute is unnecessary for ‘i915_context_engines_bond’
# 2271 | } __attribute__((packed));
#      | ^
# 2269|   
# 2270|   	struct i915_engine_class_instance engines[];
# 2271|-> } __attribute__((packed));
# 2272|   
# 2273|   #define I915_DEFINE_CONTEXT_ENGINES_BOND(name__, N__) struct { \

Error: COMPILER_WARNING: [#def14]
libdrm-2.4.128/include/drm/i915_drm.h:2399:1: warning[-Wpacked]: packed attribute is unnecessary for ‘i915_context_engines_parallel_submit’
# 2399 | } __attribute__((packed));
#      | ^
# 2397|   	struct i915_engine_class_instance engines[];
# 2398|   
# 2399|-> } __attribute__((packed));
# 2400|   
# 2401|   #define I915_DEFINE_CONTEXT_ENGINES_PARALLEL_SUBMIT(name__, N__) struct { \

Error: COMPILER_WARNING: [#def15]
libdrm-2.4.128/include/drm/i915_drm.h:2473:1: warning[-Wpacked]: packed attribute is unnecessary for ‘i915_context_param_engines’
# 2473 | } __attribute__((packed));
#      | ^
# 2471|   #define I915_CONTEXT_ENGINES_EXT_PARALLEL_SUBMIT 2 /* see i915_context_engines_parallel_submit */
# 2472|   	struct i915_engine_class_instance engines[0];
# 2473|-> } __attribute__((packed));
# 2474|   
# 2475|   #define I915_DEFINE_CONTEXT_PARAM_ENGINES(name__, N__) struct { \

Error: GCC_ANALYZER_WARNING (CWE-401): [#def16]
libdrm-2.4.128/intel/intel_bufmgr_fake.c:433:22: warning[-Wanalyzer-malloc-leak]: leak of ‘block’
libdrm-2.4.128/intel/intel_bufmgr_fake.c:1426:1: enter_function: entry to ‘drm_intel_fake_bo_exec’
libdrm-2.4.128/intel/intel_bufmgr_fake.c:1446:15: call_function: calling ‘drm_intel_fake_reloc_and_validate_buffer’ from ‘drm_intel_fake_bo_exec’
#  431|   	sz = (bo->size + bo_fake->alignment - 1) & ~(bo_fake->alignment - 1);
#  432|   
#  433|-> 	block->mem = mmAllocMem(bufmgr_fake->heap, sz, align_log2, 0);
#  434|   	if (!block->mem) {
#  435|   		free(block);

Error: GCC_ANALYZER_WARNING (CWE-476): [#def17]
libdrm-2.4.128/intel/intel_bufmgr_fake.c:553:17: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘bo_fake’
libdrm-2.4.128/intel/intel_bufmgr_fake.c:1426:1: enter_function: entry to ‘drm_intel_fake_bo_exec’
libdrm-2.4.128/intel/intel_bufmgr_fake.c:1446:15: call_function: calling ‘drm_intel_fake_reloc_and_validate_buffer’ from ‘drm_intel_fake_bo_exec’
#  551|   
#  552|   		set_dirty(&bo_fake->bo);
#  553|-> 		bo_fake->block = NULL;
#  554|   
#  555|   		free_block(bufmgr_fake, block, 0);

Error: GCC_ANALYZER_WARNING (CWE-476): [#def18]
libdrm-2.4.128/intel/intel_bufmgr_fake.c:576:17: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘bo_fake’
libdrm-2.4.128/intel/intel_bufmgr_fake.c:1426:1: enter_function: entry to ‘drm_intel_fake_bo_exec’
libdrm-2.4.128/intel/intel_bufmgr_fake.c:1446:15: call_function: calling ‘drm_intel_fake_reloc_and_validate_buffer’ from ‘drm_intel_fake_bo_exec’
#  574|   
#  575|   		set_dirty(&bo_fake->bo);
#  576|-> 		bo_fake->block = NULL;
#  577|   
#  578|   		free_block(bufmgr_fake, block, 0);

Error: GCC_ANALYZER_WARNING (CWE-476): [#def19]
libdrm-2.4.128/intel/intel_bufmgr_fake.c:1599:9: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘bufmgr_fake’
libdrm-2.4.128/intel/intel_bufmgr_fake.c:1587:23: acquire_memory: this call could return NULL
libdrm-2.4.128/intel/intel_bufmgr_fake.c:1589:12: branch_false: following ‘false’ branch...
libdrm-2.4.128/intel/intel_bufmgr_fake.c:1595:9: branch_false: ...to here
libdrm-2.4.128/intel/intel_bufmgr_fake.c:1599:9: danger: ‘bufmgr_fake’ could be NULL: unchecked value from [(1)](sarif:/runs/0/results/3/codeFlows/0/threadFlows/0/locations/0)
# 1597|   	DRMINITLISTHEAD(&bufmgr_fake->lru);
# 1598|   
# 1599|-> 	bufmgr_fake->low_offset = low_offset;
# 1600|   	bufmgr_fake->virtual = low_virtual;
# 1601|   	bufmgr_fake->size = size;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def20]
libdrm-2.4.128/intel/intel_bufmgr_gem.c:3169:15: warning[-Wanalyzer-malloc-leak]: leak of ‘context’
libdrm-2.4.128/intel/intel_bufmgr_gem.c:3164:19: acquire_memory: allocated here
libdrm-2.4.128/intel/intel_bufmgr_gem.c:3165:12: branch_false: following ‘false’ branch (when ‘context’ is non-NULL)...
libdrm-2.4.128/intel/intel_bufmgr_gem.c:3168:9: branch_false: ...to here
libdrm-2.4.128/intel/intel_bufmgr_gem.c:3169:15: throw: if ‘drmIoctl’ throws an exception...
libdrm-2.4.128/intel/intel_bufmgr_gem.c:3169:15: danger: ‘context’ leaks here; was allocated at [(1)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/0)
# 3167|   
# 3168|   	memclear(create);
# 3169|-> 	ret = drmIoctl(bufmgr_gem->fd, DRM_IOCTL_I915_GEM_CONTEXT_CREATE, &create);
# 3170|   	if (ret != 0) {
# 3171|   		DBG("DRM_IOCTL_I915_GEM_CONTEXT_CREATE failed: %s\n",

Error: GCC_ANALYZER_WARNING (CWE-457): [#def21]
libdrm-2.4.128/intel/intel_decode.c:405:9: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘format’
libdrm-2.4.128/intel/intel_decode.c:3897:1: enter_function: entry to ‘drm_intel_decode’
libdrm-2.4.128/intel/intel_decode.c:3905:12: branch_false: following ‘false’ branch (when ‘ctx’ is non-NULL)...
libdrm-2.4.128/intel/intel_decode.c:3912:16: branch_false: ...to here
libdrm-2.4.128/intel/intel_decode.c:3929:16: branch_true: following ‘true’ branch...
libdrm-2.4.128/intel/intel_decode.c:3932:26: branch_true: ...to here
libdrm-2.4.128/intel/intel_decode.c:3955:34: call_function: calling ‘decode_2d’ from ‘drm_intel_decode’
#  403|   	}
#  404|   
#  405|-> 	instr_out(ctx, 1,
#  406|   		  "format %s, pitch %d, rop 0x%02x, "
#  407|   		  "clipping %sabled, %s%s \n",

Error: GCC_ANALYZER_WARNING (CWE-688): [#def22]
libdrm-2.4.128/intel/intel_decode.c:3914:9: warning[-Wanalyzer-possible-null-argument]: use of possibly-NULL ‘temp’ where non-null expected
libdrm-2.4.128/intel/intel_decode.c:3905:12: branch_false: following ‘false’ branch (when ‘ctx’ is non-NULL)...
libdrm-2.4.128/intel/intel_decode.c:3912:16: branch_false: ...to here
libdrm-2.4.128/intel/intel_decode.c:3913:16: acquire_memory: this call could return NULL
libdrm-2.4.128/intel/intel_decode.c:3914:9: danger: argument 1 (‘temp’) from [(3)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/2) could be NULL where non-null expected
# 3912|   	size = ctx->base_count * 4;
# 3913|   	temp = malloc(size + 4096);
# 3914|-> 	memcpy(temp, ctx->base_data, size);
# 3915|   	memset((char *)temp + size, 0xd0, 4096);
# 3916|   	ctx->data = temp;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def23]
libdrm-2.4.128/intel/test_decode.c:54:14: warning[-Wanalyzer-malloc-leak]: leak of ‘ref_filename’
libdrm-2.4.128/intel/test_decode.c:86:1: enter_function: entry to ‘compare_batch’
libdrm-2.4.128/intel/test_decode.c:98:24: acquire_memory: allocated here
libdrm-2.4.128/intel/test_decode.c:102:9: call_function: calling ‘read_file’ from ‘compare_batch’
#   52|   	struct stat st;
#   53|   
#   54|-> 	fd = open(filename, O_RDONLY);
#   55|   	if (fd < 0)
#   56|   		errx(1, "couldn't open `%s'", filename);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def24]
libdrm-2.4.128/intel/test_decode.c:56:17: warning[-Wanalyzer-malloc-leak]: leak of ‘ref_filename’
libdrm-2.4.128/intel/test_decode.c:86:1: enter_function: entry to ‘compare_batch’
libdrm-2.4.128/intel/test_decode.c:98:24: acquire_memory: allocated here
libdrm-2.4.128/intel/test_decode.c:102:9: call_function: calling ‘read_file’ from ‘compare_batch’
#   54|   	fd = open(filename, O_RDONLY);
#   55|   	if (fd < 0)
#   56|-> 		errx(1, "couldn't open `%s'", filename);
#   57|   
#   58|   	ret = fstat(fd, &st);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def25]
libdrm-2.4.128/intel/test_decode.c:60:17: warning[-Wanalyzer-malloc-leak]: leak of ‘ref_filename’
libdrm-2.4.128/intel/test_decode.c:86:1: enter_function: entry to ‘compare_batch’
libdrm-2.4.128/intel/test_decode.c:98:24: acquire_memory: allocated here
libdrm-2.4.128/intel/test_decode.c:102:9: call_function: calling ‘read_file’ from ‘compare_batch’
#   58|   	ret = fstat(fd, &st);
#   59|   	if (ret)
#   60|-> 		errx(1, "couldn't stat `%s'", filename);
#   61|   
#   62|   	*size = st.st_size;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def26]
libdrm-2.4.128/intel/test_decode.c:65:17: warning[-Wanalyzer-malloc-leak]: leak of ‘ref_filename’
libdrm-2.4.128/intel/test_decode.c:86:1: enter_function: entry to ‘compare_batch’
libdrm-2.4.128/intel/test_decode.c:98:24: acquire_memory: allocated here
libdrm-2.4.128/intel/test_decode.c:102:9: call_function: calling ‘read_file’ from ‘compare_batch’
#   63|   	*ptr = drm_mmap(NULL, st.st_size, PROT_READ, MAP_SHARED, fd, 0);
#   64|   	if (*ptr == MAP_FAILED)
#   65|-> 		errx(1, "couldn't map `%s'", filename);
#   66|   
#   67|   	close(fd);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def27]
libdrm-2.4.128/intel/test_decode.c:67:9: warning[-Wanalyzer-malloc-leak]: leak of ‘ref_filename’
libdrm-2.4.128/intel/test_decode.c:86:1: enter_function: entry to ‘compare_batch’
libdrm-2.4.128/intel/test_decode.c:98:24: acquire_memory: allocated here
libdrm-2.4.128/intel/test_decode.c:102:9: call_function: calling ‘read_file’ from ‘compare_batch’
#   65|   		errx(1, "couldn't map `%s'", filename);
#   66|   
#   67|-> 	close(fd);
#   68|   }
#   69|   

Error: GCC_ANALYZER_WARNING (CWE-688): [#def28]
libdrm-2.4.128/intel/test_decode.c:99:9: warning[-Wanalyzer-possible-null-argument]: use of possibly-NULL ‘ref_filename’ where non-null expected
libdrm-2.4.128/intel/test_decode.c:98:24: acquire_memory: this call could return NULL
libdrm-2.4.128/intel/test_decode.c:99:9: danger: argument 1 (‘ref_filename’) from [(1)](sarif:/runs/0/results/5/codeFlows/0/threadFlows/0/locations/0) could be NULL where non-null expected
#   97|   
#   98|   	ref_filename = malloc(strlen(batch_filename) + strlen(ref_suffix) + 1);
#   99|-> 	sprintf(ref_filename, "%s%s", batch_filename, ref_suffix);
#  100|   
#  101|   	/* Read the batch and reference. */

Error: GCC_ANALYZER_WARNING (CWE-401): [#def29]
libdrm-2.4.128/intel/test_decode.c:116:9: warning[-Wanalyzer-malloc-leak]: leak of ‘out’
libdrm-2.4.128/intel/test_decode.c:86:1: enter_function: entry to ‘compare_batch’
libdrm-2.4.128/intel/test_decode.c:102:9: call_function: calling ‘read_file’ from ‘compare_batch’
libdrm-2.4.128/intel/test_decode.c:102:9: return_function: returning to ‘compare_batch’ from ‘read_file’
libdrm-2.4.128/intel/test_decode.c:103:9: call_function: calling ‘read_file’ from ‘compare_batch’
libdrm-2.4.128/intel/test_decode.c:103:9: return_function: returning to ‘compare_batch’ from ‘read_file’
libdrm-2.4.128/intel/test_decode.c:110:15: acquire_memory: allocated here
libdrm-2.4.128/intel/test_decode.c:116:9: throw: if ‘drm_intel_decode_set_batch_pointer’ throws an exception...
libdrm-2.4.128/intel/test_decode.c:116:9: danger: ‘out’ leaks here; was allocated at [(20)](sarif:/runs/0/results/7/codeFlows/0/threadFlows/0/locations/19)
#  114|   #endif
#  115|   
#  116|-> 	drm_intel_decode_set_batch_pointer(ctx, batch_ptr, HW_OFFSET,
#  117|   					   batch_size / 4);
#  118|   	drm_intel_decode_set_output_file(ctx, out);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def30]
libdrm-2.4.128/intel/test_decode.c:116:9: warning[-Wanalyzer-malloc-leak]: leak of ‘ref_filename’
libdrm-2.4.128/intel/test_decode.c:86:1: enter_function: entry to ‘compare_batch’
libdrm-2.4.128/intel/test_decode.c:98:24: acquire_memory: allocated here
libdrm-2.4.128/intel/test_decode.c:102:9: call_function: calling ‘read_file’ from ‘compare_batch’
libdrm-2.4.128/intel/test_decode.c:102:9: return_function: returning to ‘compare_batch’ from ‘read_file’
libdrm-2.4.128/intel/test_decode.c:103:9: call_function: calling ‘read_file’ from ‘compare_batch’
libdrm-2.4.128/intel/test_decode.c:103:9: return_function: returning to ‘compare_batch’ from ‘read_file’
libdrm-2.4.128/intel/test_decode.c:116:9: throw: if ‘drm_intel_decode_set_batch_pointer’ throws an exception...
libdrm-2.4.128/intel/test_decode.c:116:9: danger: ‘ref_filename’ leaks here; was allocated at [(2)](sarif:/runs/0/results/6/codeFlows/0/threadFlows/0/locations/1)
#  114|   #endif
#  115|   
#  116|-> 	drm_intel_decode_set_batch_pointer(ctx, batch_ptr, HW_OFFSET,
#  117|   					   batch_size / 4);
#  118|   	drm_intel_decode_set_output_file(ctx, out);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def31]
libdrm-2.4.128/intel/test_decode.c:118:9: warning[-Wanalyzer-malloc-leak]: leak of ‘out’
libdrm-2.4.128/intel/test_decode.c:86:1: enter_function: entry to ‘compare_batch’
libdrm-2.4.128/intel/test_decode.c:102:9: call_function: calling ‘read_file’ from ‘compare_batch’
libdrm-2.4.128/intel/test_decode.c:102:9: return_function: returning to ‘compare_batch’ from ‘read_file’
libdrm-2.4.128/intel/test_decode.c:103:9: call_function: calling ‘read_file’ from ‘compare_batch’
libdrm-2.4.128/intel/test_decode.c:103:9: return_function: returning to ‘compare_batch’ from ‘read_file’
libdrm-2.4.128/intel/test_decode.c:110:15: acquire_memory: allocated here
libdrm-2.4.128/intel/test_decode.c:118:9: throw: if ‘drm_intel_decode_set_output_file’ throws an exception...
libdrm-2.4.128/intel/test_decode.c:118:9: danger: ‘out’ leaks here; was allocated at [(20)](sarif:/runs/0/results/9/codeFlows/0/threadFlows/0/locations/19)
#  116|   	drm_intel_decode_set_batch_pointer(ctx, batch_ptr, HW_OFFSET,
#  117|   					   batch_size / 4);
#  118|-> 	drm_intel_decode_set_output_file(ctx, out);
#  119|   
#  120|   	drm_intel_decode(ctx);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def32]
libdrm-2.4.128/intel/test_decode.c:118:9: warning[-Wanalyzer-malloc-leak]: leak of ‘ref_filename’
libdrm-2.4.128/intel/test_decode.c:86:1: enter_function: entry to ‘compare_batch’
libdrm-2.4.128/intel/test_decode.c:98:24: acquire_memory: allocated here
libdrm-2.4.128/intel/test_decode.c:102:9: call_function: calling ‘read_file’ from ‘compare_batch’
libdrm-2.4.128/intel/test_decode.c:102:9: return_function: returning to ‘compare_batch’ from ‘read_file’
libdrm-2.4.128/intel/test_decode.c:103:9: call_function: calling ‘read_file’ from ‘compare_batch’
libdrm-2.4.128/intel/test_decode.c:103:9: return_function: returning to ‘compare_batch’ from ‘read_file’
libdrm-2.4.128/intel/test_decode.c:118:9: throw: if ‘drm_intel_decode_set_output_file’ throws an exception...
libdrm-2.4.128/intel/test_decode.c:118:9: danger: ‘ref_filename’ leaks here; was allocated at [(2)](sarif:/runs/0/results/8/codeFlows/0/threadFlows/0/locations/1)
#  116|   	drm_intel_decode_set_batch_pointer(ctx, batch_ptr, HW_OFFSET,
#  117|   					   batch_size / 4);
#  118|-> 	drm_intel_decode_set_output_file(ctx, out);
#  119|   
#  120|   	drm_intel_decode(ctx);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def33]
libdrm-2.4.128/intel/test_decode.c:120:9: warning[-Wanalyzer-malloc-leak]: leak of ‘ref_filename’
libdrm-2.4.128/intel/test_decode.c:86:1: enter_function: entry to ‘compare_batch’
libdrm-2.4.128/intel/test_decode.c:98:24: acquire_memory: allocated here
libdrm-2.4.128/intel/test_decode.c:102:9: call_function: calling ‘read_file’ from ‘compare_batch’
libdrm-2.4.128/intel/test_decode.c:102:9: return_function: returning to ‘compare_batch’ from ‘read_file’
libdrm-2.4.128/intel/test_decode.c:103:9: call_function: calling ‘read_file’ from ‘compare_batch’
libdrm-2.4.128/intel/test_decode.c:103:9: return_function: returning to ‘compare_batch’ from ‘read_file’
libdrm-2.4.128/intel/test_decode.c:120:9: throw: if ‘drm_intel_decode’ throws an exception...
libdrm-2.4.128/intel/test_decode.c:120:9: danger: ‘ref_filename’ leaks here; was allocated at [(2)](sarif:/runs/0/results/10/codeFlows/0/threadFlows/0/locations/1)
#  118|   	drm_intel_decode_set_output_file(ctx, out);
#  119|   
#  120|-> 	drm_intel_decode(ctx);
#  121|   
#  122|   	if (strcmp(ref_ptr, ptr) != 0) {

Error: GCC_ANALYZER_WARNING (CWE-476): [#def34]
libdrm-2.4.128/nouveau/abi16.c:45:15: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘obj’
#   43|   	int ret;
#   44|   
#   45|-> 	ret = drmCommandWriteRead(drm->fd, DRM_NOUVEAU_CHANNEL_ALLOC,
#   46|   				  &req, sizeof(req));
#   47|   	if (ret)

Error: GCC_ANALYZER_WARNING (CWE-476): [#def35]
libdrm-2.4.128/nouveau/abi16.c:66:15: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘obj’
#   64|   	int ret;
#   65|   
#   66|-> 	ret = drmCommandWriteRead(drm->fd, DRM_NOUVEAU_CHANNEL_ALLOC,
#   67|   				  &req, sizeof(req));
#   68|   	if (ret)

Error: GCC_ANALYZER_WARNING (CWE-476): [#def36]
libdrm-2.4.128/nouveau/abi16.c:92:15: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘obj’
#   90|   	}
#   91|   
#   92|-> 	ret = drmCommandWriteRead(drm->fd, DRM_NOUVEAU_CHANNEL_ALLOC,
#   93|   				  &req, sizeof(req));
#   94|   	if (ret)

Error: GCC_ANALYZER_WARNING (CWE-476): [#def37]
libdrm-2.4.128/nouveau/abi16.c:137:15: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘obj’
#  135|   	}
#  136|   
#  137|-> 	ret = drmCommandWrite(drm->fd, DRM_NOUVEAU_GROBJ_ALLOC,
#  138|   			      &req, sizeof(req));
#  139|   	if (ret)

Error: GCC_ANALYZER_WARNING (CWE-476): [#def38]
libdrm-2.4.128/nouveau/abi16.c:158:15: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘obj’
#  156|   	int ret;
#  157|   
#  158|-> 	ret = drmCommandWriteRead(drm->fd, DRM_NOUVEAU_NOTIFIEROBJ_ALLOC,
#  159|   				  &req, sizeof(req));
#  160|   	if (ret)

Error: GCC_ANALYZER_WARNING (CWE-476): [#def39]
libdrm-2.4.128/nouveau/abi16.c:224:17: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘obj’
libdrm-2.4.128/nouveau/abi16.c:221:12: branch_true: following ‘true’ branch...
libdrm-2.4.128/nouveau/abi16.c:223:31: branch_true: ...to here
libdrm-2.4.128/nouveau/abi16.c:224:17: danger: dereference of NULL ‘obj’
#  222|   		struct drm_nouveau_channel_free req;
#  223|   		req.channel = obj->handle;
#  224|-> 		drmCommandWrite(drm->fd, DRM_NOUVEAU_CHANNEL_FREE,
#  225|   				&req, sizeof(req));
#  226|   	} else {

Error: GCC_ANALYZER_WARNING (CWE-476): [#def40]
libdrm-2.4.128/nouveau/abi16.c:230:17: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘obj’
libdrm-2.4.128/nouveau/abi16.c:221:12: branch_false: following ‘false’ branch...
libdrm-2.4.128/nouveau/abi16.c:228:31: branch_false: ...to here
libdrm-2.4.128/nouveau/abi16.c:230:17: danger: dereference of NULL ‘obj’
#  228|   		req.channel = obj->parent->handle;
#  229|   		req.handle  = obj->handle;
#  230|-> 		drmCommandWrite(drm->fd, DRM_NOUVEAU_GPUOBJ_FREE,
#  231|   				&req, sizeof(req));
#  232|   	}

Error: GCC_ANALYZER_WARNING (CWE-401): [#def41]
libdrm-2.4.128/nouveau/bufctx.c:79:1: warning[-Wanalyzer-malloc-leak]: leak of ‘priv’
libdrm-2.4.128/nouveau/bufctx.c:67:16: acquire_memory: allocated here
libdrm-2.4.128/nouveau/bufctx.c:68:12: branch_true: following ‘true’ branch (when ‘priv’ is non-NULL)...
libdrm-2.4.128/nouveau/bufctx.c:69:17: branch_true: ...to here
libdrm-2.4.128/nouveau/bufctx.c:79:1: danger: ‘priv’ leaks here; was allocated at [(1)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/0)
#   77|   
#   78|   	return -ENOMEM;
#   79|-> }
#   80|   
#   81|   drm_public void

Error: GCC_ANALYZER_WARNING (CWE-401): [#def42]
libdrm-2.4.128/nouveau/nouveau.c:104:16: warning[-Wanalyzer-malloc-leak]: leak of ‘args’
libdrm-2.4.128/nouveau/nouveau.c:150:1: enter_function: entry to ‘nouveau_object_sclass_get’
libdrm-2.4.128/nouveau/nouveau.c:167:30: acquire_memory: allocated here
libdrm-2.4.128/nouveau/nouveau.c:167:20: branch_false: following ‘false’ branch (when ‘args’ is non-NULL)...
libdrm-2.4.128/nouveau/nouveau.c:169:17: branch_false: ...to here
libdrm-2.4.128/nouveau/nouveau.c:174:23: call_function: calling ‘nouveau_object_ioctl’ from ‘nouveau_object_sclass_get’
#  102|   		return ret;
#  103|   
#  104|-> 	return drmCommandWriteRead(drm->fd, DRM_NOUVEAU_NVIF, args, argc);
#  105|   }
#  106|   

Error: GCC_ANALYZER_WARNING (CWE-476): [#def43]
libdrm-2.4.128/nouveau/nouveau.c:104:16: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘obj’
libdrm-2.4.128/nouveau/nouveau.c:150:1: enter_function: entry to ‘nouveau_object_sclass_get’
libdrm-2.4.128/nouveau/nouveau.c:167:20: branch_false: following ‘false’ branch (when ‘args’ is non-NULL)...
libdrm-2.4.128/nouveau/nouveau.c:169:17: branch_false: ...to here
libdrm-2.4.128/nouveau/nouveau.c:174:23: call_function: calling ‘nouveau_object_ioctl’ from ‘nouveau_object_sclass_get’
#  102|   		return ret;
#  103|   
#  104|-> 	return drmCommandWriteRead(drm->fd, DRM_NOUVEAU_NVIF, args, argc);
#  105|   }
#  106|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def44]
libdrm-2.4.128/nouveau/nouveau.c:266:14: warning[-Wanalyzer-malloc-leak]: leak of ‘nvdev’
libdrm-2.4.128/nouveau/nouveau.c:378:1: enter_function: entry to ‘nouveau_device_new’
libdrm-2.4.128/nouveau/nouveau.c:386:35: call_function: inlined call to ‘nouveau_drm’ from ‘nouveau_device_new’
libdrm-2.4.128/nouveau/nouveau.c:393:12: branch_false: following ‘false’ branch (when ‘oclass == 128’)...
libdrm-2.4.128/nouveau/nouveau.c:394:13: branch_false: ...to here
libdrm-2.4.128/nouveau/nouveau.c:394:13: branch_true: following ‘true’ branch...
libdrm-2.4.128/nouveau/nouveau.c:394:13: branch_false: following ‘false’ branch (when ‘size == 16’)...
libdrm-2.4.128/nouveau/nouveau.c:397:23: branch_false: ...to here
libdrm-2.4.128/nouveau/nouveau.c:397:23: acquire_memory: allocated here
libdrm-2.4.128/nouveau/nouveau.c:397:12: branch_false: following ‘false’ branch (when ‘nvdev’ is non-NULL)...
libdrm-2.4.128/nouveau/nouveau.c:399:23: branch_false: ...to here
libdrm-2.4.128/nouveau/nouveau.c:402:12: branch_true: following ‘true’ branch...
libdrm-2.4.128/nouveau/nouveau.c:403:23: branch_true: ...to here
libdrm-2.4.128/nouveau/nouveau.c:403:23: call_function: calling ‘nouveau_object_init’ from ‘nouveau_device_new’
#  264|   	obj->data = NULL;
#  265|   
#  266|-> 	if (!abi16_object(obj, &func) && drm->nvif) {
#  267|   		if (!(args = malloc(argc)))
#  268|   			return -ENOMEM;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def45]
libdrm-2.4.128/nouveau/nouveau.c:266:14: warning[-Wanalyzer-malloc-leak]: leak of ‘obj’
libdrm-2.4.128/nouveau/nouveau.c:302:1: enter_function: entry to ‘nouveau_object_new’
libdrm-2.4.128/nouveau/nouveau.c:309:21: acquire_memory: allocated here
libdrm-2.4.128/nouveau/nouveau.c:309:12: branch_false: following ‘false’ branch (when ‘obj’ is non-NULL)...
libdrm-2.4.128/nouveau/nouveau.c:312:15: branch_false: ...to here
libdrm-2.4.128/nouveau/nouveau.c:312:15: call_function: calling ‘nouveau_object_init’ from ‘nouveau_object_new’
#  264|   	obj->data = NULL;
#  265|   
#  266|-> 	if (!abi16_object(obj, &func) && drm->nvif) {
#  267|   		if (!(args = malloc(argc)))
#  268|   			return -ENOMEM;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def46]
libdrm-2.4.128/nouveau/nouveau.c:266:42: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘obj’
libdrm-2.4.128/nouveau/nouveau.c:266:12: branch_false: following ‘false’ branch...
libdrm-2.4.128/nouveau/nouveau.c:266:42: branch_false: ...to here
libdrm-2.4.128/nouveau/nouveau.c:266:42: danger: dereference of NULL ‘obj’
#  264|   	obj->data = NULL;
#  265|   
#  266|-> 	if (!abi16_object(obj, &func) && drm->nvif) {
#  267|   		if (!(args = malloc(argc)))
#  268|   			return -ENOMEM;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def47]
libdrm-2.4.128/nouveau/nouveau.c:352:21: warning[-Wanalyzer-malloc-leak]: leak of ‘drm’
libdrm-2.4.128/nouveau/nouveau.c:348:21: acquire_memory: allocated here
libdrm-2.4.128/nouveau/nouveau.c:348:12: branch_false: following ‘false’ branch...
libdrm-2.4.128/nouveau/nouveau.c:350:9: branch_false: ...to here
libdrm-2.4.128/nouveau/nouveau.c:352:21: throw: if ‘drmGetVersion’ throws an exception...
libdrm-2.4.128/nouveau/nouveau.c:352:21: danger: ‘drm’ leaks here; was allocated at [(1)](sarif:/runs/0/results/6/codeFlows/0/threadFlows/0/locations/0)
#  350|   	drm->fd = fd;
#  351|   
#  352|-> 	if (!(ver = drmGetVersion(fd))) {
#  353|   		nouveau_drm_del(&drm);
#  354|   		return -EINVAL;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def48]
libdrm-2.4.128/nouveau/nouveau.c:362:9: warning[-Wanalyzer-malloc-leak]: leak of ‘drm’
libdrm-2.4.128/nouveau/nouveau.c:472:1: enter_function: entry to ‘nouveau_device_wrap’
libdrm-2.4.128/nouveau/nouveau.c:478:15: call_function: calling ‘nouveau_drm_new’ from ‘nouveau_device_wrap’
#  360|   		        ver->version_patchlevel;
#  361|   	drm->nvif = (drm->version >= 0x01000301);
#  362|-> 	drmFreeVersion(ver);
#  363|   	return 0;
#  364|   }

Error: GCC_ANALYZER_WARNING (CWE-476): [#def49]
libdrm-2.4.128/nouveau/nouveau.c:402:13: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘obj’
libdrm-2.4.128/nouveau/nouveau.c:393:12: branch_false: following ‘false’ branch (when ‘oclass == 128’)...
libdrm-2.4.128/nouveau/nouveau.c:394:13: branch_false: ...to here
libdrm-2.4.128/nouveau/nouveau.c:394:13: branch_true: following ‘true’ branch...
libdrm-2.4.128/nouveau/nouveau.c:394:13: branch_false: following ‘false’ branch (when ‘size == 16’)...
libdrm-2.4.128/nouveau/nouveau.c:397:23: branch_false: ...to here
libdrm-2.4.128/nouveau/nouveau.c:397:12: branch_false: following ‘false’ branch (when ‘nvdev’ is non-NULL)...
libdrm-2.4.128/nouveau/nouveau.c:399:23: branch_false: ...to here
libdrm-2.4.128/nouveau/nouveau.c:402:13: danger: dereference of NULL ‘obj’
#  400|   	dev->fd = -1;
#  401|   
#  402|-> 	if (drm->nvif) {
#  403|   		ret = nouveau_object_init(parent, 0, oclass, args, argc,
#  404|   					  &dev->object);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def50]
libdrm-2.4.128/nouveau/nouveau.c:469:1: warning[-Wanalyzer-malloc-leak]: leak of ‘nvdev’
libdrm-2.4.128/nouveau/nouveau.c:378:1: enter_function: entry to ‘nouveau_device_new’
libdrm-2.4.128/nouveau/nouveau.c:386:35: call_function: inlined call to ‘nouveau_drm’ from ‘nouveau_device_new’
libdrm-2.4.128/nouveau/nouveau.c:393:12: branch_false: following ‘false’ branch (when ‘oclass == 128’)...
libdrm-2.4.128/nouveau/nouveau.c:394:13: branch_false: ...to here
libdrm-2.4.128/nouveau/nouveau.c:394:13: branch_true: following ‘true’ branch...
libdrm-2.4.128/nouveau/nouveau.c:394:13: branch_false: following ‘false’ branch (when ‘size == 16’)...
libdrm-2.4.128/nouveau/nouveau.c:397:23: branch_false: ...to here
libdrm-2.4.128/nouveau/nouveau.c:397:23: acquire_memory: allocated here
libdrm-2.4.128/nouveau/nouveau.c:397:12: branch_false: following ‘false’ branch (when ‘nvdev’ is non-NULL)...
libdrm-2.4.128/nouveau/nouveau.c:399:23: branch_false: ...to here
libdrm-2.4.128/nouveau/nouveau.c:402:12: branch_false: following ‘false’ branch...
libdrm-2.4.128/nouveau/nouveau.c:418:13: branch_false: ...to here
libdrm-2.4.128/nouveau/nouveau.c:418:12: branch_false: following ‘false’ branch...
libdrm-2.4.128/nouveau/nouveau.c:395:24: branch_false: ...to here
libdrm-2.4.128/nouveau/nouveau.c:469:1: danger: ‘nvdev’ leaks here; was allocated at [(11)](sarif:/runs/0/results/9/codeFlows/0/threadFlows/0/locations/10)
#  467|   		nouveau_device_del(pdev);
#  468|   	return ret;
#  469|-> }
#  470|   
#  471|   drm_public int

Error: GCC_ANALYZER_WARNING (CWE-401): [#def51]
libdrm-2.4.128/nouveau/nouveau.c:536:17: warning[-Wanalyzer-malloc-leak]: leak of ‘drm’
libdrm-2.4.128/nouveau/nouveau.c:472:1: enter_function: entry to ‘nouveau_device_wrap’
libdrm-2.4.128/nouveau/nouveau.c:478:15: call_function: calling ‘nouveau_drm_new’ from ‘nouveau_device_wrap’
libdrm-2.4.128/nouveau/nouveau.c:478:15: return_function: returning to ‘nouveau_device_wrap’ from ‘nouveau_drm_new’
libdrm-2.4.128/nouveau/nouveau.c:479:12: branch_false: following ‘false’ branch...
libdrm-2.4.128/nouveau/nouveau.c:481:12: branch_false: ...to here
libdrm-2.4.128/nouveau/nouveau.c:483:15: call_function: calling ‘nouveau_device_new’ from ‘nouveau_device_wrap’
#  534|   	struct drm_nouveau_getparam r = { .param = param };
#  535|   	int fd = drm->fd, ret =
#  536|-> 		drmCommandWriteRead(fd, DRM_NOUVEAU_GETPARAM, &r, sizeof(r));
#  537|   	*value = r.value;
#  538|   	return ret;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def52]
libdrm-2.4.128/nouveau/nouveau.c:536:17: warning[-Wanalyzer-malloc-leak]: leak of ‘nvdev’
libdrm-2.4.128/nouveau/nouveau.c:378:1: enter_function: entry to ‘nouveau_device_new’
libdrm-2.4.128/nouveau/nouveau.c:386:35: call_function: inlined call to ‘nouveau_drm’ from ‘nouveau_device_new’
libdrm-2.4.128/nouveau/nouveau.c:393:12: branch_false: following ‘false’ branch (when ‘oclass == 128’)...
libdrm-2.4.128/nouveau/nouveau.c:394:13: branch_false: ...to here
libdrm-2.4.128/nouveau/nouveau.c:394:13: branch_true: following ‘true’ branch...
libdrm-2.4.128/nouveau/nouveau.c:394:13: branch_false: following ‘false’ branch (when ‘size == 16’)...
libdrm-2.4.128/nouveau/nouveau.c:397:23: branch_false: ...to here
libdrm-2.4.128/nouveau/nouveau.c:397:23: acquire_memory: allocated here
libdrm-2.4.128/nouveau/nouveau.c:397:12: branch_false: following ‘false’ branch (when ‘nvdev’ is non-NULL)...
libdrm-2.4.128/nouveau/nouveau.c:399:23: branch_false: ...to here
libdrm-2.4.128/nouveau/nouveau.c:402:12: branch_false: following ‘false’ branch...
libdrm-2.4.128/nouveau/nouveau.c:418:13: branch_false: ...to here
libdrm-2.4.128/nouveau/nouveau.c:418:12: branch_true: following ‘true’ branch...
libdrm-2.4.128/nouveau/nouveau.c:419:45: branch_true: ...to here
libdrm-2.4.128/nouveau/nouveau.c:424:23: call_function: calling ‘nouveau_getparam’ from ‘nouveau_device_new’
#  534|   	struct drm_nouveau_getparam r = { .param = param };
#  535|   	int fd = drm->fd, ret =
#  536|-> 		drmCommandWriteRead(fd, DRM_NOUVEAU_GETPARAM, &r, sizeof(r));
#  537|   	*value = r.value;
#  538|   	return ret;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def53]
libdrm-2.4.128/nouveau/nouveau.c:646:9: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘nvbo’
libdrm-2.4.128/nouveau/nouveau.c:639:40: acquire_memory: this call could return NULL
libdrm-2.4.128/nouveau/nouveau.c:643:12: branch_false: following ‘false’ branch (when ‘nvbo’ is non-NULL)...
libdrm-2.4.128/nouveau/nouveau.c:645:9: branch_false: ...to here
libdrm-2.4.128/nouveau/nouveau.c:646:9: danger: ‘nvbo’ could be NULL: unchecked value from [(1)](sarif:/runs/0/results/12/codeFlows/0/threadFlows/0/locations/0)
#  644|   		return -ENOMEM;
#  645|   	atomic_set(&nvbo->refcnt, 1);
#  646|-> 	bo->device = dev;
#  647|   	bo->flags = flags;
#  648|   	bo->size = size;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def54]
libdrm-2.4.128/nouveau/nouveau.c:650:15: warning[-Wanalyzer-malloc-leak]: leak of ‘nvbo’
libdrm-2.4.128/nouveau/nouveau.c:639:40: acquire_memory: allocated here
libdrm-2.4.128/nouveau/nouveau.c:643:12: branch_false: following ‘false’ branch (when ‘nvbo’ is non-NULL)...
libdrm-2.4.128/nouveau/nouveau.c:645:9: branch_false: ...to here
libdrm-2.4.128/nouveau/nouveau.c:650:15: throw: if ‘abi16_bo_init’ throws an exception...
libdrm-2.4.128/nouveau/nouveau.c:650:15: danger: ‘nvbo’ leaks here; was allocated at [(1)](sarif:/runs/0/results/13/codeFlows/0/threadFlows/0/locations/0)
#  648|   	bo->size = size;
#  649|   
#  650|-> 	ret = abi16_bo_init(bo, align, config);
#  651|   	if (ret) {
#  652|   		free(nvbo);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def55]
libdrm-2.4.128/nouveau/nouveau.c:703:17: warning[-Wanalyzer-malloc-leak]: leak of ‘nvbo’
libdrm-2.4.128/nouveau/nouveau.c:661:1: enter_function: entry to ‘nouveau_bo_wrap_locked’
libdrm-2.4.128/nouveau/nouveau.c:664:35: call_function: inlined call to ‘nouveau_drm’ from ‘nouveau_bo_wrap_locked’
libdrm-2.4.128/nouveau/nouveau.c:670:9: branch_true: following ‘true’ branch...
libdrm-2.4.128/nouveau/nouveau.c:671:21: branch_true: ...to here
libdrm-2.4.128/nouveau/nouveau.c:672:28: branch_true: following ‘true’ branch...
libdrm-2.4.128/nouveau/nouveau.c:683:33: branch_true: ...to here
libdrm-2.4.128/nouveau/nouveau.c:696:12: branch_false: following ‘false’ branch...
libdrm-2.4.128/nouveau/nouveau.c:699:16: branch_false: ...to here
libdrm-2.4.128/nouveau/nouveau.c:699:16: acquire_memory: allocated here
libdrm-2.4.128/nouveau/nouveau.c:700:12: branch_true: following ‘true’ branch (when ‘nvbo’ is non-NULL)...
libdrm-2.4.128/nouveau/nouveau.c:701:17: branch_true: ...to here
libdrm-2.4.128/nouveau/nouveau.c:703:17: throw: if ‘abi16_bo_info’ throws an exception...
libdrm-2.4.128/nouveau/nouveau.c:703:17: danger: ‘nvbo’ leaks here; was allocated at [(11)](sarif:/runs/0/results/14/codeFlows/0/threadFlows/0/locations/10)
#  701|   		atomic_set(&nvbo->refcnt, 1);
#  702|   		nvbo->base.device = dev;
#  703|-> 		abi16_bo_info(&nvbo->base, &req);
#  704|   		nvbo->name = name;
#  705|   		DRMLISTADD(&nvbo->head, &nvdev->bo_list);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def56]
libdrm-2.4.128/radeon/radeon_bo_gem.c:89:13: warning[-Wanalyzer-malloc-leak]: leak of ‘bo’
libdrm-2.4.128/radeon/radeon_bo_gem.c:70:33: acquire_memory: allocated here
libdrm-2.4.128/radeon/radeon_bo_gem.c:71:8: branch_false: following ‘false’ branch (when ‘bo’ is non-NULL)...
libdrm-2.4.128/radeon/radeon_bo_gem.c:75:5: branch_false: ...to here
libdrm-2.4.128/radeon/radeon_bo_gem.c:84:8: branch_true: following ‘true’ branch (when ‘handle != 0’)...
libdrm-2.4.128/radeon/radeon_bo_gem.c:87:9: branch_true: ...to here
libdrm-2.4.128/radeon/radeon_bo_gem.c:89:13: throw: if ‘drmIoctl’ throws an exception...
libdrm-2.4.128/radeon/radeon_bo_gem.c:89:13: danger: ‘bo’ leaks here; was allocated at [(1)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/0)
#   87|           memset(&open_arg, 0, sizeof(open_arg));
#   88|           open_arg.name = handle;
#   89|->         r = drmIoctl(bom->fd, DRM_IOCTL_GEM_OPEN, &open_arg);
#   90|           if (r != 0) {
#   91|               free(bo);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def57]
libdrm-2.4.128/radeon/radeon_bo_gem.c:105:13: warning[-Wanalyzer-malloc-leak]: leak of ‘bo’
libdrm-2.4.128/radeon/radeon_bo_gem.c:70:33: acquire_memory: allocated here
libdrm-2.4.128/radeon/radeon_bo_gem.c:71:8: branch_false: following ‘false’ branch (when ‘bo’ is non-NULL)...
libdrm-2.4.128/radeon/radeon_bo_gem.c:75:5: branch_false: ...to here
libdrm-2.4.128/radeon/radeon_bo_gem.c:84:8: branch_false: following ‘false’ branch (when ‘handle == 0’)...
libdrm-2.4.128/radeon/radeon_bo_gem.c:100:9: branch_false: ...to here
libdrm-2.4.128/radeon/radeon_bo_gem.c:105:13: throw: if ‘drmCommandWriteRead’ throws an exception...
libdrm-2.4.128/radeon/radeon_bo_gem.c:105:13: danger: ‘bo’ leaks here; was allocated at [(1)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/0)
#  103|           args.flags = flags;
#  104|           args.handle = 0;
#  105|->         r = drmCommandWriteRead(bom->fd, DRM_RADEON_GEM_CREATE,
#  106|                                   &args, sizeof(args));
#  107|           bo->base.handle = args.handle;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def58]
libdrm-2.4.128/radeon/radeon_bo_gem.c:117:5: warning[-Wanalyzer-malloc-leak]: leak of ‘bo’
libdrm-2.4.128/radeon/radeon_bo_gem.c:70:33: acquire_memory: allocated here
libdrm-2.4.128/radeon/radeon_bo_gem.c:71:8: branch_false: following ‘false’ branch (when ‘bo’ is non-NULL)...
libdrm-2.4.128/radeon/radeon_bo_gem.c:75:5: branch_false: ...to here
libdrm-2.4.128/radeon/radeon_bo_gem.c:84:8: branch_true: following ‘true’ branch (when ‘handle != 0’)...
libdrm-2.4.128/radeon/radeon_bo_gem.c:87:9: branch_true: ...to here
libdrm-2.4.128/radeon/radeon_bo_gem.c:90:12: branch_false: following ‘false’ branch...
libdrm-2.4.128/radeon/radeon_bo_gem.c:94:27: branch_false: ...to here
libdrm-2.4.128/radeon/radeon_bo_gem.c:117:5: throw: if ‘radeon_bo_ref’ throws an exception...
libdrm-2.4.128/radeon/radeon_bo_gem.c:117:5: danger: ‘bo’ leaks here; was allocated at [(1)](sarif:/runs/0/results/2/codeFlows/0/threadFlows/0/locations/0)
#  115|           }
#  116|       }
#  117|->     radeon_bo_ref((struct radeon_bo*)bo);
#  118|       return (struct radeon_bo*)bo;
#  119|   }

Error: GCC_ANALYZER_WARNING (CWE-401): [#def59]
libdrm-2.4.128/radeon/radeon_bo_gem.c:387:9: warning[-Wanalyzer-malloc-leak]: leak of ‘bo’
libdrm-2.4.128/radeon/radeon_bo_gem.c:372:33: acquire_memory: allocated here
libdrm-2.4.128/radeon/radeon_bo_gem.c:373:8: branch_false: following ‘false’ branch (when ‘bo’ is non-NULL)...
libdrm-2.4.128/radeon/radeon_bo_gem.c:377:5: branch_false: ...to here
libdrm-2.4.128/radeon/radeon_bo_gem.c:387:9: throw: if ‘drmPrimeFDToHandle’ throws an exception...
libdrm-2.4.128/radeon/radeon_bo_gem.c:387:9: danger: ‘bo’ leaks here; was allocated at [(1)](sarif:/runs/0/results/3/codeFlows/0/threadFlows/0/locations/0)
#  385|       bo->map_count = 0;
#  386|   
#  387|->     r = drmPrimeFDToHandle(bom->fd, fd_handle, &handle);
#  388|       if (r != 0) {
#  389|   	free(bo);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def60]
libdrm-2.4.128/radeon/radeon_bo_gem.c:396:5: warning[-Wanalyzer-malloc-leak]: leak of ‘bo’
libdrm-2.4.128/radeon/radeon_bo_gem.c:372:33: acquire_memory: allocated here
libdrm-2.4.128/radeon/radeon_bo_gem.c:373:8: branch_false: following ‘false’ branch (when ‘bo’ is non-NULL)...
libdrm-2.4.128/radeon/radeon_bo_gem.c:377:5: branch_false: ...to here
libdrm-2.4.128/radeon/radeon_bo_gem.c:388:8: branch_false: following ‘false’ branch...
libdrm-2.4.128/radeon/radeon_bo_gem.c:393:5: branch_false: ...to here
libdrm-2.4.128/radeon/radeon_bo_gem.c:396:5: throw: if ‘radeon_bo_ref’ throws an exception...
libdrm-2.4.128/radeon/radeon_bo_gem.c:396:5: danger: ‘bo’ leaks here; was allocated at [(1)](sarif:/runs/0/results/4/codeFlows/0/threadFlows/0/locations/0)
#  394|       bo->name = handle;
#  395|   
#  396|->     radeon_bo_ref((struct radeon_bo *)bo);
#  397|       return (struct radeon_bo *)bo;
#  398|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def61]
libdrm-2.4.128/radeon/radeon_cs_gem.c:534:9: warning[-Wanalyzer-malloc-leak]: leak of ‘csm’
libdrm-2.4.128/radeon/radeon_cs_gem.c:539:38: enter_function: entry to ‘radeon_cs_manager_gem_ctor’
libdrm-2.4.128/radeon/radeon_cs_gem.c:543:11: acquire_memory: allocated here
libdrm-2.4.128/radeon/radeon_cs_gem.c:544:8: branch_false: following ‘false’ branch (when ‘csm’ is non-NULL)...
libdrm-2.4.128/radeon/radeon_cs_gem.c:547:5: branch_false: ...to here
libdrm-2.4.128/radeon/radeon_cs_gem.c:549:5: call_function: calling ‘radeon_get_device_id’ from ‘radeon_cs_manager_gem_ctor’
#  532|       info.request = RADEON_INFO_DEVICE_ID;
#  533|       info.value = (uintptr_t)device_id;
#  534|->     r = drmCommandWriteRead(fd, DRM_RADEON_INFO, &info,
#  535|                               sizeof(struct drm_radeon_info));
#  536|       return r;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def62]
libdrm-2.4.128/radeon/radeon_surface.c:132:9: warning[-Wanalyzer-malloc-leak]: leak of ‘surf_man’
libdrm-2.4.128/radeon/radeon_surface.c:2413:1: enter_function: entry to ‘radeon_surface_manager_new’
libdrm-2.4.128/radeon/radeon_surface.c:2417:16: acquire_memory: allocated here
libdrm-2.4.128/radeon/radeon_surface.c:2418:8: branch_false: following ‘false’ branch (when ‘surf_man’ is non-NULL)...
libdrm-2.4.128/radeon/radeon_surface.c:2421:5: branch_false: ...to here
libdrm-2.4.128/radeon/radeon_surface.c:2422:9: call_function: calling ‘radeon_get_value’ from ‘radeon_surface_manager_new’
#  130|       info.request = req;
#  131|       info.value = (uintptr_t)value;
#  132|->     r = drmCommandWriteRead(fd, DRM_RADEON_INFO, &info,
#  133|                               sizeof(struct drm_radeon_info));
#  134|       return r;

Error: GCC_ANALYZER_WARNING (CWE-775): [#def63]
libdrm-2.4.128/tests/amdgpu/amdgpu_stress.c:113:27: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘open(_2->nodes[2], 524290)’
libdrm-2.4.128/tests/amdgpu/amdgpu_stress.c:87:12: branch_false: following ‘false’ branch...
libdrm-2.4.128/tests/amdgpu/amdgpu_stress.c:87:12: branch_false: ...to here
libdrm-2.4.128/tests/amdgpu/amdgpu_stress.c:93:21: branch_true: following ‘true’ branch...
libdrm-2.4.128/tests/amdgpu/amdgpu_stress.c:98:21: branch_true: ...to here
libdrm-2.4.128/tests/amdgpu/amdgpu_stress.c:102:20: branch_false: following ‘false’ branch...
libdrm-2.4.128/tests/amdgpu/amdgpu_stress.c:105:23: branch_false: ...to here
libdrm-2.4.128/tests/amdgpu/amdgpu_stress.c:105:20: branch_false: following ‘false’ branch...
libdrm-2.4.128/tests/amdgpu/amdgpu_stress.c:108:27: branch_false: ...to here
libdrm-2.4.128/tests/amdgpu/amdgpu_stress.c:108:22: acquire_resource: opened here
libdrm-2.4.128/tests/amdgpu/amdgpu_stress.c:111:20: branch_false: following ‘false’ branch...
libdrm-2.4.128/tests/amdgpu/amdgpu_stress.c:113:27: branch_false: ...to here
libdrm-2.4.128/tests/amdgpu/amdgpu_stress.c:113:27: throw: if ‘drmGetVersion’ throws an exception...
libdrm-2.4.128/tests/amdgpu/amdgpu_stress.c:113:27: danger: ‘open(_2->nodes[2], 524290)’ leaks here; was opened at [(9)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/8)
#  111|   		if (fd < 0) continue;
#  112|   
#  113|-> 		version = drmGetVersion(fd);
#  114|   		if (!version) {
#  115|   			fprintf(stderr,

Error: GCC_ANALYZER_WARNING (CWE-401): [#def64]
libdrm-2.4.128/tests/drmdevice.c:138:11: warning[-Wanalyzer-malloc-leak]: leak of ‘devices’
libdrm-2.4.128/tests/drmdevice.c:123:8: branch_false: following ‘false’ branch...
libdrm-2.4.128/tests/drmdevice.c:128:5: branch_false: ...to here
libdrm-2.4.128/tests/drmdevice.c:131:15: acquire_memory: allocated here
libdrm-2.4.128/tests/drmdevice.c:132:8: branch_false: following ‘false’ branch (when ‘devices’ is non-NULL)...
libdrm-2.4.128/tests/drmdevice.c:137:5: branch_false: ...to here
libdrm-2.4.128/tests/drmdevice.c:138:11: throw: if ‘drmGetDevices2’ throws an exception...
libdrm-2.4.128/tests/drmdevice.c:138:11: danger: ‘devices’ leaks here; was allocated at [(3)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/2)
#  136|   
#  137|       printf("--- Retrieving devices information (PCI device revision is ignored) ---\n");
#  138|->     ret = drmGetDevices2(0, devices, max_devices);
#  139|       if (ret < 0) {
#  140|           printf("drmGetDevices2() returned an error %d\n", ret);

Error: GCC_ANALYZER_WARNING (CWE-775): [#def65]
libdrm-2.4.128/tests/drmdevice.c:157:73: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘open(*<unknown>, 524288)’
libdrm-2.4.128/tests/drmdevice.c:114:1: enter_function: entry to ‘main’
libdrm-2.4.128/tests/drmdevice.c:123:8: branch_false: following ‘false’ branch...
libdrm-2.4.128/tests/drmdevice.c:128:5: branch_false: ...to here
libdrm-2.4.128/tests/drmdevice.c:132:8: branch_false: following ‘false’ branch (when ‘devices’ is non-NULL)...
libdrm-2.4.128/tests/drmdevice.c:137:5: branch_false: ...to here
libdrm-2.4.128/tests/drmdevice.c:139:8: branch_false: following ‘false’ branch...
libdrm-2.4.128/tests/drmdevice.c:139:8: branch_false: ...to here
libdrm-2.4.128/tests/drmdevice.c:145:21: branch_true: following ‘true’ branch...
libdrm-2.4.128/tests/drmdevice.c:146:34: branch_true: ...to here
libdrm-2.4.128/tests/drmdevice.c:146:9: call_function: calling ‘print_device_info’ from ‘main’
libdrm-2.4.128/tests/drmdevice.c:146:9: return_function: returning to ‘main’ from ‘print_device_info’
libdrm-2.4.128/tests/drmdevice.c:148:25: branch_true: following ‘true’ branch (when ‘j != 3’)...
libdrm-2.4.128/tests/drmdevice.c:149:17: branch_true: ...to here
libdrm-2.4.128/tests/drmdevice.c:149:16: branch_true: following ‘true’ branch...
libdrm-2.4.128/tests/drmdevice.c:150:60: branch_true: ...to here
libdrm-2.4.128/tests/drmdevice.c:151:22: acquire_resource: opened here
libdrm-2.4.128/tests/drmdevice.c:152:20: branch_false: following ‘false’ branch...
libdrm-2.4.128/tests/drmdevice.c:157:73: branch_false: ...to here
libdrm-2.4.128/tests/drmdevice.c:158:21: throw: if ‘drmGetDevice2’ throws an exception...
libdrm-2.4.128/tests/drmdevice.c:157:73: danger: ‘open(*<unknown>, 524288)’ leaks here; was opened at [(19)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/18)
#  155|                   }
#  156|   
#  157|->                 printf("--- Retrieving device info, for node %s ---\n", devices[i]->nodes[j]);
#  158|                   if (drmGetDevice2(fd, DRM_DEVICE_GET_PCI_REVISION, &device) == 0) {
#  159|                       print_device_info(device, i, true);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def66]
libdrm-2.4.128/tests/modetest/buffers.c:69:15: warning[-Wanalyzer-malloc-leak]: leak of ‘bo’
libdrm-2.4.128/tests/modetest/buffers.c:63:14: acquire_memory: allocated here
libdrm-2.4.128/tests/modetest/buffers.c:64:12: branch_false: following ‘false’ branch (when ‘bo’ is non-NULL)...
libdrm-2.4.128/tests/modetest/buffers.c:69:15: branch_false: ...to here
libdrm-2.4.128/tests/modetest/buffers.c:69:15: throw: if ‘drmModeCreateDumbBuffer’ throws an exception...
libdrm-2.4.128/tests/modetest/buffers.c:69:15: danger: ‘bo’ leaks here; was allocated at [(1)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/0)
#   67|   	}
#   68|   
#   69|-> 	ret = drmModeCreateDumbBuffer(fd, width, height, bpp, 0, &bo->handle,
#   70|   				      &bo->pitch, &bo->size);
#   71|   	if (ret) {

Error: GCC_ANALYZER_WARNING (CWE-775): [#def67]
libdrm-2.4.128/tests/modetest/buffers.c:89:15: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(filename, "wb")’
libdrm-2.4.128/tests/modetest/buffers.c:408:6: enter_function: entry to ‘bo_dump’
libdrm-2.4.128/tests/modetest/buffers.c:412:12: branch_false: following ‘false’ branch...
libdrm-2.4.128/tests/modetest/buffers.c:415:14: branch_false: ...to here
libdrm-2.4.128/tests/modetest/buffers.c:415:14: acquire_resource: opened here
libdrm-2.4.128/tests/modetest/buffers.c:416:12: branch_true: following ‘true’ branch...
libdrm-2.4.128/tests/modetest/buffers.c:419:17: branch_true: ...to here
libdrm-2.4.128/tests/modetest/buffers.c:419:17: call_function: calling ‘bo_map’ from ‘bo_dump’
#   87|   	uint64_t offset;
#   88|   
#   89|-> 	ret = drmModeMapDumbBuffer(bo->fd, bo->handle, &offset);
#   90|   	if (ret)
#   91|   		return ret;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def68]
libdrm-2.4.128/tests/modetest/buffers.c:89:15: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(filename, "wb")’
libdrm-2.4.128/tests/modetest/buffers.c:408:6: enter_function: entry to ‘bo_dump’
libdrm-2.4.128/tests/modetest/buffers.c:412:12: branch_false: following ‘false’ branch...
libdrm-2.4.128/tests/modetest/buffers.c:415:14: branch_false: ...to here
libdrm-2.4.128/tests/modetest/buffers.c:415:14: acquire_memory: allocated here
libdrm-2.4.128/tests/modetest/buffers.c:416:12: branch_true: following ‘true’ branch...
libdrm-2.4.128/tests/modetest/buffers.c:419:17: branch_true: ...to here
libdrm-2.4.128/tests/modetest/buffers.c:419:17: call_function: calling ‘bo_map’ from ‘bo_dump’
#   87|   	uint64_t offset;
#   88|   
#   89|-> 	ret = drmModeMapDumbBuffer(bo->fd, bo->handle, &offset);
#   90|   	if (ret)
#   91|   		return ret;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def69]
libdrm-2.4.128/tests/modetest/modetest.c:619:9: warning[-Wanalyzer-malloc-leak]: leak of ‘res’
libdrm-2.4.128/tests/modetest/modetest.c:2196:5: enter_function: entry to ‘main’
libdrm-2.4.128/tests/modetest/modetest.c:2222:16: branch_true: following ‘true’ branch (when ‘c != -1’)...
libdrm-2.4.128/tests/modetest/modetest.c:2223:17: branch_true: ...to here
libdrm-2.4.128/tests/modetest/modetest.c:2327:12: branch_false: following ‘false’ branch...
libdrm-2.4.128/tests/modetest/modetest.c:2331:13: branch_false: ...to here
libdrm-2.4.128/tests/modetest/modetest.c:2331:12: branch_false: following ‘false’ branch...
libdrm-2.4.128/tests/modetest/modetest.c:2336:18: branch_false: ...to here
libdrm-2.4.128/tests/modetest/modetest.c:2337:12: branch_false: following ‘false’ branch...
libdrm-2.4.128/tests/modetest/modetest.c:2340:12: branch_false: ...to here
libdrm-2.4.128/tests/modetest/modetest.c:2340:12: branch_false: following ‘false’ branch (when ‘use_atomic == 0’)...
libdrm-2.4.128/tests/modetest/modetest.c:2350:9: branch_false: ...to here
libdrm-2.4.128/tests/modetest/modetest.c:2352:25: call_function: calling ‘get_resources’ from ‘main’
#  617|   		return NULL;
#  618|   
#  619|-> 	drmSetClientCap(dev->fd, DRM_CLIENT_CAP_UNIVERSAL_PLANES, 1);
#  620|   
#  621|   	_res = drmModeGetResources(dev->fd);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def70]
libdrm-2.4.128/tests/modetest/modetest.c:621:16: warning[-Wanalyzer-malloc-leak]: leak of ‘res’
libdrm-2.4.128/tests/modetest/modetest.c:2196:5: enter_function: entry to ‘main’
libdrm-2.4.128/tests/modetest/modetest.c:2222:16: branch_true: following ‘true’ branch (when ‘c != -1’)...
libdrm-2.4.128/tests/modetest/modetest.c:2223:17: branch_true: ...to here
libdrm-2.4.128/tests/modetest/modetest.c:2327:12: branch_false: following ‘false’ branch...
libdrm-2.4.128/tests/modetest/modetest.c:2331:13: branch_false: ...to here
libdrm-2.4.128/tests/modetest/modetest.c:2331:12: branch_false: following ‘false’ branch...
libdrm-2.4.128/tests/modetest/modetest.c:2336:18: branch_false: ...to here
libdrm-2.4.128/tests/modetest/modetest.c:2337:12: branch_false: following ‘false’ branch...
libdrm-2.4.128/tests/modetest/modetest.c:2340:12: branch_false: ...to here
libdrm-2.4.128/tests/modetest/modetest.c:2340:12: branch_false: following ‘false’ branch (when ‘use_atomic == 0’)...
libdrm-2.4.128/tests/modetest/modetest.c:2350:9: branch_false: ...to here
libdrm-2.4.128/tests/modetest/modetest.c:2352:25: call_function: calling ‘get_resources’ from ‘main’
#  619|   	drmSetClientCap(dev->fd, DRM_CLIENT_CAP_UNIVERSAL_PLANES, 1);
#  620|   
#  621|-> 	_res = drmModeGetResources(dev->fd);
#  622|   	if (!_res) {
#  623|   		fprintf(stderr, "drmModeGetResources failed: %s\n",

Error: GCC_ANALYZER_WARNING (CWE-401): [#def71]
libdrm-2.4.128/tests/modetest/modetest.c:640:13: warning[-Wanalyzer-malloc-leak]: leak of ‘<unknown>’
libdrm-2.4.128/tests/modetest/modetest.c:2196:5: enter_function: entry to ‘main’
libdrm-2.4.128/tests/modetest/modetest.c:2222:16: branch_true: following ‘true’ branch (when ‘c != -1’)...
libdrm-2.4.128/tests/modetest/modetest.c:2223:17: branch_true: ...to here
libdrm-2.4.128/tests/modetest/modetest.c:2327:12: branch_false: following ‘false’ branch...
libdrm-2.4.128/tests/modetest/modetest.c:2331:13: branch_false: ...to here
libdrm-2.4.128/tests/modetest/modetest.c:2331:12: branch_false: following ‘false’ branch...
libdrm-2.4.128/tests/modetest/modetest.c:2336:18: branch_false: ...to here
libdrm-2.4.128/tests/modetest/modetest.c:2337:12: branch_false: following ‘false’ branch...
libdrm-2.4.128/tests/modetest/modetest.c:2340:12: branch_false: ...to here
libdrm-2.4.128/tests/modetest/modetest.c:2340:12: branch_false: following ‘false’ branch (when ‘use_atomic == 0’)...
libdrm-2.4.128/tests/modetest/modetest.c:2350:9: branch_false: ...to here
libdrm-2.4.128/tests/modetest/modetest.c:2352:25: call_function: calling ‘get_resources’ from ‘main’
#  638|   
#  639|   	if (!res->crtcs || !res->encoders || !res->connectors || !res->fbs) {
#  640|-> 	    drmModeFreeResources(_res);
#  641|   		goto error;
#  642|       }

Error: GCC_ANALYZER_WARNING (CWE-401): [#def72]
libdrm-2.4.128/tests/modetest/modetest.c:640:13: warning[-Wanalyzer-malloc-leak]: leak of ‘res’
libdrm-2.4.128/tests/modetest/modetest.c:2196:5: enter_function: entry to ‘main’
libdrm-2.4.128/tests/modetest/modetest.c:2222:16: branch_true: following ‘true’ branch (when ‘c != -1’)...
libdrm-2.4.128/tests/modetest/modetest.c:2223:17: branch_true: ...to here
libdrm-2.4.128/tests/modetest/modetest.c:2327:12: branch_false: following ‘false’ branch...
libdrm-2.4.128/tests/modetest/modetest.c:2331:13: branch_false: ...to here
libdrm-2.4.128/tests/modetest/modetest.c:2331:12: branch_false: following ‘false’ branch...
libdrm-2.4.128/tests/modetest/modetest.c:2336:18: branch_false: ...to here
libdrm-2.4.128/tests/modetest/modetest.c:2337:12: branch_false: following ‘false’ branch...
libdrm-2.4.128/tests/modetest/modetest.c:2340:12: branch_false: ...to here
libdrm-2.4.128/tests/modetest/modetest.c:2340:12: branch_false: following ‘false’ branch (when ‘use_atomic == 0’)...
libdrm-2.4.128/tests/modetest/modetest.c:2350:9: branch_false: ...to here
libdrm-2.4.128/tests/modetest/modetest.c:2352:25: call_function: calling ‘get_resources’ from ‘main’
#  638|   
#  639|   	if (!res->crtcs || !res->encoders || !res->connectors || !res->fbs) {
#  640|-> 	    drmModeFreeResources(_res);
#  641|   		goto error;
#  642|       }

Error: GCC_ANALYZER_WARNING (CWE-401): [#def73]
libdrm-2.4.128/tests/modetest/modetest.c:657:9: warning[-Wanalyzer-malloc-leak]: leak of ‘*res.crtcs + (long unsigned int)i * 32’
libdrm-2.4.128/tests/modetest/modetest.c:2196:5: enter_function: entry to ‘main’
libdrm-2.4.128/tests/modetest/modetest.c:2222:16: branch_true: following ‘true’ branch (when ‘c != -1’)...
libdrm-2.4.128/tests/modetest/modetest.c:2223:17: branch_true: ...to here
libdrm-2.4.128/tests/modetest/modetest.c:2327:12: branch_false: following ‘false’ branch...
libdrm-2.4.128/tests/modetest/modetest.c:2331:13: branch_false: ...to here
libdrm-2.4.128/tests/modetest/modetest.c:2331:12: branch_false: following ‘false’ branch...
libdrm-2.4.128/tests/modetest/modetest.c:2336:18: branch_false: ...to here
libdrm-2.4.128/tests/modetest/modetest.c:2337:12: branch_false: following ‘false’ branch...
libdrm-2.4.128/tests/modetest/modetest.c:2340:12: branch_false: ...to here
libdrm-2.4.128/tests/modetest/modetest.c:2340:12: branch_false: following ‘false’ branch (when ‘use_atomic == 0’)...
libdrm-2.4.128/tests/modetest/modetest.c:2350:9: branch_false: ...to here
libdrm-2.4.128/tests/modetest/modetest.c:2352:25: call_function: calling ‘get_resources’ from ‘main’
#  655|   	} while (0)
#  656|   
#  657|-> 	get_resource(res, _res, crtc, Crtc);
#  658|   	get_resource(res, _res, encoder, Encoder);
#  659|   	get_resource(res, _res, connector, Connector);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def74]
libdrm-2.4.128/tests/modetest/modetest.c:657:9: warning[-Wanalyzer-malloc-leak]: leak of ‘<unknown>’
libdrm-2.4.128/tests/modetest/modetest.c:2196:5: enter_function: entry to ‘main’
libdrm-2.4.128/tests/modetest/modetest.c:2222:16: branch_true: following ‘true’ branch (when ‘c != -1’)...
libdrm-2.4.128/tests/modetest/modetest.c:2223:17: branch_true: ...to here
libdrm-2.4.128/tests/modetest/modetest.c:2327:12: branch_false: following ‘false’ branch...
libdrm-2.4.128/tests/modetest/modetest.c:2331:13: branch_false: ...to here
libdrm-2.4.128/tests/modetest/modetest.c:2331:12: branch_false: following ‘false’ branch...
libdrm-2.4.128/tests/modetest/modetest.c:2336:18: branch_false: ...to here
libdrm-2.4.128/tests/modetest/modetest.c:2337:12: branch_false: following ‘false’ branch...
libdrm-2.4.128/tests/modetest/modetest.c:2340:12: branch_false: ...to here
libdrm-2.4.128/tests/modetest/modetest.c:2340:12: branch_false: following ‘false’ branch (when ‘use_atomic == 0’)...
libdrm-2.4.128/tests/modetest/modetest.c:2350:9: branch_false: ...to here
libdrm-2.4.128/tests/modetest/modetest.c:2352:25: call_function: calling ‘get_resources’ from ‘main’
#  655|   	} while (0)
#  656|   
#  657|-> 	get_resource(res, _res, crtc, Crtc);
#  658|   	get_resource(res, _res, encoder, Encoder);
#  659|   	get_resource(res, _res, connector, Connector);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def75]
libdrm-2.4.128/tests/modetest/modetest.c:657:9: warning[-Wanalyzer-malloc-leak]: leak of ‘res’
libdrm-2.4.128/tests/modetest/modetest.c:2196:5: enter_function: entry to ‘main’
libdrm-2.4.128/tests/modetest/modetest.c:2222:16: branch_true: following ‘true’ branch (when ‘c != -1’)...
libdrm-2.4.128/tests/modetest/modetest.c:2223:17: branch_true: ...to here
libdrm-2.4.128/tests/modetest/modetest.c:2327:12: branch_false: following ‘false’ branch...
libdrm-2.4.128/tests/modetest/modetest.c:2331:13: branch_false: ...to here
libdrm-2.4.128/tests/modetest/modetest.c:2331:12: branch_false: following ‘false’ branch...
libdrm-2.4.128/tests/modetest/modetest.c:2336:18: branch_false: ...to here
libdrm-2.4.128/tests/modetest/modetest.c:2337:12: branch_false: following ‘false’ branch...
libdrm-2.4.128/tests/modetest/modetest.c:2340:12: branch_false: ...to here
libdrm-2.4.128/tests/modetest/modetest.c:2340:12: branch_false: following ‘false’ branch (when ‘use_atomic == 0’)...
libdrm-2.4.128/tests/modetest/modetest.c:2350:9: branch_false: ...to here
libdrm-2.4.128/tests/modetest/modetest.c:2352:25: call_function: calling ‘get_resources’ from ‘main’
#  655|   	} while (0)
#  656|   
#  657|-> 	get_resource(res, _res, crtc, Crtc);
#  658|   	get_resource(res, _res, encoder, Encoder);
#  659|   	get_resource(res, _res, connector, Connector);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def76]
libdrm-2.4.128/tests/modetest/modetest.c:658:9: warning[-Wanalyzer-malloc-leak]: leak of ‘*res.encoders + (long unsigned int)i * 8’
libdrm-2.4.128/tests/modetest/modetest.c:2196:5: enter_function: entry to ‘main’
libdrm-2.4.128/tests/modetest/modetest.c:2222:16: branch_true: following ‘true’ branch (when ‘c != -1’)...
libdrm-2.4.128/tests/modetest/modetest.c:2223:17: branch_true: ...to here
libdrm-2.4.128/tests/modetest/modetest.c:2327:12: branch_false: following ‘false’ branch...
libdrm-2.4.128/tests/modetest/modetest.c:2331:13: branch_false: ...to here
libdrm-2.4.128/tests/modetest/modetest.c:2331:12: branch_false: following ‘false’ branch...
libdrm-2.4.128/tests/modetest/modetest.c:2336:18: branch_false: ...to here
libdrm-2.4.128/tests/modetest/modetest.c:2337:12: branch_false: following ‘false’ branch...
libdrm-2.4.128/tests/modetest/modetest.c:2340:12: branch_false: ...to here
libdrm-2.4.128/tests/modetest/modetest.c:2340:12: branch_false: following ‘false’ branch (when ‘use_atomic == 0’)...
libdrm-2.4.128/tests/modetest/modetest.c:2350:9: branch_false: ...to here
libdrm-2.4.128/tests/modetest/modetest.c:2352:25: call_function: calling ‘get_resources’ from ‘main’
#  656|   
#  657|   	get_resource(res, _res, crtc, Crtc);
#  658|-> 	get_resource(res, _res, encoder, Encoder);
#  659|   	get_resource(res, _res, connector, Connector);
#  660|   	get_resource(res, _res, fb, FB);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def77]
libdrm-2.4.128/tests/modetest/modetest.c:658:9: warning[-Wanalyzer-malloc-leak]: leak of ‘<unknown>’
libdrm-2.4.128/tests/modetest/modetest.c:2196:5: enter_function: entry to ‘main’
libdrm-2.4.128/tests/modetest/modetest.c:2222:16: branch_true: following ‘true’ branch (when ‘c != -1’)...
libdrm-2.4.128/tests/modetest/modetest.c:2223:17: branch_true: ...to here
libdrm-2.4.128/tests/modetest/modetest.c:2327:12: branch_false: following ‘false’ branch...
libdrm-2.4.128/tests/modetest/modetest.c:2331:13: branch_false: ...to here
libdrm-2.4.128/tests/modetest/modetest.c:2331:12: branch_false: following ‘false’ branch...
libdrm-2.4.128/tests/modetest/modetest.c:2336:18: branch_false: ...to here
libdrm-2.4.128/tests/modetest/modetest.c:2337:12: branch_false: following ‘false’ branch...
libdrm-2.4.128/tests/modetest/modetest.c:2340:12: branch_false: ...to here
libdrm-2.4.128/tests/modetest/modetest.c:2340:12: branch_false: following ‘false’ branch (when ‘use_atomic == 0’)...
libdrm-2.4.128/tests/modetest/modetest.c:2350:9: branch_false: ...to here
libdrm-2.4.128/tests/modetest/modetest.c:2352:25: call_function: calling ‘get_resources’ from ‘main’
#  656|   
#  657|   	get_resource(res, _res, crtc, Crtc);
#  658|-> 	get_resource(res, _res, encoder, Encoder);
#  659|   	get_resource(res, _res, connector, Connector);
#  660|   	get_resource(res, _res, fb, FB);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def78]
libdrm-2.4.128/tests/modetest/modetest.c:658:9: warning[-Wanalyzer-malloc-leak]: leak of ‘res’
libdrm-2.4.128/tests/modetest/modetest.c:2196:5: enter_function: entry to ‘main’
libdrm-2.4.128/tests/modetest/modetest.c:2222:16: branch_true: following ‘true’ branch (when ‘c != -1’)...
libdrm-2.4.128/tests/modetest/modetest.c:2223:17: branch_true: ...to here
libdrm-2.4.128/tests/modetest/modetest.c:2327:12: branch_false: following ‘false’ branch...
libdrm-2.4.128/tests/modetest/modetest.c:2331:13: branch_false: ...to here
libdrm-2.4.128/tests/modetest/modetest.c:2331:12: branch_false: following ‘false’ branch...
libdrm-2.4.128/tests/modetest/modetest.c:2336:18: branch_false: ...to here
libdrm-2.4.128/tests/modetest/modetest.c:2337:12: branch_false: following ‘false’ branch...
libdrm-2.4.128/tests/modetest/modetest.c:2340:12: branch_false: ...to here
libdrm-2.4.128/tests/modetest/modetest.c:2340:12: branch_false: following ‘false’ branch (when ‘use_atomic == 0’)...
libdrm-2.4.128/tests/modetest/modetest.c:2350:9: branch_false: ...to here
libdrm-2.4.128/tests/modetest/modetest.c:2352:25: call_function: calling ‘get_resources’ from ‘main’
#  656|   
#  657|   	get_resource(res, _res, crtc, Crtc);
#  658|-> 	get_resource(res, _res, encoder, Encoder);
#  659|   	get_resource(res, _res, connector, Connector);
#  660|   	get_resource(res, _res, fb, FB);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def79]
libdrm-2.4.128/tests/modetest/modetest.c:659:9: warning[-Wanalyzer-malloc-leak]: leak of ‘*res.connectors + (long unsigned int)i * 32’
libdrm-2.4.128/tests/modetest/modetest.c:2196:5: enter_function: entry to ‘main’
libdrm-2.4.128/tests/modetest/modetest.c:2222:16: branch_true: following ‘true’ branch (when ‘c != -1’)...
libdrm-2.4.128/tests/modetest/modetest.c:2223:17: branch_true: ...to here
libdrm-2.4.128/tests/modetest/modetest.c:2327:12: branch_false: following ‘false’ branch...
libdrm-2.4.128/tests/modetest/modetest.c:2331:13: branch_false: ...to here
libdrm-2.4.128/tests/modetest/modetest.c:2331:12: branch_false: following ‘false’ branch...
libdrm-2.4.128/tests/modetest/modetest.c:2336:18: branch_false: ...to here
libdrm-2.4.128/tests/modetest/modetest.c:2337:12: branch_false: following ‘false’ branch...
libdrm-2.4.128/tests/modetest/modetest.c:2340:12: branch_false: ...to here
libdrm-2.4.128/tests/modetest/modetest.c:2340:12: branch_false: following ‘false’ branch (when ‘use_atomic == 0’)...
libdrm-2.4.128/tests/modetest/modetest.c:2350:9: branch_false: ...to here
libdrm-2.4.128/tests/modetest/modetest.c:2352:25: call_function: calling ‘get_resources’ from ‘main’
#  657|   	get_resource(res, _res, crtc, Crtc);
#  658|   	get_resource(res, _res, encoder, Encoder);
#  659|-> 	get_resource(res, _res, connector, Connector);
#  660|   	get_resource(res, _res, fb, FB);
#  661|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def80]
libdrm-2.4.128/tests/modetest/modetest.c:659:9: warning[-Wanalyzer-malloc-leak]: leak of ‘<unknown>’
libdrm-2.4.128/tests/modetest/modetest.c:2196:5: enter_function: entry to ‘main’
libdrm-2.4.128/tests/modetest/modetest.c:2222:16: branch_true: following ‘true’ branch (when ‘c != -1’)...
libdrm-2.4.128/tests/modetest/modetest.c:2223:17: branch_true: ...to here
libdrm-2.4.128/tests/modetest/modetest.c:2327:12: branch_false: following ‘false’ branch...
libdrm-2.4.128/tests/modetest/modetest.c:2331:13: branch_false: ...to here
libdrm-2.4.128/tests/modetest/modetest.c:2331:12: branch_false: following ‘false’ branch...
libdrm-2.4.128/tests/modetest/modetest.c:2336:18: branch_false: ...to here
libdrm-2.4.128/tests/modetest/modetest.c:2337:12: branch_false: following ‘false’ branch...
libdrm-2.4.128/tests/modetest/modetest.c:2340:12: branch_false: ...to here
libdrm-2.4.128/tests/modetest/modetest.c:2340:12: branch_false: following ‘false’ branch (when ‘use_atomic == 0’)...
libdrm-2.4.128/tests/modetest/modetest.c:2350:9: branch_false: ...to here
libdrm-2.4.128/tests/modetest/modetest.c:2352:25: call_function: calling ‘get_resources’ from ‘main’
#  657|   	get_resource(res, _res, crtc, Crtc);
#  658|   	get_resource(res, _res, encoder, Encoder);
#  659|-> 	get_resource(res, _res, connector, Connector);
#  660|   	get_resource(res, _res, fb, FB);
#  661|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def81]
libdrm-2.4.128/tests/modetest/modetest.c:659:9: warning[-Wanalyzer-malloc-leak]: leak of ‘res’
libdrm-2.4.128/tests/modetest/modetest.c:2196:5: enter_function: entry to ‘main’
libdrm-2.4.128/tests/modetest/modetest.c:2222:16: branch_true: following ‘true’ branch (when ‘c != -1’)...
libdrm-2.4.128/tests/modetest/modetest.c:2223:17: branch_true: ...to here
libdrm-2.4.128/tests/modetest/modetest.c:2327:12: branch_false: following ‘false’ branch...
libdrm-2.4.128/tests/modetest/modetest.c:2331:13: branch_false: ...to here
libdrm-2.4.128/tests/modetest/modetest.c:2331:12: branch_false: following ‘false’ branch...
libdrm-2.4.128/tests/modetest/modetest.c:2336:18: branch_false: ...to here
libdrm-2.4.128/tests/modetest/modetest.c:2337:12: branch_false: following ‘false’ branch...
libdrm-2.4.128/tests/modetest/modetest.c:2340:12: branch_false: ...to here
libdrm-2.4.128/tests/modetest/modetest.c:2340:12: branch_false: following ‘false’ branch (when ‘use_atomic == 0’)...
libdrm-2.4.128/tests/modetest/modetest.c:2350:9: branch_false: ...to here
libdrm-2.4.128/tests/modetest/modetest.c:2352:25: call_function: calling ‘get_resources’ from ‘main’
#  657|   	get_resource(res, _res, crtc, Crtc);
#  658|   	get_resource(res, _res, encoder, Encoder);
#  659|-> 	get_resource(res, _res, connector, Connector);
#  660|   	get_resource(res, _res, fb, FB);
#  661|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def82]
libdrm-2.4.128/tests/modetest/modetest.c:660:9: warning[-Wanalyzer-malloc-leak]: leak of ‘res’
libdrm-2.4.128/tests/modetest/modetest.c:2196:5: enter_function: entry to ‘main’
libdrm-2.4.128/tests/modetest/modetest.c:2222:16: branch_true: following ‘true’ branch (when ‘c != -1’)...
libdrm-2.4.128/tests/modetest/modetest.c:2223:17: branch_true: ...to here
libdrm-2.4.128/tests/modetest/modetest.c:2327:12: branch_false: following ‘false’ branch...
libdrm-2.4.128/tests/modetest/modetest.c:2331:13: branch_false: ...to here
libdrm-2.4.128/tests/modetest/modetest.c:2331:12: branch_false: following ‘false’ branch...
libdrm-2.4.128/tests/modetest/modetest.c:2336:18: branch_false: ...to here
libdrm-2.4.128/tests/modetest/modetest.c:2337:12: branch_false: following ‘false’ branch...
libdrm-2.4.128/tests/modetest/modetest.c:2340:12: branch_false: ...to here
libdrm-2.4.128/tests/modetest/modetest.c:2340:12: branch_false: following ‘false’ branch (when ‘use_atomic == 0’)...
libdrm-2.4.128/tests/modetest/modetest.c:2350:9: branch_false: ...to here
libdrm-2.4.128/tests/modetest/modetest.c:2352:25: call_function: calling ‘get_resources’ from ‘main’
#  658|   	get_resource(res, _res, encoder, Encoder);
#  659|   	get_resource(res, _res, connector, Connector);
#  660|-> 	get_resource(res, _res, fb, FB);
#  661|   
#  662|   	drmModeFreeResources(_res);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def83]
libdrm-2.4.128/tests/modetest/modetest.c:662:9: warning[-Wanalyzer-malloc-leak]: leak of ‘res’
libdrm-2.4.128/tests/modetest/modetest.c:2196:5: enter_function: entry to ‘main’
libdrm-2.4.128/tests/modetest/modetest.c:2222:16: branch_true: following ‘true’ branch (when ‘c != -1’)...
libdrm-2.4.128/tests/modetest/modetest.c:2223:17: branch_true: ...to here
libdrm-2.4.128/tests/modetest/modetest.c:2327:12: branch_false: following ‘false’ branch...
libdrm-2.4.128/tests/modetest/modetest.c:2331:13: branch_false: ...to here
libdrm-2.4.128/tests/modetest/modetest.c:2331:12: branch_false: following ‘false’ branch...
libdrm-2.4.128/tests/modetest/modetest.c:2336:18: branch_false: ...to here
libdrm-2.4.128/tests/modetest/modetest.c:2337:12: branch_false: following ‘false’ branch...
libdrm-2.4.128/tests/modetest/modetest.c:2340:12: branch_false: ...to here
libdrm-2.4.128/tests/modetest/modetest.c:2340:12: branch_false: following ‘false’ branch (when ‘use_atomic == 0’)...
libdrm-2.4.128/tests/modetest/modetest.c:2350:9: branch_false: ...to here
libdrm-2.4.128/tests/modetest/modetest.c:2352:25: call_function: calling ‘get_resources’ from ‘main’
#  660|   	get_resource(res, _res, fb, FB);
#  661|   
#  662|-> 	drmModeFreeResources(_res);
#  663|   
#  664|   	/* Set the name of all connectors based on the type name and the per-type ID. */

Error: GCC_ANALYZER_WARNING (CWE-401): [#def84]
libdrm-2.4.128/tests/modetest/modetest.c:670:23: warning[-Wanalyzer-malloc-leak]: leak of ‘res’
libdrm-2.4.128/tests/modetest/modetest.c:2196:5: enter_function: entry to ‘main’
libdrm-2.4.128/tests/modetest/modetest.c:2222:16: branch_true: following ‘true’ branch (when ‘c != -1’)...
libdrm-2.4.128/tests/modetest/modetest.c:2223:17: branch_true: ...to here
libdrm-2.4.128/tests/modetest/modetest.c:2327:12: branch_false: following ‘false’ branch...
libdrm-2.4.128/tests/modetest/modetest.c:2331:13: branch_false: ...to here
libdrm-2.4.128/tests/modetest/modetest.c:2331:12: branch_false: following ‘false’ branch...
libdrm-2.4.128/tests/modetest/modetest.c:2336:18: branch_false: ...to here
libdrm-2.4.128/tests/modetest/modetest.c:2337:12: branch_false: following ‘false’ branch...
libdrm-2.4.128/tests/modetest/modetest.c:2340:12: branch_false: ...to here
libdrm-2.4.128/tests/modetest/modetest.c:2340:12: branch_false: following ‘false’ branch (when ‘use_atomic == 0’)...
libdrm-2.4.128/tests/modetest/modetest.c:2350:9: branch_false: ...to here
libdrm-2.4.128/tests/modetest/modetest.c:2352:25: call_function: calling ‘get_resources’ from ‘main’
#  668|   		int num;
#  669|   
#  670|-> 		num = asprintf(&connector->name, "%s-%u",
#  671|   			 drmModeGetConnectorTypeName(conn->connector_type),
#  672|   			 conn->connector_type_id);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def85]
libdrm-2.4.128/tests/modetest/modetest.c:702:9: warning[-Wanalyzer-malloc-leak]: leak of ‘res’
libdrm-2.4.128/tests/modetest/modetest.c:2196:5: enter_function: entry to ‘main’
libdrm-2.4.128/tests/modetest/modetest.c:2222:16: branch_true: following ‘true’ branch (when ‘c != -1’)...
libdrm-2.4.128/tests/modetest/modetest.c:2223:17: branch_true: ...to here
libdrm-2.4.128/tests/modetest/modetest.c:2327:12: branch_false: following ‘false’ branch...
libdrm-2.4.128/tests/modetest/modetest.c:2331:13: branch_false: ...to here
libdrm-2.4.128/tests/modetest/modetest.c:2331:12: branch_false: following ‘false’ branch...
libdrm-2.4.128/tests/modetest/modetest.c:2336:18: branch_false: ...to here
libdrm-2.4.128/tests/modetest/modetest.c:2337:12: branch_false: following ‘false’ branch...
libdrm-2.4.128/tests/modetest/modetest.c:2340:12: branch_false: ...to here
libdrm-2.4.128/tests/modetest/modetest.c:2340:12: branch_false: following ‘false’ branch (when ‘use_atomic == 0’)...
libdrm-2.4.128/tests/modetest/modetest.c:2350:9: branch_false: ...to here
libdrm-2.4.128/tests/modetest/modetest.c:2352:25: call_function: calling ‘get_resources’ from ‘main’
#  700|   	} while (0)
#  701|   
#  702|-> 	get_properties(res, crtc, CRTC);
#  703|   	get_properties(res, connector, CONNECTOR);
#  704|   

Error: GCC_ANALYZER_WARNING (CWE-457): [#def86]
libdrm-2.4.128/tests/modetest/modetest.c:1061:22: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘*p.optional’
libdrm-2.4.128/tests/modetest/modetest.c:1801:13: enter_function: entry to ‘atomic_clear_mode’
libdrm-2.4.128/tests/modetest/modetest.c:1806:21: branch_true: following ‘true’ branch (when ‘i < count’)...
libdrm-2.4.128/tests/modetest/modetest.c:1807:47: branch_true: ...to here
libdrm-2.4.128/tests/modetest/modetest.c:1815:17: call_function: calling ‘add_property’ from ‘atomic_clear_mode’
# 1059|   
# 1060|   	if (i == (int)props->count_props) {
# 1061|-> 		if (!p->optional)
# 1062|   			fprintf(stderr, "%s %i has no %s property\n",
# 1063|   				obj_type, p->obj_id, p->name);

Error: GCC_ANALYZER_WARNING (CWE-457): [#def87]
libdrm-2.4.128/tests/modetest/modetest.c:1349:9: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘ovr’
libdrm-2.4.128/tests/modetest/modetest.c:1828:13: enter_function: entry to ‘set_planes’
libdrm-2.4.128/tests/modetest/modetest.c:1833:21: branch_true: following ‘true’ branch (when ‘i < count’)...
libdrm-2.4.128/tests/modetest/modetest.c:1834:38: branch_true: ...to here
libdrm-2.4.128/tests/modetest/modetest.c:1834:21: call_function: calling ‘set_plane’ from ‘set_planes’
# 1347|   	}
# 1348|   
# 1349|-> 	ovr->crtc_id = p->crtc_id;
# 1350|   
# 1351|   	return 0;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def88]
libdrm-2.4.128/tests/modetest/modetest.c:1517:24: warning[-Wanalyzer-malloc-leak]: leak of ‘con_str’
libdrm-2.4.128/tests/modetest/modetest.c:1615:21: enter_function: entry to ‘set_mode’
libdrm-2.4.128/tests/modetest/modetest.c:1622:12: branch_true: following ‘true’ branch (when ‘count == 0’)...
libdrm-2.4.128/tests/modetest/modetest.c:1623:25: branch_true: ...to here
libdrm-2.4.128/tests/modetest/modetest.c:1623:25: call_function: calling ‘pipe_find_preferred’ from ‘set_mode’
# 1515|   	sprintf(con_str, "%d", con->connector_id);
# 1516|   	strcpy(pipe->format_str, "XR24");
# 1517|-> 	pipe->fourcc = util_format_fourcc(pipe->format_str);
# 1518|   	pipe->num_cons = 1;
# 1519|   	pipe->con_ids = calloc(1, sizeof(*pipe->con_ids));

Error: GCC_ANALYZER_WARNING (CWE-401): [#def89]
libdrm-2.4.128/tests/modetest/modetest.c:1517:24: warning[-Wanalyzer-malloc-leak]: leak of ‘pipes’
libdrm-2.4.128/tests/modetest/modetest.c:1615:21: enter_function: entry to ‘set_mode’
libdrm-2.4.128/tests/modetest/modetest.c:1622:12: branch_true: following ‘true’ branch (when ‘count == 0’)...
libdrm-2.4.128/tests/modetest/modetest.c:1623:25: branch_true: ...to here
libdrm-2.4.128/tests/modetest/modetest.c:1623:25: call_function: calling ‘pipe_find_preferred’ from ‘set_mode’
# 1515|   	sprintf(con_str, "%d", con->connector_id);
# 1516|   	strcpy(pipe->format_str, "XR24");
# 1517|-> 	pipe->fourcc = util_format_fourcc(pipe->format_str);
# 1518|   	pipe->num_cons = 1;
# 1519|   	pipe->con_ids = calloc(1, sizeof(*pipe->con_ids));

Error: GCC_ANALYZER_WARNING (CWE-476): [#def90]
libdrm-2.4.128/tests/modetest/modetest.c:1742:29: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’
libdrm-2.4.128/tests/modetest/modetest.c:1737:21: branch_true: following ‘true’ branch (when ‘j < count’)...
libdrm-2.4.128/tests/modetest/modetest.c:1738:47: branch_true: ...to here
libdrm-2.4.128/tests/modetest/modetest.c:1742:29: danger: dereference of NULL ‘get_connector_by_id(dev, *<unknown>)’
# 1740|   		for (i = 0; i < pipe->num_cons; i++) {
# 1741|   			connector = get_connector_by_id(dev, pipe->con_ids[i]);
# 1742|-> 			if (connector->connector_type == DRM_MODE_CONNECTOR_WRITEBACK) {
# 1743|   				if (!pipe->mode) {
# 1744|   					fprintf(stderr, "no mode for writeback\n");

Error: GCC_ANALYZER_WARNING (CWE-476): [#def91]
libdrm-2.4.128/tests/modetest/modetest.c:1795:29: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’
libdrm-2.4.128/tests/modetest/modetest.c:1790:21: branch_true: following ‘true’ branch (when ‘j < count’)...
libdrm-2.4.128/tests/modetest/modetest.c:1791:47: branch_true: ...to here
libdrm-2.4.128/tests/modetest/modetest.c:1795:29: danger: dereference of NULL ‘get_connector_by_id(dev, *<unknown>)’
# 1793|   		for (i = 0; i < pipe->num_cons; i++) {
# 1794|   			connector = get_connector_by_id(dev, pipe->con_ids[i]);
# 1795|-> 			if (connector->connector_type == DRM_MODE_CONNECTOR_WRITEBACK)
# 1796|   				bo_dump(pipe->out_bo, dump_path);
# 1797|   		}

Error: COMPILER_WARNING (CWE-704): [#def92]
libdrm-2.4.128/tests/modetest/modetest.c: scope_hint: In function ‘parse_connector’
libdrm-2.4.128/tests/modetest/modetest.c:1997:22: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type
# 1997 |                 endp = strpbrk(p, ",@:");
#      |                      ^
# 1995|   	/* Parse the connectors. */
# 1996|   	for (i = 0, p = arg; i < pipe->num_cons; ++i, p = endp + 1) {
# 1997|-> 		endp = strpbrk(p, ",@:");
# 1998|   		if (!endp)
# 1999|   			break;

Error: COMPILER_WARNING (CWE-704): [#def93]
libdrm-2.4.128/tests/modetest/modetest.c:1997:22: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type
# 1995|   	/* Parse the connectors. */
# 1996|   	for (i = 0, p = arg; i < pipe->num_cons; ++i, p = endp + 1) {
# 1997|-> 		endp = strpbrk(p, ",@:");
# 1998|   		if (!endp)
# 1999|   			break;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def94]
libdrm-2.4.128/tests/modetest/modetest.c:2027:9: warning[-Wanalyzer-malloc-leak]: leak of ‘<unknown>’
libdrm-2.4.128/tests/modetest/modetest.c:1990:25: acquire_memory: allocated here
libdrm-2.4.128/tests/modetest/modetest.c:1992:12: branch_false: following ‘false’ branch...
libdrm-2.4.128/tests/modetest/modetest.c:1996:30: branch_true: following ‘true’ branch...
libdrm-2.4.128/tests/modetest/modetest.c:1997:24: branch_true: ...to here
libdrm-2.4.128/tests/modetest/modetest.c:1998:20: branch_false: following ‘false’ branch...
libdrm-2.4.128/tests/modetest/modetest.c:2001:44: branch_false: ...to here
libdrm-2.4.128/tests/modetest/modetest.c:2007:12: branch_false: following ‘false’ branch...
libdrm-2.4.128/tests/modetest/modetest.c:2011:13: branch_false: ...to here
libdrm-2.4.128/tests/modetest/modetest.c:2011:12: branch_false: following ‘false’ branch...
libdrm-2.4.128/tests/modetest/modetest.c:2013:13: branch_false: ...to here
libdrm-2.4.128/tests/modetest/modetest.c:2013:12: branch_false: following ‘false’ branch...
libdrm-2.4.128/tests/modetest/modetest.c:2017:13: branch_false: ...to here
libdrm-2.4.128/tests/modetest/modetest.c:2017:12: branch_false: following ‘false’ branch...
libdrm-2.4.128/tests/modetest/modetest.c:2020:9: branch_false: ...to here
libdrm-2.4.128/tests/modetest/modetest.c:2027:9: danger: ‘<unknown>’ leaks here; was allocated at [(1)](sarif:/runs/0/results/28/codeFlows/0/threadFlows/0/locations/0)
# 2025|   		p = arg + strlen(arg);
# 2026|   	len = min(sizeof pipe->mode_str - 1, (unsigned int)(p - arg));
# 2027|-> 	strncpy(pipe->mode_str, arg, len);
# 2028|   	pipe->mode_str[len] = '\0';
# 2029|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def95]
libdrm-2.4.128/tests/modetest/modetest.c:2098:25: warning[-Wanalyzer-malloc-leak]: leak of ‘plane_args’
libdrm-2.4.128/tests/modetest/modetest.c:2196:5: enter_function: entry to ‘main’
libdrm-2.4.128/tests/modetest/modetest.c:2222:16: branch_true: following ‘true’ branch (when ‘c != -1’)...
libdrm-2.4.128/tests/modetest/modetest.c:2223:17: branch_true: ...to here
libdrm-2.4.128/tests/modetest/modetest.c:2262:28: branch_false: following ‘false’ branch (when ‘plane_args’ is non-NULL)...
libdrm-2.4.128/tests/modetest/modetest.c:2266:43: branch_false: ...to here
libdrm-2.4.128/tests/modetest/modetest.c:2268:29: call_function: calling ‘parse_plane’ from ‘main’
# 2096|   	}
# 2097|   
# 2098|-> 	plane->fourcc = util_format_fourcc(plane->format_str);
# 2099|   	if (plane->fourcc == 0) {
# 2100|   		fprintf(stderr, "unknown format %s\n", plane->format_str);

Error: CPPCHECK_WARNING (CWE-401): [#def96]
libdrm-2.4.128/tests/modetest/modetest.c:2260: error[memleakOnRealloc]: Common realloc mistake: 'plane_args' nulled but not freed upon failure
# 2258|   			break;
# 2259|   		case 'P':
# 2260|-> 			plane_args = realloc(plane_args,
# 2261|   					     (plane_count + 1) * sizeof *plane_args);
# 2262|   			if (plane_args == NULL) {

Error: CPPCHECK_WARNING (CWE-401): [#def97]
libdrm-2.4.128/tests/modetest/modetest.c:2278: error[memleakOnRealloc]: Common realloc mistake: 'pipe_args' nulled but not freed upon failure
# 2276|   			break;
# 2277|   		case 's':
# 2278|-> 			pipe_args = realloc(pipe_args,
# 2279|   					    (count + 1) * sizeof *pipe_args);
# 2280|   			if (pipe_args == NULL) {

Error: CPPCHECK_WARNING (CWE-401): [#def98]
libdrm-2.4.128/tests/modetest/modetest.c:2304: error[memleakOnRealloc]: Common realloc mistake: 'prop_args' nulled but not freed upon failure
# 2302|   			break;
# 2303|   		case 'w':
# 2304|-> 			prop_args = realloc(prop_args,
# 2305|   					   (prop_count + 1) * sizeof *prop_args);
# 2306|   			if (prop_args == NULL) {

Error: GCC_ANALYZER_WARNING (CWE-404): [#def99]
libdrm-2.4.128/tests/nouveau/threaded.c:51:15: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
libdrm-2.4.128/tests/nouveau/threaded.c:49:9: acquire_resource: ‘va_start’ called here
libdrm-2.4.128/tests/nouveau/threaded.c:51:15: throw: if the called function throws an exception...
libdrm-2.4.128/tests/nouveau/threaded.c:51:15: danger: missing call to ‘va_end’ to match ‘va_start’ at [(1)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/0)
#   49|   	va_start(va, request);
#   50|   	arg = va_arg(va, void *);
#   51|-> 	ret = old_ioctl(fd, request, arg);
#   52|   	va_end(va);
#   53|   

Error: GCC_ANALYZER_WARNING (CWE-775): [#def100]
libdrm-2.4.128/tests/nouveau/threaded.c:94:31: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘open(device, 2)’
libdrm-2.4.128/tests/nouveau/threaded.c:85:12: branch_false: following ‘false’ branch (when ‘argc > 1’)...
libdrm-2.4.128/tests/nouveau/threaded.c:90:17: branch_false: ...to here
libdrm-2.4.128/tests/nouveau/threaded.c:92:22: acquire_resource: opened here
libdrm-2.4.128/tests/nouveau/threaded.c:93:20: branch_true: following ‘true’ branch...
libdrm-2.4.128/tests/nouveau/threaded.c:94:31: branch_true: ...to here
libdrm-2.4.128/tests/nouveau/threaded.c:94:31: throw: if ‘open’ throws an exception...
libdrm-2.4.128/tests/nouveau/threaded.c:94:31: danger: ‘open(device, 2)’ leaks here; was opened at [(3)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/2)
#   92|   		fd = open(device, O_RDWR);
#   93|   		if (fd >= 0)
#   94|-> 			fd2 = open(device, O_RDWR);
#   95|   		else
#   96|   			fd2 = fd = -errno;

Error: GCC_ANALYZER_WARNING (CWE-775): [#def101]
libdrm-2.4.128/tests/nouveau/threaded.c:109:19: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘fd2’
libdrm-2.4.128/tests/nouveau/threaded.c:85:12: branch_false: following ‘false’ branch (when ‘argc > 1’)...
libdrm-2.4.128/tests/nouveau/threaded.c:90:17: branch_false: ...to here
libdrm-2.4.128/tests/nouveau/threaded.c:93:20: branch_true: following ‘true’ branch...
libdrm-2.4.128/tests/nouveau/threaded.c:94:31: branch_true: ...to here
libdrm-2.4.128/tests/nouveau/threaded.c:94:31: acquire_resource: opened here
libdrm-2.4.128/tests/nouveau/threaded.c:99:12: branch_false: following ‘false’ branch (when ‘fd >= 0’)...
libdrm-2.4.128/tests/nouveau/threaded.c:104:12: branch_false: ...to here
libdrm-2.4.128/tests/nouveau/threaded.c:104:12: branch_false: following ‘false’ branch (when ‘fd2 >= 0’)...
libdrm-2.4.128/tests/nouveau/threaded.c:109:19: branch_false: ...to here
libdrm-2.4.128/tests/nouveau/threaded.c:109:19: throw: if ‘drmGetVersion’ throws an exception...
libdrm-2.4.128/tests/nouveau/threaded.c:109:19: danger: ‘fd2’ leaks here; was opened at [(5)](sarif:/runs/0/results/3/codeFlows/0/threadFlows/0/locations/4)
#  107|   	}
#  108|   
#  109|-> 	version = drmGetVersion(fd);
#  110|   	if (version) {
#  111|   		printf("Version: %d.%d.%d\n", version->version_major,

Error: GCC_ANALYZER_WARNING (CWE-775): [#def102]
libdrm-2.4.128/tests/nouveau/threaded.c:109:19: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘fd’
libdrm-2.4.128/tests/nouveau/threaded.c:85:12: branch_false: following ‘false’ branch (when ‘argc > 1’)...
libdrm-2.4.128/tests/nouveau/threaded.c:90:17: branch_false: ...to here
libdrm-2.4.128/tests/nouveau/threaded.c:92:22: acquire_resource: opened here
libdrm-2.4.128/tests/nouveau/threaded.c:93:20: branch_true: following ‘true’ branch...
libdrm-2.4.128/tests/nouveau/threaded.c:94:31: branch_true: ...to here
libdrm-2.4.128/tests/nouveau/threaded.c:99:12: branch_false: following ‘false’ branch (when ‘fd >= 0’)...
libdrm-2.4.128/tests/nouveau/threaded.c:104:12: branch_false: ...to here
libdrm-2.4.128/tests/nouveau/threaded.c:104:12: branch_false: following ‘false’ branch (when ‘fd2 >= 0’)...
libdrm-2.4.128/tests/nouveau/threaded.c:109:19: branch_false: ...to here
libdrm-2.4.128/tests/nouveau/threaded.c:109:19: throw: if ‘drmGetVersion’ throws an exception...
libdrm-2.4.128/tests/nouveau/threaded.c:109:19: danger: ‘fd’ leaks here; was opened at [(3)](sarif:/runs/0/results/2/codeFlows/0/threadFlows/0/locations/2)
#  107|   	}
#  108|   
#  109|-> 	version = drmGetVersion(fd);
#  110|   	if (version) {
#  111|   		printf("Version: %d.%d.%d\n", version->version_major,

Error: GCC_ANALYZER_WARNING (CWE-775): [#def103]
libdrm-2.4.128/tests/nouveau/threaded.c:117:17: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘fd2’
libdrm-2.4.128/tests/nouveau/threaded.c:85:12: branch_false: following ‘false’ branch (when ‘argc > 1’)...
libdrm-2.4.128/tests/nouveau/threaded.c:90:17: branch_false: ...to here
libdrm-2.4.128/tests/nouveau/threaded.c:93:20: branch_true: following ‘true’ branch...
libdrm-2.4.128/tests/nouveau/threaded.c:94:31: branch_true: ...to here
libdrm-2.4.128/tests/nouveau/threaded.c:94:31: acquire_resource: opened here
libdrm-2.4.128/tests/nouveau/threaded.c:99:12: branch_false: following ‘false’ branch (when ‘fd >= 0’)...
libdrm-2.4.128/tests/nouveau/threaded.c:104:12: branch_false: ...to here
libdrm-2.4.128/tests/nouveau/threaded.c:104:12: branch_false: following ‘false’ branch (when ‘fd2 >= 0’)...
libdrm-2.4.128/tests/nouveau/threaded.c:109:19: branch_false: ...to here
libdrm-2.4.128/tests/nouveau/threaded.c:110:12: branch_true: following ‘true’ branch...
libdrm-2.4.128/tests/nouveau/threaded.c:111:17: branch_true: ...to here
libdrm-2.4.128/tests/nouveau/threaded.c:117:17: throw: if ‘drmFreeVersion’ throws an exception...
libdrm-2.4.128/tests/nouveau/threaded.c:117:17: danger: ‘fd2’ leaks here; was opened at [(5)](sarif:/runs/0/results/4/codeFlows/0/threadFlows/0/locations/4)
#  115|   		printf("  Description: %s\n", version->desc);
#  116|   
#  117|-> 		drmFreeVersion(version);
#  118|   	}
#  119|   

Error: GCC_ANALYZER_WARNING (CWE-775): [#def104]
libdrm-2.4.128/tests/nouveau/threaded.c:120:15: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘fd2’
libdrm-2.4.128/tests/nouveau/threaded.c:85:12: branch_false: following ‘false’ branch (when ‘argc > 1’)...
libdrm-2.4.128/tests/nouveau/threaded.c:90:17: branch_false: ...to here
libdrm-2.4.128/tests/nouveau/threaded.c:93:20: branch_true: following ‘true’ branch...
libdrm-2.4.128/tests/nouveau/threaded.c:94:31: branch_true: ...to here
libdrm-2.4.128/tests/nouveau/threaded.c:94:31: acquire_resource: opened here
libdrm-2.4.128/tests/nouveau/threaded.c:99:12: branch_false: following ‘false’ branch (when ‘fd >= 0’)...
libdrm-2.4.128/tests/nouveau/threaded.c:104:12: branch_false: ...to here
libdrm-2.4.128/tests/nouveau/threaded.c:104:12: branch_false: following ‘false’ branch (when ‘fd2 >= 0’)...
libdrm-2.4.128/tests/nouveau/threaded.c:109:19: branch_false: ...to here
libdrm-2.4.128/tests/nouveau/threaded.c:120:15: throw: if ‘nouveau_device_wrap’ throws an exception...
libdrm-2.4.128/tests/nouveau/threaded.c:120:15: danger: ‘fd2’ leaks here; was opened at [(5)](sarif:/runs/0/results/5/codeFlows/0/threadFlows/0/locations/4)
#  118|   	}
#  119|   
#  120|-> 	err = nouveau_device_wrap(fd, 0, &nvdev);
#  121|   	if (!err)
#  122|   		err = nouveau_device_wrap(fd2, 0, &nvdev2);

Error: GCC_ANALYZER_WARNING (CWE-775): [#def105]
libdrm-2.4.128/tests/nouveau/threaded.c:122:23: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘fd2’
libdrm-2.4.128/tests/nouveau/threaded.c:85:12: branch_false: following ‘false’ branch (when ‘argc > 1’)...
libdrm-2.4.128/tests/nouveau/threaded.c:90:17: branch_false: ...to here
libdrm-2.4.128/tests/nouveau/threaded.c:93:20: branch_true: following ‘true’ branch...
libdrm-2.4.128/tests/nouveau/threaded.c:94:31: branch_true: ...to here
libdrm-2.4.128/tests/nouveau/threaded.c:94:31: acquire_resource: opened here
libdrm-2.4.128/tests/nouveau/threaded.c:99:12: branch_false: following ‘false’ branch (when ‘fd >= 0’)...
libdrm-2.4.128/tests/nouveau/threaded.c:104:12: branch_false: ...to here
libdrm-2.4.128/tests/nouveau/threaded.c:104:12: branch_false: following ‘false’ branch (when ‘fd2 >= 0’)...
libdrm-2.4.128/tests/nouveau/threaded.c:109:19: branch_false: ...to here
libdrm-2.4.128/tests/nouveau/threaded.c:121:12: branch_true: following ‘true’ branch...
libdrm-2.4.128/tests/nouveau/threaded.c:122:23: branch_true: ...to here
libdrm-2.4.128/tests/nouveau/threaded.c:122:23: throw: if ‘nouveau_device_wrap’ throws an exception...
libdrm-2.4.128/tests/nouveau/threaded.c:122:23: danger: ‘fd2’ leaks here; was opened at [(5)](sarif:/runs/0/results/6/codeFlows/0/threadFlows/0/locations/4)
#  120|   	err = nouveau_device_wrap(fd, 0, &nvdev);
#  121|   	if (!err)
#  122|-> 		err = nouveau_device_wrap(fd2, 0, &nvdev2);
#  123|   	if (err < 0)
#  124|   		return 1;

Error: GCC_ANALYZER_WARNING (CWE-457): [#def106]
libdrm-2.4.128/tests/nouveau/threaded.c:126:15: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘nvdev2’
libdrm-2.4.128/tests/nouveau/threaded.c:85:12: branch_false: following ‘false’ branch (when ‘argc > 1’)...
libdrm-2.4.128/tests/nouveau/threaded.c:90:17: branch_false: ...to here
libdrm-2.4.128/tests/nouveau/threaded.c:93:20: branch_true: following ‘true’ branch...
libdrm-2.4.128/tests/nouveau/threaded.c:94:31: branch_true: ...to here
libdrm-2.4.128/tests/nouveau/threaded.c:99:12: branch_false: following ‘false’ branch (when ‘fd >= 0’)...
libdrm-2.4.128/tests/nouveau/threaded.c:104:12: branch_false: ...to here
libdrm-2.4.128/tests/nouveau/threaded.c:104:12: branch_false: following ‘false’ branch (when ‘fd2 >= 0’)...
libdrm-2.4.128/tests/nouveau/threaded.c:109:19: branch_false: ...to here
libdrm-2.4.128/tests/nouveau/threaded.c:121:12: branch_false: following ‘false’ branch...
libdrm-2.4.128/tests/nouveau/threaded.c:123:12: branch_false: ...to here
libdrm-2.4.128/tests/nouveau/threaded.c:123:12: branch_false: following ‘false’ branch (when ‘err >= 0’)...
libdrm-2.4.128/tests/nouveau/threaded.c:126:15: branch_false: ...to here
libdrm-2.4.128/tests/nouveau/threaded.c:126:15: danger: use of uninitialized value ‘nvdev2’ here
#  124|   		return 1;
#  125|   
#  126|-> 	err = nouveau_bo_new(nvdev2, NOUVEAU_BO_GART, 0, 4096, NULL, &bo);
#  127|   	if (!err)
#  128|   		err = nouveau_bo_set_prime(bo, &import_fd);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def107]
libdrm-2.4.128/tests/radeon/rbo.c:58:13: warning[-Wanalyzer-malloc-leak]: leak of ‘bo’
libdrm-2.4.128/tests/radeon/rbo.c:42:10: acquire_memory: allocated here
libdrm-2.4.128/tests/radeon/rbo.c:43:8: branch_false: following ‘false’ branch (when ‘bo’ is non-NULL)...
libdrm-2.4.128/tests/radeon/rbo.c:46:5: branch_false: ...to here
libdrm-2.4.128/tests/radeon/rbo.c:53:8: branch_true: following ‘true’ branch (when ‘handle != 0’)...
libdrm-2.4.128/tests/radeon/rbo.c:56:9: branch_true: ...to here
libdrm-2.4.128/tests/radeon/rbo.c:58:13: throw: if ‘drmIoctl’ throws an exception...
libdrm-2.4.128/tests/radeon/rbo.c:58:13: danger: ‘bo’ leaks here; was allocated at [(1)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/0)
#   56|           memset(&open_arg, 0, sizeof(open_arg));
#   57|           open_arg.name = handle;
#   58|->         r = drmIoctl(fd, DRM_IOCTL_GEM_OPEN, &open_arg);
#   59|           if (r != 0) {
#   60|               free(bo);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def108]
libdrm-2.4.128/tests/radeon/rbo.c:72:13: warning[-Wanalyzer-malloc-leak]: leak of ‘bo’
libdrm-2.4.128/tests/radeon/rbo.c:42:10: acquire_memory: allocated here
libdrm-2.4.128/tests/radeon/rbo.c:43:8: branch_false: following ‘false’ branch (when ‘bo’ is non-NULL)...
libdrm-2.4.128/tests/radeon/rbo.c:46:5: branch_false: ...to here
libdrm-2.4.128/tests/radeon/rbo.c:53:8: branch_false: following ‘false’ branch (when ‘handle == 0’)...
libdrm-2.4.128/tests/radeon/rbo.c:67:9: branch_false: ...to here
libdrm-2.4.128/tests/radeon/rbo.c:72:13: throw: if ‘drmCommandWriteRead’ throws an exception...
libdrm-2.4.128/tests/radeon/rbo.c:72:13: danger: ‘bo’ leaks here; was allocated at [(1)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/0)
#   70|           args.flags = 0;
#   71|           args.handle = 0;
#   72|->         r = drmCommandWriteRead(fd, DRM_RADEON_GEM_CREATE,
#   73|                                   &args, sizeof(args));
#   74|           bo->handle = args.handle;

Error: GCC_ANALYZER_WARNING (CWE-688): [#def109]
libdrm-2.4.128/tests/radeon/rbo.c:88:9: warning[-Wanalyzer-null-argument]: use of NULL where non-null expected
libdrm-2.4.128/tests/radeon/rbo.c:36:13: enter_function: entry to ‘rbo’
libdrm-2.4.128/tests/radeon/rbo.c:43:8: branch_false: following ‘false’ branch (when ‘bo’ is non-NULL)...
libdrm-2.4.128/tests/radeon/rbo.c:46:5: branch_false: ...to here
libdrm-2.4.128/tests/radeon/rbo.c:59:12: branch_false: following ‘false’ branch...
libdrm-2.4.128/tests/radeon/rbo.c:63:22: branch_false: ...to here
libdrm-2.4.128/tests/radeon/rbo.c:83:8: branch_true: following ‘true’ branch (when ‘ptr’ is non-NULL)...
libdrm-2.4.128/tests/radeon/rbo.c:84:13: branch_true: ...to here
libdrm-2.4.128/tests/radeon/rbo.c:84:13: call_function: calling ‘rbo_map’ from ‘rbo’
libdrm-2.4.128/tests/radeon/rbo.c:84:13: return_function: returning to ‘rbo’ from ‘rbo_map’
libdrm-2.4.128/tests/radeon/rbo.c:84:12: branch_false: following ‘false’ branch...
libdrm-2.4.128/tests/radeon/rbo.c:88:9: branch_false: ...to here
libdrm-2.4.128/tests/radeon/rbo.c:88:16: release_memory: using NULL here
libdrm-2.4.128/tests/radeon/rbo.c:88:9: danger: argument 1 (‘*bo.data’) NULL where non-null expected
#   86|               return rbo_decref(bo);
#   87|           }
#   88|->         memcpy(bo->data, ptr, size);
#   89|           rbo_unmap(bo);
#   90|       }

Error: GCC_ANALYZER_WARNING (CWE-401): [#def110]
libdrm-2.4.128/tests/radeon/rbo.c:108:9: warning[-Wanalyzer-malloc-leak]: leak of ‘bo’
libdrm-2.4.128/tests/radeon/rbo.c:36:13: enter_function: entry to ‘rbo’
libdrm-2.4.128/tests/radeon/rbo.c:42:10: acquire_memory: allocated here
libdrm-2.4.128/tests/radeon/rbo.c:43:8: branch_false: following ‘false’ branch (when ‘bo’ is non-NULL)...
libdrm-2.4.128/tests/radeon/rbo.c:46:5: branch_false: ...to here
libdrm-2.4.128/tests/radeon/rbo.c:59:12: branch_false: following ‘false’ branch...
libdrm-2.4.128/tests/radeon/rbo.c:63:22: branch_false: ...to here
libdrm-2.4.128/tests/radeon/rbo.c:83:8: branch_true: following ‘true’ branch (when ‘ptr’ is non-NULL)...
libdrm-2.4.128/tests/radeon/rbo.c:84:13: branch_true: ...to here
libdrm-2.4.128/tests/radeon/rbo.c:84:13: call_function: calling ‘rbo_map’ from ‘rbo’
#  106|       args.offset = 0;
#  107|       args.size = (uint64_t)bo->size;
#  108|->     r = drmCommandWriteRead(bo->fd, DRM_RADEON_GEM_MMAP,
#  109|                               &args, sizeof(args));
#  110|       if (r) {

Error: GCC_ANALYZER_WARNING (CWE-401): [#def111]
libdrm-2.4.128/tests/radeon/rbo.c:152:5: warning[-Wanalyzer-malloc-leak]: leak of ‘bo’
libdrm-2.4.128/tests/radeon/rbo.c:36:13: enter_function: entry to ‘rbo’
libdrm-2.4.128/tests/radeon/rbo.c:42:10: acquire_memory: allocated here
libdrm-2.4.128/tests/radeon/rbo.c:43:8: branch_false: following ‘false’ branch (when ‘bo’ is non-NULL)...
libdrm-2.4.128/tests/radeon/rbo.c:46:5: branch_false: ...to here
libdrm-2.4.128/tests/radeon/rbo.c:59:12: branch_false: following ‘false’ branch...
libdrm-2.4.128/tests/radeon/rbo.c:63:22: branch_false: ...to here
libdrm-2.4.128/tests/radeon/rbo.c:83:8: branch_true: following ‘true’ branch (when ‘ptr’ is non-NULL)...
libdrm-2.4.128/tests/radeon/rbo.c:84:13: branch_true: ...to here
libdrm-2.4.128/tests/radeon/rbo.c:84:13: call_function: calling ‘rbo_map’ from ‘rbo’
libdrm-2.4.128/tests/radeon/rbo.c:84:13: return_function: returning to ‘rbo’ from ‘rbo_map’
libdrm-2.4.128/tests/radeon/rbo.c:84:12: branch_true: following ‘true’ branch...
libdrm-2.4.128/tests/radeon/rbo.c:85:13: branch_true: ...to here
libdrm-2.4.128/tests/radeon/rbo.c:86:20: call_function: calling ‘rbo_decref’ from ‘rbo’
#  150|       memset(&args, 0, sizeof(args));
#  151|       args.handle = bo->handle;
#  152|->     drmIoctl(bo->fd, DRM_IOCTL_GEM_CLOSE, &args);
#  153|       memset(bo, 0, sizeof(struct rbo));
#  154|       free(bo);

Error: GCC_ANALYZER_WARNING (CWE-775): [#def112]
libdrm-2.4.128/tests/util/kms.c:133:37: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘open(*device_43->nodes, 524290)’
libdrm-2.4.128/tests/util/kms.c:106:12: branch_false: following ‘false’ branch...
libdrm-2.4.128/tests/util/kms.c:116:35: branch_false: ...to here
libdrm-2.4.128/tests/util/kms.c:117:20: branch_false: following ‘false’ branch...
libdrm-2.4.128/tests/util/kms.c:117:20: branch_false: ...to here
libdrm-2.4.128/tests/util/kms.c:122:29: branch_true: following ‘true’ branch...
libdrm-2.4.128/tests/util/kms.c:123:38: branch_true: ...to here
libdrm-2.4.128/tests/util/kms.c:129:30: acquire_resource: opened here
libdrm-2.4.128/tests/util/kms.c:131:28: branch_false: following ‘false’ branch...
libdrm-2.4.128/tests/util/kms.c:133:37: branch_false: ...to here
libdrm-2.4.128/tests/util/kms.c:133:37: throw: if ‘drmIsKMS’ throws an exception...
libdrm-2.4.128/tests/util/kms.c:133:37: danger: ‘open(*device_43->nodes, 524290)’ leaks here; was opened at [(7)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/6)
#  131|   			if (fd < 0) {
#  132|   				printf("failed\n");
#  133|-> 			} else if (!drmIsKMS(fd)) {
#  134|   				printf("is not a KMS device\n");
#  135|   				close(fd);

Error: CPPCHECK_WARNING (CWE-476): [#def113]
libdrm-2.4.128/tests/util/pattern.c:896: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: fsd
#  894|   	struct fsd *fsd = malloc(sizeof(*fsd) + n * sizeof(fsd->error[0]));
#  895|   
#  896|-> 	fsd->width = width;
#  897|   	fsd->x = 0;
#  898|   	fsd->i = 0;

Error: CPPCHECK_WARNING (CWE-476): [#def114]
libdrm-2.4.128/tests/util/pattern.c:897: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: fsd
#  895|   
#  896|   	fsd->width = width;
#  897|-> 	fsd->x = 0;
#  898|   	fsd->i = 0;
#  899|   	memset(fsd->error, 0, n * sizeof(fsd->error[0]));

Error: CPPCHECK_WARNING (CWE-476): [#def115]
libdrm-2.4.128/tests/util/pattern.c:898: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: fsd
#  896|   	fsd->width = width;
#  897|   	fsd->x = 0;
#  898|-> 	fsd->i = 0;
#  899|   	memset(fsd->error, 0, n * sizeof(fsd->error[0]));
#  900|   

Error: CPPCHECK_WARNING (CWE-476): [#def116]
libdrm-2.4.128/tests/util/pattern.c:899: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: fsd
#  897|   	fsd->x = 0;
#  898|   	fsd->i = 0;
#  899|-> 	memset(fsd->error, 0, n * sizeof(fsd->error[0]));
#  900|   
#  901|   	return fsd;

Error: COMPILER_WARNING (CWE-252): [#def117]
libdrm-2.4.128/xf86drm.c: scope_hint: In function ‘drmGetFormatModifierNameFromNvidia’
libdrm-2.4.128/xf86drm.c:351:9: warning[-Wunused-result]: ignoring return value of ‘asprintf’ declared with attribute ‘warn_unused_result’
#  351 |         asprintf(&mod_nvidia, "BLOCK_LINEAR_2D,HEIGHT=%"PRIu64",KIND=%"PRIu64","
#      |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#  352 |                  "GEN=%"PRIu64",SECTOR=%"PRIu64",COMPRESSION=%"PRIu64"", height,
#      |                  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#  353 |                  kind, gen, sector, compression);
#      |                  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#  349|       if ((modifier & 0x10) == 0x10) {
#  350|           char *mod_nvidia;
#  351|->         asprintf(&mod_nvidia, "BLOCK_LINEAR_2D,HEIGHT=%"PRIu64",KIND=%"PRIu64","
#  352|                    "GEN=%"PRIu64",SECTOR=%"PRIu64",COMPRESSION=%"PRIu64"", height,
#  353|                    kind, gen, sector, compression);

Error: COMPILER_WARNING (CWE-252): [#def118]
libdrm-2.4.128/xf86drm.c: scope_hint: In function ‘drmGetFormatModifierNameFromAmlogic’
libdrm-2.4.128/xf86drm.c:545:5: warning[-Wunused-result]: ignoring return value of ‘asprintf’ declared with attribute ‘warn_unused_result’
#  545 |     asprintf(&mod_amlogic, "FBC,LAYOUT=%s,OPTIONS=%s", layout_str, opts_str);
#      |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#  543|           opts_str = "0";
#  544|   
#  545|->     asprintf(&mod_amlogic, "FBC,LAYOUT=%s,OPTIONS=%s", layout_str, opts_str);
#  546|       return mod_amlogic;
#  547|   }

Error: COMPILER_WARNING (CWE-252): [#def119]
libdrm-2.4.128/xf86drm.c: scope_hint: In function ‘drmGetFormatModifierNameFromVivante’
libdrm-2.4.128/xf86drm.c:609:5: warning[-Wunused-result]: ignoring return value of ‘asprintf’ declared with attribute ‘warn_unused_result’
#  609 |     asprintf(&mod_vivante, "%s%s%s", color_tiling, tile_status, compression);
#      |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#  607|       }
#  608|   
#  609|->     asprintf(&mod_vivante, "%s%s%s", color_tiling, tile_status, compression);
#  610|       return mod_vivante;
#  611|   }

Error: COMPILER_WARNING: [#def120]
libdrm-2.4.128/xf86drm.c: scope_hint: In function ‘drmOpenDevice’
libdrm-2.4.128/xf86drm.c:846:21: warning[-Wunused-but-set-variable=]: variable ‘devmode’ set but not used
#  846 |     mode_t          devmode = DRM_DEV_MODE, serv_mode;
#      |                     ^~~~~~~
#  844|       char            buf[DRM_NODE_NAME_MAX];
#  845|       int             fd;
#  846|->     mode_t          devmode = DRM_DEV_MODE, serv_mode;
#  847|       gid_t           serv_group;
#  848|   #if !UDEV

Error: GCC_ANALYZER_WARNING (CWE-401): [#def121]
libdrm-2.4.128/xf86drm.c:4690:20: warning[-Wanalyzer-malloc-leak]: leak of ‘opendir("/dev/dri")’
libdrm-2.4.128/xf86drm.c:4605:16: enter_function: entry to ‘drmGetDeviceFromDevId’
libdrm-2.4.128/xf86drm.c:4669:8: branch_false: following ‘false’ branch (when ‘flags <= 1’)...
libdrm-2.4.128/xf86drm.c:4672:8: branch_false: ...to here
libdrm-2.4.128/xf86drm.c:4672:8: branch_false: following ‘false’ branch (when ‘device’ is non-NULL)...
libdrm-2.4.128/xf86drm.c:4675:11: call_function: inlined call to ‘gnu_dev_major’ from ‘drmGetDeviceFromDevId’
libdrm-2.4.128/xf86drm.c:4678:8: branch_true: following ‘true’ branch...
libdrm-2.4.128/xf86drm.c:4681:22: branch_true: ...to here
libdrm-2.4.128/xf86drm.c:4681:22: call_function: calling ‘drmParseSubsystemType’ from ‘drmGetDeviceFromDevId’
libdrm-2.4.128/xf86drm.c:4681:22: return_function: returning to ‘drmGetDeviceFromDevId’ from ‘drmParseSubsystemType’
libdrm-2.4.128/xf86drm.c:4682:8: branch_false: following ‘false’ branch...
libdrm-2.4.128/xf86drm.c:4685:14: branch_false: ...to here
libdrm-2.4.128/xf86drm.c:4685:14: acquire_memory: allocated here
libdrm-2.4.128/xf86drm.c:4686:8: branch_false: following ‘false’ branch...
libdrm-2.4.128/xf86drm.c:4686:8: branch_false: ...to here
libdrm-2.4.128/xf86drm.c:4690:20: throw: if ‘readdir’ throws an exception...
libdrm-2.4.128/xf86drm.c:4690:20: danger: ‘opendir("/dev/dri")’ leaks here; was allocated at [(18)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/17)
# 4688|   
# 4689|       i = 0;
# 4690|->     while ((dent = readdir(sysdir))) {
# 4691|           ret = process_device(&d, dent->d_name, subsystem_type, true, flags);
# 4692|           if (ret)

Error: GCC_ANALYZER_WARNING (CWE-401): [#def122]
libdrm-2.4.128/xf86drm.c:4820:20: warning[-Wanalyzer-malloc-leak]: leak of ‘opendir("/dev/dri")’
libdrm-2.4.128/xf86drm.c:4812:8: branch_false: following ‘false’ branch (when ‘flags <= 1’)...
libdrm-2.4.128/xf86drm.c:4815:14: branch_false: ...to here
libdrm-2.4.128/xf86drm.c:4815:14: acquire_memory: allocated here
libdrm-2.4.128/xf86drm.c:4816:8: branch_false: following ‘false’ branch...
libdrm-2.4.128/xf86drm.c:4816:8: branch_false: ...to here
libdrm-2.4.128/xf86drm.c:4820:20: throw: if ‘readdir’ throws an exception...
libdrm-2.4.128/xf86drm.c:4820:20: danger: ‘opendir("/dev/dri")’ leaks here; was allocated at [(3)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/2)
# 4818|   
# 4819|       i = 0;
# 4820|->     while ((dent = readdir(sysdir))) {
# 4821|           ret = process_device(&device, dent->d_name, -1, devices != NULL, flags);
# 4822|           if (ret)

Error: GCC_ANALYZER_WARNING (CWE-401): [#def123]
libdrm-2.4.128/xf86drmMode.c:918:24: warning[-Wanalyzer-malloc-leak]: leak of ‘opendir(&pci_dev_dir)’
libdrm-2.4.128/xf86drmMode.c:910:12: branch_false: following ‘false’ branch (when ‘ret == 4’)...
libdrm-2.4.128/xf86drmMode.c:913:9: branch_false: ...to here
libdrm-2.4.128/xf86drmMode.c:916:18: acquire_memory: allocated here
libdrm-2.4.128/xf86drmMode.c:917:12: branch_true: following ‘true’ branch...
libdrm-2.4.128/xf86drmMode.c:918:24: branch_true: ...to here
libdrm-2.4.128/xf86drmMode.c:918:24: throw: if ‘readdir’ throws an exception...
libdrm-2.4.128/xf86drmMode.c:918:24: danger: ‘opendir(&pci_dev_dir)’ leaks here; was allocated at [(3)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/2)
#  916|   	sysdir = opendir(pci_dev_dir);
#  917|   	if (sysdir) {
#  918|-> 		dent = readdir(sysdir);
#  919|   		while (dent) {
#  920|   			if (!strncmp(dent->d_name, "controlD", 8)) {

Error: GCC_ANALYZER_WARNING (CWE-401): [#def124]
libdrm-2.4.128/xf86drmMode.c:939:16: warning[-Wanalyzer-malloc-leak]: leak of ‘opendir(&pci_dev_dir)’
libdrm-2.4.128/xf86drmMode.c:910:12: branch_false: following ‘false’ branch (when ‘ret == 4’)...
libdrm-2.4.128/xf86drmMode.c:913:9: branch_false: ...to here
libdrm-2.4.128/xf86drmMode.c:935:18: acquire_memory: allocated here
libdrm-2.4.128/xf86drmMode.c:936:12: branch_false: following ‘false’ branch...
libdrm-2.4.128/xf86drmMode.c:939:16: branch_false: ...to here
libdrm-2.4.128/xf86drmMode.c:939:16: throw: if ‘readdir’ throws an exception...
libdrm-2.4.128/xf86drmMode.c:939:16: danger: ‘opendir(&pci_dev_dir)’ leaks here; was allocated at [(3)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/2)
#  937|   		return -EINVAL;
#  938|   
#  939|-> 	dent = readdir(sysdir);
#  940|   	while (dent) {
#  941|   		if (!strncmp(dent->d_name, "drm:controlD", 12)) {

Error: GCC_ANALYZER_WARNING (CWE-688): [#def125]
libdrm-2.4.128/xf86drmMode.c:1543:9: warning[-Wanalyzer-null-argument]: use of NULL where non-null expected
libdrm-2.4.128/xf86drmMode.c:1516:16: enter_function: entry to ‘drmModeAtomicCommit’
libdrm-2.4.128/xf86drmMode.c:1530:12: branch_false: following ‘false’ branch (when ‘req’ is non-NULL)...
libdrm-2.4.128/xf86drmMode.c:1533:13: branch_false: ...to here
libdrm-2.4.128/xf86drmMode.c:1533:12: branch_false: following ‘false’ branch...
libdrm-2.4.128/xf86drmMode.c:1536:18: branch_false: ...to here
libdrm-2.4.128/xf86drmMode.c:1536:18: call_function: calling ‘drmModeAtomicDuplicate’ from ‘drmModeAtomicCommit’
libdrm-2.4.128/xf86drmMode.c:1536:18: return_function: returning to ‘drmModeAtomicCommit’ from ‘drmModeAtomicDuplicate’
libdrm-2.4.128/xf86drmMode.c:1537:12: branch_false: following ‘false’ branch...
libdrm-2.4.128/xf86drmMode.c:1540:9: branch_false: ...to here
libdrm-2.4.128/xf86drmMode.c:1543:15: release_memory: using NULL here
libdrm-2.4.128/xf86drmMode.c:1543:9: danger: argument 1 (‘*<unknown>.items’) NULL where non-null expected
# 1541|   
# 1542|   	/* Sort the list by object ID, then by property ID. */
# 1543|-> 	qsort(sorted->items, sorted->cursor, sizeof(*sorted->items),
# 1544|   	      sort_req_list);
# 1545|   

Scan Properties

analyzer-version-clippy1.92.0
analyzer-version-cppcheck2.19.1
analyzer-version-gcc16.0.0
analyzer-version-gcc-analyzer16.0.0
analyzer-version-shellcheck0.11.0
analyzer-version-unicontrol0.0.2
enabled-pluginsclippy, cppcheck, gcc, shellcheck, unicontrol
exit-code0
hostip-172-16-1-147.us-west-2.compute.internal
known-false-positives/usr/share/csmock/known-false-positives.js
known-false-positives-rpmknown-false-positives-0.0.0.20250521.132812.g8eff701.main-1.el9.noarch
mock-configfedora-rawhide-x86_64
project-namelibdrm-2.4.128-3.fc44
store-results-to/tmp/tmpuu2gqz0y/libdrm-2.4.128-3.fc44.tar.xz
time-created2026-01-08 18:41:06
time-finished2026-01-08 18:42:55
toolcsmock
tool-args'/usr/bin/csmock' '-r' 'fedora-rawhide-x86_64' '-t' 'gcc,cppcheck,clippy,shellcheck,unicontrol' '-o' '/tmp/tmpuu2gqz0y/libdrm-2.4.128-3.fc44.tar.xz' '--gcc-analyze' '--unicontrol-notests' '--unicontrol-bidi-only' '--install' 'pam' '--gcc-analyzer-bin=/usr/bin/gcc' '/tmp/tmpuu2gqz0y/libdrm-2.4.128-3.fc44.src.rpm'
tool-versioncsmock-3.8.3.20251215.161544.g62de9a5-1.el9