wayland-1.24.0-2.fc44

List of Findings

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1]
wayland-1.24.0/cursor/wayland-cursor.c:61:20: warning[-Wanalyzer-malloc-leak]: leak of ‘pool’
wayland-1.24.0/cursor/wayland-cursor.c:392:1: enter_function: entry to ‘wl_cursor_theme_load’
wayland-1.24.0/cursor/wayland-cursor.c:397:12: branch_false: following ‘false’ branch (when ‘theme’ is non-NULL)...
wayland-1.24.0/cursor/wayland-cursor.c:400:12: branch_false: ...to here
wayland-1.24.0/cursor/wayland-cursor.c:400:12: branch_false: following ‘false’ branch (when ‘size >= 0’)...
wayland-1.24.0/cursor/wayland-cursor.c:400:13: branch_false: ...to here
wayland-1.24.0/cursor/wayland-cursor.c:410:23: call_function: calling ‘shm_pool_create’ from ‘wl_cursor_theme_load’
#   59|   		return NULL;
#   60|   
#   61|-> 	pool->fd = os_create_anonymous_file(size);
#   62|   	if (pool->fd < 0)
#   63|   		goto err_free;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def2]
wayland-1.24.0/cursor/wayland-cursor.c:61:20: warning[-Wanalyzer-malloc-leak]: leak of ‘theme’
wayland-1.24.0/cursor/wayland-cursor.c:392:1: enter_function: entry to ‘wl_cursor_theme_load’
wayland-1.24.0/cursor/wayland-cursor.c:396:17: acquire_memory: allocated here
wayland-1.24.0/cursor/wayland-cursor.c:397:12: branch_false: following ‘false’ branch (when ‘theme’ is non-NULL)...
wayland-1.24.0/cursor/wayland-cursor.c:400:12: branch_false: ...to here
wayland-1.24.0/cursor/wayland-cursor.c:400:12: branch_false: following ‘false’ branch (when ‘size >= 0’)...
wayland-1.24.0/cursor/wayland-cursor.c:400:13: branch_false: ...to here
wayland-1.24.0/cursor/wayland-cursor.c:410:23: call_function: calling ‘shm_pool_create’ from ‘wl_cursor_theme_load’
#   59|   		return NULL;
#   60|   
#   61|-> 	pool->fd = os_create_anonymous_file(size);
#   62|   	if (pool->fd < 0)
#   63|   		goto err_free;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def3]
wayland-1.24.0/cursor/wayland-cursor.c:83:9: warning[-Wanalyzer-malloc-leak]: leak of ‘pool’
wayland-1.24.0/cursor/wayland-cursor.c:392:1: enter_function: entry to ‘wl_cursor_theme_load’
wayland-1.24.0/cursor/wayland-cursor.c:397:12: branch_false: following ‘false’ branch (when ‘theme’ is non-NULL)...
wayland-1.24.0/cursor/wayland-cursor.c:400:12: branch_false: ...to here
wayland-1.24.0/cursor/wayland-cursor.c:400:12: branch_false: following ‘false’ branch (when ‘size >= 0’)...
wayland-1.24.0/cursor/wayland-cursor.c:400:13: branch_false: ...to here
wayland-1.24.0/cursor/wayland-cursor.c:410:23: call_function: calling ‘shm_pool_create’ from ‘wl_cursor_theme_load’
#   81|   	munmap(pool->data, size);
#   82|   err_close:
#   83|-> 	close(pool->fd);
#   84|   err_free:
#   85|   	free(pool);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def4]
wayland-1.24.0/cursor/wayland-cursor.c:83:9: warning[-Wanalyzer-malloc-leak]: leak of ‘theme’
wayland-1.24.0/cursor/wayland-cursor.c:392:1: enter_function: entry to ‘wl_cursor_theme_load’
wayland-1.24.0/cursor/wayland-cursor.c:396:17: acquire_memory: allocated here
wayland-1.24.0/cursor/wayland-cursor.c:397:12: branch_false: following ‘false’ branch (when ‘theme’ is non-NULL)...
wayland-1.24.0/cursor/wayland-cursor.c:400:12: branch_false: ...to here
wayland-1.24.0/cursor/wayland-cursor.c:400:12: branch_false: following ‘false’ branch (when ‘size >= 0’)...
wayland-1.24.0/cursor/wayland-cursor.c:400:13: branch_false: ...to here
wayland-1.24.0/cursor/wayland-cursor.c:410:23: call_function: calling ‘shm_pool_create’ from ‘wl_cursor_theme_load’
#   81|   	munmap(pool->data, size);
#   82|   err_close:
#   83|-> 	close(pool->fd);
#   84|   err_free:
#   85|   	free(pool);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def5]
wayland-1.24.0/cursor/wayland-cursor.c:92:13: warning[-Wanalyzer-malloc-leak]: leak of ‘cursor’
wayland-1.24.0/cursor/wayland-cursor.c:283:1: enter_function: entry to ‘wl_cursor_create_from_xcursor_images’
wayland-1.24.0/cursor/wayland-cursor.c:291:18: acquire_memory: allocated here
wayland-1.24.0/cursor/wayland-cursor.c:292:12: branch_false: following ‘false’ branch (when ‘cursor’ is non-NULL)...
wayland-1.24.0/cursor/wayland-cursor.c:296:24: branch_false: ...to here
wayland-1.24.0/cursor/wayland-cursor.c:297:12: branch_false: following ‘false’ branch...
wayland-1.24.0/cursor/wayland-cursor.c:302:38: branch_false: ...to here
wayland-1.24.0/cursor/wayland-cursor.c:305:21: branch_true: following ‘true’ branch...
wayland-1.24.0/cursor/wayland-cursor.c:306:25: branch_true: ...to here
wayland-1.24.0/cursor/wayland-cursor.c:307:20: branch_false: following ‘false’ branch (when ‘image’ is non-NULL)...
wayland-1.24.0/cursor/wayland-cursor.c:310:17: branch_false: ...to here
wayland-1.24.0/cursor/wayland-cursor.c:320:20: branch_false: following ‘false’ branch (when ‘size <= 2147483647’)...
wayland-1.24.0/cursor/wayland-cursor.c:325:33: branch_false: ...to here
wayland-1.24.0/cursor/wayland-cursor.c:325:33: call_function: calling ‘shm_pool_allocate’ from ‘wl_cursor_create_from_xcursor_images’
#   90|   shm_pool_resize(struct shm_pool *pool, int size)
#   91|   {
#   92|-> 	if (os_resize_anonymous_file(pool->fd, size) < 0)
#   93|   		return 0;
#   94|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def6]
wayland-1.24.0/cursor/wayland-cursor.c:92:13: warning[-Wanalyzer-malloc-leak]: leak of ‘image’
wayland-1.24.0/cursor/wayland-cursor.c:283:1: enter_function: entry to ‘wl_cursor_create_from_xcursor_images’
wayland-1.24.0/cursor/wayland-cursor.c:292:12: branch_false: following ‘false’ branch (when ‘cursor’ is non-NULL)...
wayland-1.24.0/cursor/wayland-cursor.c:296:24: branch_false: ...to here
wayland-1.24.0/cursor/wayland-cursor.c:297:12: branch_false: following ‘false’ branch...
wayland-1.24.0/cursor/wayland-cursor.c:302:38: branch_false: ...to here
wayland-1.24.0/cursor/wayland-cursor.c:305:21: branch_true: following ‘true’ branch...
wayland-1.24.0/cursor/wayland-cursor.c:306:25: branch_true: ...to here
wayland-1.24.0/cursor/wayland-cursor.c:306:25: acquire_memory: allocated here
wayland-1.24.0/cursor/wayland-cursor.c:307:20: branch_false: following ‘false’ branch (when ‘image’ is non-NULL)...
wayland-1.24.0/cursor/wayland-cursor.c:310:17: branch_false: ...to here
wayland-1.24.0/cursor/wayland-cursor.c:320:20: branch_false: following ‘false’ branch (when ‘size <= 2147483647’)...
wayland-1.24.0/cursor/wayland-cursor.c:325:33: branch_false: ...to here
wayland-1.24.0/cursor/wayland-cursor.c:325:33: call_function: calling ‘shm_pool_allocate’ from ‘wl_cursor_create_from_xcursor_images’
#   90|   shm_pool_resize(struct shm_pool *pool, int size)
#   91|   {
#   92|-> 	if (os_resize_anonymous_file(pool->fd, size) < 0)
#   93|   		return 0;
#   94|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def7]
wayland-1.24.0/cursor/wayland-cursor.c:220:38: warning[-Wanalyzer-malloc-leak]: leak of ‘malloc(8)’
wayland-1.24.0/cursor/wayland-cursor.c:204:1: enter_function: entry to ‘wl_cursor_create_from_data’
wayland-1.24.0/cursor/wayland-cursor.c:212:12: branch_false: following ‘false’ branch (when ‘cursor’ is non-NULL)...
wayland-1.24.0/cursor/wayland-cursor.c:215:9: branch_false: ...to here
wayland-1.24.0/cursor/wayland-cursor.c:216:33: acquire_memory: allocated here
wayland-1.24.0/cursor/wayland-cursor.c:217:12: branch_false: following ‘false’ branch...
wayland-1.24.0/cursor/wayland-cursor.c:220:38: branch_false: ...to here
wayland-1.24.0/cursor/wayland-cursor.c:224:12: branch_false: following ‘false’ branch (when ‘image’ is non-NULL)...
wayland-1.24.0/cursor/wayland-cursor.c:227:9: branch_false: ...to here
wayland-1.24.0/cursor/wayland-cursor.c:237:25: call_function: calling ‘shm_pool_allocate’ from ‘wl_cursor_create_from_data’
#  218|   		goto err_free_cursor;
#  219|   
#  220|-> 	cursor->cursor.name = strdup(metadata->name);
#  221|   	cursor->total_delay = 0;
#  222|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def8]
wayland-1.24.0/cursor/wayland-cursor.c:230:30: warning[-Wanalyzer-malloc-leak]: leak of ‘strdup(*metadata.name)’
wayland-1.24.0/cursor/wayland-cursor.c:204:1: enter_function: entry to ‘wl_cursor_create_from_data’
wayland-1.24.0/cursor/wayland-cursor.c:212:12: branch_false: following ‘false’ branch (when ‘cursor’ is non-NULL)...
wayland-1.24.0/cursor/wayland-cursor.c:215:9: branch_false: ...to here
wayland-1.24.0/cursor/wayland-cursor.c:217:12: branch_false: following ‘false’ branch...
wayland-1.24.0/cursor/wayland-cursor.c:220:38: branch_false: ...to here
wayland-1.24.0/cursor/wayland-cursor.c:220:31: acquire_memory: allocated here
wayland-1.24.0/cursor/wayland-cursor.c:224:12: branch_false: following ‘false’ branch (when ‘image’ is non-NULL)...
wayland-1.24.0/cursor/wayland-cursor.c:227:9: branch_false: ...to here
wayland-1.24.0/cursor/wayland-cursor.c:237:25: call_function: calling ‘shm_pool_allocate’ from ‘wl_cursor_create_from_data’
#  228|   	image->theme = theme;
#  229|   	image->buffer = NULL;
#  230|-> 	image->image.width = metadata->width;
#  231|   	image->image.height = metadata->height;
#  232|   	image->image.hotspot_x = metadata->hotspot_x;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def9]
wayland-1.24.0/cursor/wayland-cursor.c:245:16: warning[-Wanalyzer-malloc-leak]: leak of ‘cursor’
wayland-1.24.0/cursor/wayland-cursor.c:260:1: enter_function: entry to ‘load_fallback_theme’
wayland-1.24.0/cursor/wayland-cursor.c:267:12: branch_false: following ‘false’ branch...
wayland-1.24.0/cursor/wayland-cursor.c:267:12: branch_false: ...to here
wayland-1.24.0/cursor/wayland-cursor.c:272:21: branch_true: following ‘true’ branch...
wayland-1.24.0/cursor/wayland-cursor.c:274:25: branch_true: ...to here
wayland-1.24.0/cursor/wayland-cursor.c:274:25: call_function: calling ‘wl_cursor_create_from_data’ from ‘load_fallback_theme’
#  243|   	       cursor_data + metadata->offset, size);
#  244|   
#  245|-> 	return &cursor->cursor;
#  246|   
#  247|   err_free_image:

Error: GCC_ANALYZER_WARNING (CWE-401): [#def10]
wayland-1.24.0/cursor/wayland-cursor.c:302:38: warning[-Wanalyzer-malloc-leak]: leak of ‘malloc((long unsigned int)*images.nimage * 8)’
wayland-1.24.0/cursor/wayland-cursor.c:283:1: enter_function: entry to ‘wl_cursor_create_from_xcursor_images’
wayland-1.24.0/cursor/wayland-cursor.c:292:12: branch_false: following ‘false’ branch (when ‘cursor’ is non-NULL)...
wayland-1.24.0/cursor/wayland-cursor.c:296:24: branch_false: ...to here
wayland-1.24.0/cursor/wayland-cursor.c:296:17: acquire_memory: allocated here
wayland-1.24.0/cursor/wayland-cursor.c:297:12: branch_false: following ‘false’ branch...
wayland-1.24.0/cursor/wayland-cursor.c:302:38: branch_false: ...to here
wayland-1.24.0/cursor/wayland-cursor.c:305:21: branch_true: following ‘true’ branch...
wayland-1.24.0/cursor/wayland-cursor.c:306:25: branch_true: ...to here
wayland-1.24.0/cursor/wayland-cursor.c:307:20: branch_false: following ‘false’ branch (when ‘image’ is non-NULL)...
wayland-1.24.0/cursor/wayland-cursor.c:310:17: branch_false: ...to here
wayland-1.24.0/cursor/wayland-cursor.c:320:20: branch_false: following ‘false’ branch (when ‘size <= 2147483647’)...
wayland-1.24.0/cursor/wayland-cursor.c:325:33: branch_false: ...to here
wayland-1.24.0/cursor/wayland-cursor.c:325:33: call_function: calling ‘shm_pool_allocate’ from ‘wl_cursor_create_from_xcursor_images’
#  300|   	}
#  301|   
#  302|-> 	cursor->cursor.name = strdup(images->name);
#  303|   	cursor->total_delay = 0;
#  304|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def11]
wayland-1.24.0/cursor/wayland-cursor.c:305:25: warning[-Wanalyzer-malloc-leak]: leak of ‘strdup(*images.name)’
wayland-1.24.0/cursor/wayland-cursor.c:283:1: enter_function: entry to ‘wl_cursor_create_from_xcursor_images’
wayland-1.24.0/cursor/wayland-cursor.c:292:12: branch_false: following ‘false’ branch (when ‘cursor’ is non-NULL)...
wayland-1.24.0/cursor/wayland-cursor.c:296:24: branch_false: ...to here
wayland-1.24.0/cursor/wayland-cursor.c:297:12: branch_false: following ‘false’ branch...
wayland-1.24.0/cursor/wayland-cursor.c:302:38: branch_false: ...to here
wayland-1.24.0/cursor/wayland-cursor.c:302:31: acquire_memory: allocated here
wayland-1.24.0/cursor/wayland-cursor.c:305:21: branch_true: following ‘true’ branch...
wayland-1.24.0/cursor/wayland-cursor.c:306:25: branch_true: ...to here
wayland-1.24.0/cursor/wayland-cursor.c:307:20: branch_false: following ‘false’ branch (when ‘image’ is non-NULL)...
wayland-1.24.0/cursor/wayland-cursor.c:310:17: branch_false: ...to here
wayland-1.24.0/cursor/wayland-cursor.c:320:20: branch_false: following ‘false’ branch (when ‘size <= 2147483647’)...
wayland-1.24.0/cursor/wayland-cursor.c:325:33: branch_false: ...to here
wayland-1.24.0/cursor/wayland-cursor.c:325:33: call_function: calling ‘shm_pool_allocate’ from ‘wl_cursor_create_from_xcursor_images’
#  303|   	cursor->total_delay = 0;
#  304|   
#  305|-> 	for (i = 0; i < images->nimage; i++) {
#  306|   		image = malloc(sizeof *image);
#  307|   		if (image == NULL)

Error: GCC_ANALYZER_WARNING (CWE-401): [#def12]
wayland-1.24.0/cursor/wayland-cursor.c:346:16: warning[-Wanalyzer-malloc-leak]: leak of ‘cursor’
wayland-1.24.0/cursor/wayland-cursor.c:291:18: acquire_memory: allocated here
wayland-1.24.0/cursor/wayland-cursor.c:292:12: branch_false: following ‘false’ branch (when ‘cursor’ is non-NULL)...
wayland-1.24.0/cursor/wayland-cursor.c:296:24: branch_false: ...to here
wayland-1.24.0/cursor/wayland-cursor.c:297:12: branch_false: following ‘false’ branch...
wayland-1.24.0/cursor/wayland-cursor.c:302:38: branch_false: ...to here
wayland-1.24.0/cursor/wayland-cursor.c:305:21: branch_true: following ‘true’ branch...
wayland-1.24.0/cursor/wayland-cursor.c:306:25: branch_true: ...to here
wayland-1.24.0/cursor/wayland-cursor.c:307:20: branch_false: following ‘false’ branch (when ‘image’ is non-NULL)...
wayland-1.24.0/cursor/wayland-cursor.c:310:17: branch_false: ...to here
wayland-1.24.0/cursor/wayland-cursor.c:320:20: branch_false: following ‘false’ branch (when ‘size <= 2147483647’)...
wayland-1.24.0/cursor/wayland-cursor.c:325:33: branch_false: ...to here
wayland-1.24.0/cursor/wayland-cursor.c:326:20: branch_false: following ‘false’ branch...
wayland-1.24.0/cursor/wayland-cursor.c:333:24: branch_false: ...to here
wayland-1.24.0/cursor/wayland-cursor.c:339:12: branch_false: following ‘false’ branch (when ‘i != 0’)...
wayland-1.24.0/cursor/wayland-cursor.c:346:16: branch_false: ...to here
wayland-1.24.0/cursor/wayland-cursor.c:346:16: danger: ‘cursor’ leaks here; was allocated at [(1)](sarif:/runs/0/results/33/codeFlows/0/threadFlows/0/locations/0)
#  344|   	}
#  345|   
#  346|-> 	return &cursor->cursor;
#  347|   }
#  348|   

Error: CPPCHECK_WARNING (CWE-401): [#def13]
wayland-1.24.0/cursor/wayland-cursor.c:401: error[memleak]: Memory leak: theme
#  399|   
#  400|   	if (size < 0 || (size > 0 && INT_MAX / size / 4 < size))
#  401|-> 		return NULL;
#  402|   
#  403|   	if (!name)

Error: GCC_ANALYZER_WARNING (CWE-401): [#def14]
wayland-1.24.0/cursor/wayland-cursor.c:414:9: warning[-Wanalyzer-malloc-leak]: leak of ‘<unknown>’
wayland-1.24.0/cursor/wayland-cursor.c:392:1: enter_function: entry to ‘wl_cursor_theme_load’
wayland-1.24.0/cursor/wayland-cursor.c:397:12: branch_false: following ‘false’ branch (when ‘theme’ is non-NULL)...
wayland-1.24.0/cursor/wayland-cursor.c:400:12: branch_false: ...to here
wayland-1.24.0/cursor/wayland-cursor.c:400:12: branch_false: following ‘false’ branch (when ‘size >= 0’)...
wayland-1.24.0/cursor/wayland-cursor.c:400:13: branch_false: ...to here
wayland-1.24.0/cursor/wayland-cursor.c:410:23: call_function: calling ‘shm_pool_create’ from ‘wl_cursor_theme_load’
wayland-1.24.0/cursor/wayland-cursor.c:410:23: return_function: returning to ‘wl_cursor_theme_load’ from ‘shm_pool_create’
wayland-1.24.0/cursor/wayland-cursor.c:411:12: branch_false: following ‘false’ branch...
wayland-1.24.0/cursor/wayland-cursor.c:414:9: branch_false: ...to here
wayland-1.24.0/cursor/wayland-cursor.c:414:9: throw: if ‘xcursor_load_theme’ throws an exception...
wayland-1.24.0/cursor/wayland-cursor.c:414:9: danger: ‘<unknown>’ leaks here; was allocated at [(8)](sarif:/runs/0/results/35/codeFlows/0/threadFlows/0/locations/7)
#  412|   		goto out_error_pool;
#  413|   
#  414|-> 	xcursor_load_theme(name, size, load_callback, theme);
#  415|   
#  416|   	if (theme->cursor_count == 0)

Error: GCC_ANALYZER_WARNING (CWE-401): [#def15]
wayland-1.24.0/cursor/wayland-cursor.c:414:9: warning[-Wanalyzer-malloc-leak]: leak of ‘theme’
wayland-1.24.0/cursor/wayland-cursor.c:392:1: enter_function: entry to ‘wl_cursor_theme_load’
wayland-1.24.0/cursor/wayland-cursor.c:396:17: acquire_memory: allocated here
wayland-1.24.0/cursor/wayland-cursor.c:397:12: branch_false: following ‘false’ branch (when ‘theme’ is non-NULL)...
wayland-1.24.0/cursor/wayland-cursor.c:400:12: branch_false: ...to here
wayland-1.24.0/cursor/wayland-cursor.c:400:12: branch_false: following ‘false’ branch (when ‘size >= 0’)...
wayland-1.24.0/cursor/wayland-cursor.c:400:13: branch_false: ...to here
wayland-1.24.0/cursor/wayland-cursor.c:410:23: call_function: calling ‘shm_pool_create’ from ‘wl_cursor_theme_load’
wayland-1.24.0/cursor/wayland-cursor.c:410:23: return_function: returning to ‘wl_cursor_theme_load’ from ‘shm_pool_create’
wayland-1.24.0/cursor/wayland-cursor.c:411:12: branch_false: following ‘false’ branch...
wayland-1.24.0/cursor/wayland-cursor.c:414:9: branch_false: ...to here
wayland-1.24.0/cursor/wayland-cursor.c:414:9: throw: if ‘xcursor_load_theme’ throws an exception...
wayland-1.24.0/cursor/wayland-cursor.c:414:9: danger: ‘theme’ leaks here; was allocated at [(2)](sarif:/runs/0/results/34/codeFlows/0/threadFlows/0/locations/1)
#  412|   		goto out_error_pool;
#  413|   
#  414|-> 	xcursor_load_theme(name, size, load_callback, theme);
#  415|   
#  416|   	if (theme->cursor_count == 0)

Error: GCC_ANALYZER_WARNING (CWE-401): [#def16]
wayland-1.24.0/cursor/wayland-cursor.c:427:1: warning[-Wanalyzer-malloc-leak]: leak of ‘theme’
wayland-1.24.0/cursor/wayland-cursor.c:396:17: acquire_memory: allocated here
wayland-1.24.0/cursor/wayland-cursor.c:397:12: branch_false: following ‘false’ branch (when ‘theme’ is non-NULL)...
wayland-1.24.0/cursor/wayland-cursor.c:400:12: branch_false: ...to here
wayland-1.24.0/cursor/wayland-cursor.c:427:1: danger: ‘theme’ leaks here; was allocated at [(1)](sarif:/runs/0/results/36/codeFlows/0/threadFlows/0/locations/0)
#  425|   	free(theme);
#  426|   	return NULL;
#  427|-> }
#  428|   
#  429|   /** Destroys a cursor theme object

Error: COMPILER_WARNING (CWE-704): [#def17]
wayland-1.24.0/cursor/xcursor.c: scope_hint: In function ‘xcursor_next_path’
wayland-1.24.0/cursor/xcursor.c:610:23: warning[-Wdiscarded-qualifiers]: initialization discards ‘const’ qualifier from pointer target type
#  610 |         char *colon = strchr(path, ':');
#      |                       ^~~~~~
#  608|   xcursor_next_path(const char *path)
#  609|   {
#  610|-> 	char *colon = strchr(path, ':');
#  611|   
#  612|   	if (!colon)

Error: COMPILER_WARNING (CWE-704): [#def18]
wayland-1.24.0/cursor/xcursor.c:610:23: warning[-Wdiscarded-qualifiers]: initialization discards ‘const’ qualifier from pointer target type
#  608|   xcursor_next_path(const char *path)
#  609|   {
#  610|-> 	char *colon = strchr(path, ':');
#  611|   
#  612|   	if (!colon)

Error: GCC_ANALYZER_WARNING (CWE-401): [#def19]
wayland-1.24.0/cursor/xcursor.c:703:20: warning[-Wanalyzer-malloc-leak]: leak of ‘opendir(path)’
wayland-1.24.0/cursor/xcursor.c:827:1: enter_function: entry to ‘xcursor_load_theme’
wayland-1.24.0/cursor/xcursor.c:831:9: call_function: calling ‘xcursor_load_theme_protected’ from ‘xcursor_load_theme’
#  701|   		return;
#  702|   
#  703|-> 	for (ent = readdir(dir); ent; ent = readdir(dir)) {
#  704|   #ifdef _DIRENT_HAVE_D_TYPE
#  705|   		if (ent->d_type != DT_UNKNOWN &&

Error: GCC_ANALYZER_WARNING (CWE-401): [#def20]
wayland-1.24.0/redhat-linux-build/src/wayland-client-protocol.h:1129:20: warning[-Wanalyzer-malloc-leak]: leak of ‘c’
wayland-1.24.0/tests/test-compositor.c:510:16: enter_function: entry to ‘client_connect’
wayland-1.24.0/tests/test-compositor.c:513:28: acquire_memory: allocated here
wayland-1.24.0/tests/test-compositor.c:514:9: branch_false: following ‘false’ branch (when ‘c’ is non-NULL)...
wayland-1.24.0/tests/test-compositor.c:516:25: branch_false: ...to here
wayland-1.24.0/tests/test-compositor.c:517:9: branch_false: following ‘false’ branch...
wayland-1.24.0/tests/test-compositor.c:521:15: branch_false: ...to here
wayland-1.24.0/tests/test-compositor.c:521:15: call_function: calling ‘wl_display_get_registry’ from ‘client_connect’
# 1127|   	struct wl_proxy *registry;
# 1128|   
# 1129|-> 	registry = wl_proxy_marshal_flags((struct wl_proxy *) wl_display,
# 1130|   			 WL_DISPLAY_GET_REGISTRY, &wl_registry_interface, wl_proxy_get_version((struct wl_proxy *) wl_display), 0, NULL);
# 1131|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def21]
wayland-1.24.0/redhat-linux-build/src/wayland-client-protocol.h:1184:16: warning[-Wanalyzer-malloc-leak]: leak of ‘c’
wayland-1.24.0/tests/test-compositor.c:510:16: enter_function: entry to ‘client_connect’
wayland-1.24.0/tests/test-compositor.c:513:28: acquire_memory: allocated here
wayland-1.24.0/tests/test-compositor.c:514:9: branch_false: following ‘false’ branch (when ‘c’ is non-NULL)...
wayland-1.24.0/tests/test-compositor.c:516:25: branch_false: ...to here
wayland-1.24.0/tests/test-compositor.c:517:9: branch_false: following ‘false’ branch...
wayland-1.24.0/tests/test-compositor.c:521:15: branch_false: ...to here
wayland-1.24.0/tests/test-compositor.c:522:9: branch_false: following ‘false’ branch...
wayland-1.24.0/tests/test-compositor.c:523:9: call_function: inlined call to ‘wl_registry_add_listener’ from ‘client_connect’
# 1182|   			 const struct wl_registry_listener *listener, void *data)
# 1183|   {
# 1184|-> 	return wl_proxy_add_listener((struct wl_proxy *) wl_registry,
# 1185|   				     (void (**)(void)) listener, data);
# 1186|   }

Error: GCC_ANALYZER_WARNING (CWE-401): [#def22]
wayland-1.24.0/redhat-linux-build/src/wayland-client-protocol.h:1477:9: warning[-Wanalyzer-malloc-leak]: leak of ‘cursor’
wayland-1.24.0/cursor/wayland-cursor.c:283:1: enter_function: entry to ‘wl_cursor_create_from_xcursor_images’
wayland-1.24.0/cursor/wayland-cursor.c:291:18: acquire_memory: allocated here
wayland-1.24.0/cursor/wayland-cursor.c:292:12: branch_false: following ‘false’ branch (when ‘cursor’ is non-NULL)...
wayland-1.24.0/cursor/wayland-cursor.c:296:24: branch_false: ...to here
wayland-1.24.0/cursor/wayland-cursor.c:297:12: branch_false: following ‘false’ branch...
wayland-1.24.0/cursor/wayland-cursor.c:302:38: branch_false: ...to here
wayland-1.24.0/cursor/wayland-cursor.c:305:21: branch_true: following ‘true’ branch...
wayland-1.24.0/cursor/wayland-cursor.c:306:25: branch_true: ...to here
wayland-1.24.0/cursor/wayland-cursor.c:307:20: branch_false: following ‘false’ branch (when ‘image’ is non-NULL)...
wayland-1.24.0/cursor/wayland-cursor.c:310:17: branch_false: ...to here
wayland-1.24.0/cursor/wayland-cursor.c:320:20: branch_false: following ‘false’ branch (when ‘size <= 2147483647’)...
wayland-1.24.0/cursor/wayland-cursor.c:325:33: branch_false: ...to here
wayland-1.24.0/cursor/wayland-cursor.c:325:33: call_function: calling ‘shm_pool_allocate’ from ‘wl_cursor_create_from_xcursor_images’
# 1475|   wl_shm_pool_resize(struct wl_shm_pool *wl_shm_pool, int32_t size)
# 1476|   {
# 1477|-> 	wl_proxy_marshal_flags((struct wl_proxy *) wl_shm_pool,
# 1478|   			 WL_SHM_POOL_RESIZE, NULL, wl_proxy_get_version((struct wl_proxy *) wl_shm_pool), 0, size);
# 1479|   }

Error: GCC_ANALYZER_WARNING (CWE-401): [#def23]
wayland-1.24.0/redhat-linux-build/src/wayland-client-protocol.h:1477:9: warning[-Wanalyzer-malloc-leak]: leak of ‘image’
wayland-1.24.0/cursor/wayland-cursor.c:283:1: enter_function: entry to ‘wl_cursor_create_from_xcursor_images’
wayland-1.24.0/cursor/wayland-cursor.c:292:12: branch_false: following ‘false’ branch (when ‘cursor’ is non-NULL)...
wayland-1.24.0/cursor/wayland-cursor.c:296:24: branch_false: ...to here
wayland-1.24.0/cursor/wayland-cursor.c:297:12: branch_false: following ‘false’ branch...
wayland-1.24.0/cursor/wayland-cursor.c:302:38: branch_false: ...to here
wayland-1.24.0/cursor/wayland-cursor.c:305:21: branch_true: following ‘true’ branch...
wayland-1.24.0/cursor/wayland-cursor.c:306:25: branch_true: ...to here
wayland-1.24.0/cursor/wayland-cursor.c:306:25: acquire_memory: allocated here
wayland-1.24.0/cursor/wayland-cursor.c:307:20: branch_false: following ‘false’ branch (when ‘image’ is non-NULL)...
wayland-1.24.0/cursor/wayland-cursor.c:310:17: branch_false: ...to here
wayland-1.24.0/cursor/wayland-cursor.c:320:20: branch_false: following ‘false’ branch (when ‘size <= 2147483647’)...
wayland-1.24.0/cursor/wayland-cursor.c:325:33: branch_false: ...to here
wayland-1.24.0/cursor/wayland-cursor.c:325:33: call_function: calling ‘shm_pool_allocate’ from ‘wl_cursor_create_from_xcursor_images’
# 1475|   wl_shm_pool_resize(struct wl_shm_pool *wl_shm_pool, int32_t size)
# 1476|   {
# 1477|-> 	wl_proxy_marshal_flags((struct wl_proxy *) wl_shm_pool,
# 1478|   			 WL_SHM_POOL_RESIZE, NULL, wl_proxy_get_version((struct wl_proxy *) wl_shm_pool), 0, size);
# 1479|   }

Error: GCC_ANALYZER_WARNING (CWE-401): [#def24]
wayland-1.24.0/redhat-linux-build/src/wayland-client-protocol.h:2070:14: warning[-Wanalyzer-malloc-leak]: leak of ‘pool’
wayland-1.24.0/cursor/wayland-cursor.c:392:1: enter_function: entry to ‘wl_cursor_theme_load’
wayland-1.24.0/cursor/wayland-cursor.c:397:12: branch_false: following ‘false’ branch (when ‘theme’ is non-NULL)...
wayland-1.24.0/cursor/wayland-cursor.c:400:12: branch_false: ...to here
wayland-1.24.0/cursor/wayland-cursor.c:400:12: branch_false: following ‘false’ branch (when ‘size >= 0’)...
wayland-1.24.0/cursor/wayland-cursor.c:400:13: branch_false: ...to here
wayland-1.24.0/cursor/wayland-cursor.c:410:23: call_function: calling ‘shm_pool_create’ from ‘wl_cursor_theme_load’
# 2068|   	struct wl_proxy *id;
# 2069|   
# 2070|-> 	id = wl_proxy_marshal_flags((struct wl_proxy *) wl_shm,
# 2071|   			 WL_SHM_CREATE_POOL, &wl_shm_pool_interface, wl_proxy_get_version((struct wl_proxy *) wl_shm), 0, NULL, fd, size);
# 2072|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def25]
wayland-1.24.0/redhat-linux-build/src/wayland-client-protocol.h:2070:14: warning[-Wanalyzer-malloc-leak]: leak of ‘theme’
wayland-1.24.0/cursor/wayland-cursor.c:392:1: enter_function: entry to ‘wl_cursor_theme_load’
wayland-1.24.0/cursor/wayland-cursor.c:396:17: acquire_memory: allocated here
wayland-1.24.0/cursor/wayland-cursor.c:397:12: branch_false: following ‘false’ branch (when ‘theme’ is non-NULL)...
wayland-1.24.0/cursor/wayland-cursor.c:400:12: branch_false: ...to here
wayland-1.24.0/cursor/wayland-cursor.c:400:12: branch_false: following ‘false’ branch (when ‘size >= 0’)...
wayland-1.24.0/cursor/wayland-cursor.c:400:13: branch_false: ...to here
wayland-1.24.0/cursor/wayland-cursor.c:410:23: call_function: calling ‘shm_pool_create’ from ‘wl_cursor_theme_load’
# 2068|   	struct wl_proxy *id;
# 2069|   
# 2070|-> 	id = wl_proxy_marshal_flags((struct wl_proxy *) wl_shm,
# 2071|   			 WL_SHM_CREATE_POOL, &wl_shm_pool_interface, wl_proxy_get_version((struct wl_proxy *) wl_shm), 0, NULL, fd, size);
# 2072|   

Error: GCC_ANALYZER_WARNING (CWE-775): [#def26]
wayland-1.24.0/redhat-linux-build/tests/tests-server-protocol.h:130:9: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘pipes1[1]’
wayland-1.24.0/tests/display-test.c:1248:1: enter_function: entry to ‘fd_passer_clobber’
wayland-1.24.0/tests/display-test.c:1253:12: branch_true: following ‘true’ branch...
wayland-1.24.0/tests/display-test.c:1254:23: branch_true: ...to here
wayland-1.24.0/tests/display-test.c:1255:17: branch_false: following ‘false’ branch (when ‘ret == 0’)...
wayland-1.24.0/tests/display-test.c:1256:23: branch_false: ...to here
wayland-1.24.0/tests/display-test.c:1257:17: branch_false: following ‘false’ branch (when ‘ret == 0’)...
wayland-1.24.0/tests/display-test.c:1259:17: branch_false: ...to here
wayland-1.24.0/tests/display-test.c:1260:17: call_function: inlined call to ‘fd_passer_send_fd’ from ‘fd_passer_clobber’
#  128|   fd_passer_send_fd(struct wl_resource *resource_, int32_t fd)
#  129|   {
#  130|-> 	wl_resource_post_event(resource_, FD_PASSER_FD, fd);
#  131|   }
#  132|   

Error: GCC_ANALYZER_WARNING (CWE-775): [#def27]
wayland-1.24.0/redhat-linux-build/tests/tests-server-protocol.h:130:9: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘pipes2[0]’
wayland-1.24.0/tests/display-test.c:1248:1: enter_function: entry to ‘fd_passer_clobber’
wayland-1.24.0/tests/display-test.c:1253:12: branch_true: following ‘true’ branch...
wayland-1.24.0/tests/display-test.c:1254:23: branch_true: ...to here
wayland-1.24.0/tests/display-test.c:1255:17: branch_false: following ‘false’ branch (when ‘ret == 0’)...
wayland-1.24.0/tests/display-test.c:1256:23: branch_false: ...to here
wayland-1.24.0/tests/display-test.c:1257:17: branch_false: following ‘false’ branch (when ‘ret == 0’)...
wayland-1.24.0/tests/display-test.c:1259:17: branch_false: ...to here
wayland-1.24.0/tests/display-test.c:1260:17: call_function: inlined call to ‘fd_passer_send_fd’ from ‘fd_passer_clobber’
#  128|   fd_passer_send_fd(struct wl_resource *resource_, int32_t fd)
#  129|   {
#  130|-> 	wl_resource_post_event(resource_, FD_PASSER_FD, fd);
#  131|   }
#  132|   

Error: GCC_ANALYZER_WARNING (CWE-775): [#def28]
wayland-1.24.0/redhat-linux-build/tests/tests-server-protocol.h:130:9: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘pipes2[1]’
wayland-1.24.0/tests/display-test.c:1248:1: enter_function: entry to ‘fd_passer_clobber’
wayland-1.24.0/tests/display-test.c:1253:12: branch_true: following ‘true’ branch...
wayland-1.24.0/tests/display-test.c:1254:23: branch_true: ...to here
wayland-1.24.0/tests/display-test.c:1255:17: branch_false: following ‘false’ branch (when ‘ret == 0’)...
wayland-1.24.0/tests/display-test.c:1256:23: branch_false: ...to here
wayland-1.24.0/tests/display-test.c:1257:17: branch_false: following ‘false’ branch (when ‘ret == 0’)...
wayland-1.24.0/tests/display-test.c:1259:17: branch_false: ...to here
wayland-1.24.0/tests/display-test.c:1260:17: call_function: inlined call to ‘fd_passer_send_fd’ from ‘fd_passer_clobber’
#  128|   fd_passer_send_fd(struct wl_resource *resource_, int32_t fd)
#  129|   {
#  130|-> 	wl_resource_post_event(resource_, FD_PASSER_FD, fd);
#  131|   }
#  132|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def29]
wayland-1.24.0/src/connection.c:78:17: warning[-Wanalyzer-malloc-leak]: leak of ‘new_data’
wayland-1.24.0/src/connection.c:1257:1: enter_function: entry to ‘copy_fds_to_connection’
wayland-1.24.0/src/connection.c:1267:21: branch_true: following ‘true’ branch (when ‘i < count’)...
wayland-1.24.0/src/connection.c:1268:29: branch_true: ...to here
wayland-1.24.0/src/connection.c:1273:21: call_function: calling ‘wl_connection_put_fd’ from ‘copy_fds_to_connection’
#   76|   {
#   77|   	if (!(size_bits < 8 * sizeof(size_t)))
#   78|-> 		wl_abort("Too many bits for size_t\n");
#   79|   
#   80|   	return ((size_t)1) << size_bits;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def30]
wayland-1.24.0/src/connection.c:756:41: warning[-Wanalyzer-malloc-leak]: leak of ‘wl_closure_init(message,  size, & num_arrays, 0)’
wayland-1.24.0/src/connection.c:889:1: enter_function: entry to ‘wl_connection_demarshal’
wayland-1.24.0/src/connection.c:904:12: branch_false: following ‘false’ branch (when ‘size > 7’)...
wayland-1.24.0/src/connection.c:911:19: branch_false: ...to here
wayland-1.24.0/src/connection.c:911:19: call_function: calling ‘wl_closure_init’ from ‘wl_connection_demarshal’
wayland-1.24.0/src/connection.c:911:19: return_function: returning to ‘wl_connection_demarshal’ from ‘wl_closure_init’
wayland-1.24.0/src/connection.c:912:12: branch_false: following ‘false’ branch...
wayland-1.24.0/src/connection.c:917:9: branch_false: ...to here
wayland-1.24.0/src/connection.c:923:9: call_function: inlined call to ‘wl_connection_copy’ from ‘wl_connection_demarshal’
#  754|   	int count;
#  755|   
#  756|-> 	count = arg_count_for_signature(message->signature);
#  757|   	if (count > WL_CLOSURE_MAX_ARGS) {
#  758|   		wl_log("too many args (%d) for %s (signature %s)\n", count,

Error: GCC_ANALYZER_WARNING (CWE-401): [#def31]
wayland-1.24.0/src/connection.c:1568:40: warning[-Wanalyzer-malloc-leak]: leak of ‘f’
wayland-1.24.0/src/connection.c:1509:13: acquire_memory: allocated here
wayland-1.24.0/src/connection.c:1510:12: branch_false: following ‘false’ branch (when ‘f’ is non-NULL)...
wayland-1.24.0/src/connection.c:1513:9: branch_false: ...to here
wayland-1.24.0/src/connection.c:1527:21: branch_true: following ‘true’ branch...
wayland-1.24.0/src/connection.c:1528:29: branch_true: ...to here
wayland-1.24.0/src/connection.c:1529:20: branch_false: following ‘false’ branch (when ‘i == 0’)...
wayland-1.24.0/src/connection.c:1532:25: branch_false: ...to here
wayland-1.24.0/src/connection.c:1567:28: branch_true: following ‘true’ branch (when ‘n_parse’ is non-NULL)...
wayland-1.24.0/src/connection.c:1568:40: branch_true: ...to here
wayland-1.24.0/src/connection.c:1568:40: throw: if the called function throws an exception...
wayland-1.24.0/src/connection.c:1568:40: danger: ‘f’ leaks here; was allocated at [(1)](sarif:/runs/0/results/5/codeFlows/0/threadFlows/0/locations/0)
# 1566|   		case WL_ARG_NEW_ID:
# 1567|   			if (n_parse)
# 1568|-> 				nval = n_parse(&closure->args[i]);
# 1569|   			else
# 1570|   				nval = closure->args[i].n;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def32]
wayland-1.24.0/src/event-loop.c:188:27: warning[-Wanalyzer-malloc-leak]: leak of ‘calloc(1, 64)’
wayland-1.24.0/src/event-loop.c:176:1: enter_function: entry to ‘wl_event_loop_add_fd’
wayland-1.24.0/src/event-loop.c:183:18: call_function: inlined call to ‘zalloc’ from ‘wl_event_loop_add_fd’
wayland-1.24.0/src/event-loop.c:184:12: branch_false: following ‘false’ branch...
wayland-1.24.0/src/event-loop.c:187:9: branch_false: ...to here
wayland-1.24.0/src/event-loop.c:188:27: throw: if ‘wl_os_dupfd_cloexec’ throws an exception...
wayland-1.24.0/src/event-loop.c:188:27: danger: ‘calloc(1, 64)’ leaks here; was allocated at [(3)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/2)
#  186|   
#  187|   	source->base.interface = &fd_source_interface;
#  188|-> 	source->base.fd = wl_os_dupfd_cloexec(fd, 0);
#  189|   	source->func = func;
#  190|   	source->fd = fd;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def33]
wayland-1.24.0/src/event-loop.c:192:16: warning[-Wanalyzer-malloc-leak]: leak of ‘calloc(1, 64)’
wayland-1.24.0/src/event-loop.c:176:1: enter_function: entry to ‘wl_event_loop_add_fd’
wayland-1.24.0/src/event-loop.c:183:18: call_function: inlined call to ‘zalloc’ from ‘wl_event_loop_add_fd’
wayland-1.24.0/src/event-loop.c:184:12: branch_false: following ‘false’ branch...
wayland-1.24.0/src/event-loop.c:187:9: branch_false: ...to here
wayland-1.24.0/src/event-loop.c:192:16: danger: ‘calloc(1, 64)’ leaks here; was allocated at [(3)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/2)
#  190|   	source->fd = fd;
#  191|   
#  192|-> 	return add_source(loop, &source->base, mask, data);
#  193|   }
#  194|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def34]
wayland-1.24.0/src/event-loop.c:371:1: warning[-Wanalyzer-malloc-leak]: leak of ‘*loop.timers.data’
wayland-1.24.0/src/event-loop.c:832:1: enter_function: entry to ‘wl_event_source_remove’
wayland-1.24.0/src/event-loop.c:844:12: branch_true: following ‘true’ branch...
wayland-1.24.0/src/event-loop.c:845:13: branch_true: ...to here
wayland-1.24.0/src/event-loop.c:844:13: branch_true: following ‘true’ branch...
wayland-1.24.0/src/event-loop.c:848:17: branch_true: ...to here
wayland-1.24.0/src/event-loop.c:848:17: call_function: calling ‘wl_event_source_timer_update’ from ‘wl_event_source_remove’
wayland-1.24.0/src/event-loop.c:848:17: return_function: returning to ‘wl_event_source_remove’ from ‘wl_event_source_timer_update’
wayland-1.24.0/src/event-loop.c:849:17: call_function: calling ‘wl_timer_heap_unreserve’ from ‘wl_event_source_remove’
#  369|   		timers->space = timers->space / 2;
#  370|   	}
#  371|-> }
#  372|   
#  373|   static int

Error: GCC_ANALYZER_WARNING (CWE-401): [#def35]
wayland-1.24.0/src/event-loop.c:583:9: warning[-Wanalyzer-malloc-leak]: leak of ‘calloc(1, 88)’
wayland-1.24.0/src/event-loop.c:565:1: enter_function: entry to ‘wl_event_loop_add_timer’
wayland-1.24.0/src/event-loop.c:571:12: branch_false: following ‘false’ branch...
wayland-1.24.0/src/event-loop.c:574:18: call_function: inlined call to ‘zalloc’ from ‘wl_event_loop_add_timer’
wayland-1.24.0/src/event-loop.c:575:12: branch_false: following ‘false’ branch...
wayland-1.24.0/src/event-loop.c:578:9: branch_false: ...to here
wayland-1.24.0/src/event-loop.c:583:9: throw: if ‘wl_list_init’ throws an exception...
wayland-1.24.0/src/event-loop.c:583:9: danger: ‘calloc(1, 88)’ leaks here; was allocated at [(5)](sarif:/runs/0/results/3/codeFlows/0/threadFlows/0/locations/4)
#  581|   	source->base.loop = loop;
#  582|   	source->base.data = data;
#  583|-> 	wl_list_init(&source->base.link);
#  584|   	source->next_due = NULL;
#  585|   	source->deadline.tv_sec = 0;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def36]
wayland-1.24.0/src/event-loop.c:738:16: warning[-Wanalyzer-malloc-leak]: leak of ‘calloc(1, 64)’
wayland-1.24.0/src/event-loop.c:716:1: enter_function: entry to ‘wl_event_loop_add_signal’
wayland-1.24.0/src/event-loop.c:724:18: call_function: inlined call to ‘zalloc’ from ‘wl_event_loop_add_signal’
wayland-1.24.0/src/event-loop.c:725:12: branch_false: following ‘false’ branch...
wayland-1.24.0/src/event-loop.c:728:9: branch_false: ...to here
wayland-1.24.0/src/event-loop.c:738:16: danger: ‘calloc(1, 64)’ leaks here; was allocated at [(3)](sarif:/runs/0/results/4/codeFlows/0/threadFlows/0/locations/2)
#  736|   	source->func = func;
#  737|   
#  738|-> 	return add_source(loop, &source->base, WL_EVENT_READABLE, data);
#  739|   }
#  740|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def37]
wayland-1.24.0/src/event-loop.c:792:9: warning[-Wanalyzer-malloc-leak]: leak of ‘calloc(1, 56)’
wayland-1.24.0/src/event-loop.c:775:1: enter_function: entry to ‘wl_event_loop_add_idle’
wayland-1.24.0/src/event-loop.c:781:18: call_function: inlined call to ‘zalloc’ from ‘wl_event_loop_add_idle’
wayland-1.24.0/src/event-loop.c:782:12: branch_false: following ‘false’ branch...
wayland-1.24.0/src/event-loop.c:785:9: branch_false: ...to here
wayland-1.24.0/src/event-loop.c:792:9: throw: if ‘wl_list_insert’ throws an exception...
wayland-1.24.0/src/event-loop.c:792:9: danger: ‘calloc(1, 56)’ leaks here; was allocated at [(3)](sarif:/runs/0/results/5/codeFlows/0/threadFlows/0/locations/2)
#  790|   	source->base.data = data;
#  791|   
#  792|-> 	wl_list_insert(loop->idle_list.prev, &source->base.link);
#  793|   
#  794|   	return &source->base;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def38]
wayland-1.24.0/src/event-loop.c:895:26: warning[-Wanalyzer-malloc-leak]: leak of ‘calloc(1, 160)’
wayland-1.24.0/src/event-loop.c:887:1: enter_function: entry to ‘wl_event_loop_create’
wayland-1.24.0/src/event-loop.c:891:16: call_function: inlined call to ‘zalloc’ from ‘wl_event_loop_create’
wayland-1.24.0/src/event-loop.c:892:12: branch_false: following ‘false’ branch...
wayland-1.24.0/src/event-loop.c:895:26: branch_false: ...to here
wayland-1.24.0/src/event-loop.c:895:26: throw: if ‘wl_os_epoll_create_cloexec’ throws an exception...
wayland-1.24.0/src/event-loop.c:895:26: danger: ‘calloc(1, 160)’ leaks here; was allocated at [(3)](sarif:/runs/0/results/6/codeFlows/0/threadFlows/0/locations/2)
#  893|   		return NULL;
#  894|   
#  895|-> 	loop->epoll_fd = wl_os_epoll_create_cloexec();
#  896|   	if (loop->epoll_fd < 0) {
#  897|   		free(loop);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def39]
wayland-1.24.0/src/event-loop.c:900:9: warning[-Wanalyzer-malloc-leak]: leak of ‘calloc(1, 160)’
wayland-1.24.0/src/event-loop.c:887:1: enter_function: entry to ‘wl_event_loop_create’
wayland-1.24.0/src/event-loop.c:891:16: call_function: inlined call to ‘zalloc’ from ‘wl_event_loop_create’
wayland-1.24.0/src/event-loop.c:892:12: branch_false: following ‘false’ branch...
wayland-1.24.0/src/event-loop.c:895:26: branch_false: ...to here
wayland-1.24.0/src/event-loop.c:896:12: branch_false: following ‘false’ branch...
wayland-1.24.0/src/event-loop.c:900:9: branch_false: ...to here
wayland-1.24.0/src/event-loop.c:900:9: throw: if ‘wl_list_init’ throws an exception...
wayland-1.24.0/src/event-loop.c:900:9: danger: ‘calloc(1, 160)’ leaks here; was allocated at [(3)](sarif:/runs/0/results/7/codeFlows/0/threadFlows/0/locations/2)
#  898|   		return NULL;
#  899|   	}
#  900|-> 	wl_list_init(&loop->check_list);
#  901|   	wl_list_init(&loop->idle_list);
#  902|   	wl_list_init(&loop->destroy_list);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def40]
wayland-1.24.0/src/scanner.c:1037:17: warning[-Wanalyzer-malloc-leak]: leak of ‘*((struct parse_context)*(void *)data).description.text’
wayland-1.24.0/src/scanner.c:1036:19: branch_true: following ‘true’ branch (when the strings are equal)...
wayland-1.24.0/src/scanner.c:1039:33: branch_true: ...to here
wayland-1.24.0/src/scanner.c:1038:25: acquire_memory: allocated here
wayland-1.24.0/src/scanner.c:1037:17: danger: ‘*((struct parse_context)*(void *)data).description.text’ leaks here; was allocated at [(3)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/2)
# 1035|   				ctx->character_data_length);
# 1036|   	} else if (strcmp(name, "description") == 0) {
# 1037|-> 		ctx->description->text =
# 1038|   			strndup(ctx->character_data,
# 1039|   				ctx->character_data_length);

Error: GCC_ANALYZER_WARNING (CWE-775): [#def41]
wayland-1.24.0/src/scanner.c:2124:21: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(input_filename, "r")’
wayland-1.24.0/src/scanner.c:2093:12: branch_false: following ‘false’ branch (when ‘help == 0’)...
wayland-1.24.0/src/scanner.c:2095:17: branch_false: ...to here
wayland-1.24.0/src/scanner.c:2095:17: branch_false: following ‘false’ branch (when ‘version == 0’)...
wayland-1.24.0/src/scanner.c:2097:19: branch_false: ...to here
wayland-1.24.0/src/scanner.c:2097:17: branch_false: following ‘false’ branch...
wayland-1.24.0/src/scanner.c:2099:17: branch_false: following ‘false’ branch (when the strings are non-equal)...
wayland-1.24.0/src/scanner.c:2101:18: branch_false: ...to here
wayland-1.24.0/src/scanner.c:2116:12: branch_true: following ‘true’ branch (when ‘argc == 3’)...
wayland-1.24.0/src/scanner.c:2117:17: branch_true: ...to here
wayland-1.24.0/src/scanner.c:2118:25: acquire_resource: opened here
wayland-1.24.0/src/scanner.c:2119:20: branch_false: following ‘false’ branch...
wayland-1.24.0/src/scanner.c:2124:21: branch_false: ...to here
wayland-1.24.0/src/scanner.c:2124:21: throw: if ‘freopen’ throws an exception...
wayland-1.24.0/src/scanner.c:2124:21: danger: ‘fopen(input_filename, "r")’ leaks here; was opened at [(11)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/10)
# 2122|   			exit(EXIT_FAILURE);
# 2123|   		}
# 2124|-> 		if (freopen(argv[2], "w", stdout) == NULL) {
# 2125|   			fprintf(stderr, "Could not open output file: %s\n",
# 2126|   				strerror(errno));

Error: GCC_ANALYZER_WARNING (CWE-401): [#def42]
wayland-1.24.0/src/scanner.c:2124:21: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(input_filename, "r")’
wayland-1.24.0/src/scanner.c:2093:12: branch_false: following ‘false’ branch (when ‘help == 0’)...
wayland-1.24.0/src/scanner.c:2095:17: branch_false: ...to here
wayland-1.24.0/src/scanner.c:2095:17: branch_false: following ‘false’ branch (when ‘version == 0’)...
wayland-1.24.0/src/scanner.c:2097:19: branch_false: ...to here
wayland-1.24.0/src/scanner.c:2097:17: branch_false: following ‘false’ branch...
wayland-1.24.0/src/scanner.c:2099:17: branch_false: following ‘false’ branch (when the strings are non-equal)...
wayland-1.24.0/src/scanner.c:2101:18: branch_false: ...to here
wayland-1.24.0/src/scanner.c:2116:12: branch_true: following ‘true’ branch (when ‘argc == 3’)...
wayland-1.24.0/src/scanner.c:2117:17: branch_true: ...to here
wayland-1.24.0/src/scanner.c:2118:25: acquire_memory: allocated here
wayland-1.24.0/src/scanner.c:2119:20: branch_false: following ‘false’ branch...
wayland-1.24.0/src/scanner.c:2124:21: branch_false: ...to here
wayland-1.24.0/src/scanner.c:2124:21: throw: if ‘freopen’ throws an exception...
wayland-1.24.0/src/scanner.c:2124:21: danger: ‘fopen(input_filename, "r")’ leaks here; was allocated at [(11)](sarif:/runs/0/results/2/codeFlows/0/threadFlows/0/locations/10)
# 2122|   			exit(EXIT_FAILURE);
# 2123|   		}
# 2124|-> 		if (freopen(argv[2], "w", stdout) == NULL) {
# 2125|   			fprintf(stderr, "Could not open output file: %s\n",
# 2126|   				strerror(errno));

Error: GCC_ANALYZER_WARNING (CWE-775): [#def43]
wayland-1.24.0/src/scanner.c:2134:9: warning[-Wanalyzer-file-leak]: leak of FILE ‘input’
wayland-1.24.0/src/scanner.c:2093:12: branch_false: following ‘false’ branch (when ‘help == 0’)...
wayland-1.24.0/src/scanner.c:2095:17: branch_false: ...to here
wayland-1.24.0/src/scanner.c:2095:17: branch_false: following ‘false’ branch (when ‘version == 0’)...
wayland-1.24.0/src/scanner.c:2097:19: branch_false: ...to here
wayland-1.24.0/src/scanner.c:2097:17: branch_false: following ‘false’ branch...
wayland-1.24.0/src/scanner.c:2099:17: branch_false: following ‘false’ branch (when the strings are non-equal)...
wayland-1.24.0/src/scanner.c:2101:18: branch_false: ...to here
wayland-1.24.0/src/scanner.c:2116:12: branch_true: following ‘true’ branch (when ‘argc == 3’)...
wayland-1.24.0/src/scanner.c:2117:17: branch_true: ...to here
wayland-1.24.0/src/scanner.c:2118:25: acquire_resource: opened here
wayland-1.24.0/src/scanner.c:2119:20: branch_false: following ‘false’ branch...
wayland-1.24.0/src/scanner.c:2124:21: branch_false: ...to here
wayland-1.24.0/src/scanner.c:2124:20: branch_false: following ‘false’ branch...
wayland-1.24.0/src/scanner.c:2133:9: branch_false: ...to here
wayland-1.24.0/src/scanner.c:2134:9: throw: if ‘wl_list_init’ throws an exception...
wayland-1.24.0/src/scanner.c:2134:9: danger: ‘input’ leaks here; was opened at [(11)](sarif:/runs/0/results/3/codeFlows/0/threadFlows/0/locations/10)
# 2132|   	/* initialize protocol structure */
# 2133|   	memset(&protocol, 0, sizeof protocol);
# 2134|-> 	wl_list_init(&protocol.interface_list);
# 2135|   	protocol.core_headers = core_headers;
# 2136|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def44]
wayland-1.24.0/src/scanner.c:2134:9: warning[-Wanalyzer-malloc-leak]: leak of ‘input’
wayland-1.24.0/src/scanner.c:2093:12: branch_false: following ‘false’ branch (when ‘help == 0’)...
wayland-1.24.0/src/scanner.c:2095:17: branch_false: ...to here
wayland-1.24.0/src/scanner.c:2095:17: branch_false: following ‘false’ branch (when ‘version == 0’)...
wayland-1.24.0/src/scanner.c:2097:19: branch_false: ...to here
wayland-1.24.0/src/scanner.c:2097:17: branch_false: following ‘false’ branch...
wayland-1.24.0/src/scanner.c:2099:17: branch_false: following ‘false’ branch (when the strings are non-equal)...
wayland-1.24.0/src/scanner.c:2101:18: branch_false: ...to here
wayland-1.24.0/src/scanner.c:2116:12: branch_true: following ‘true’ branch (when ‘argc == 3’)...
wayland-1.24.0/src/scanner.c:2117:17: branch_true: ...to here
wayland-1.24.0/src/scanner.c:2118:25: acquire_memory: allocated here
wayland-1.24.0/src/scanner.c:2119:20: branch_false: following ‘false’ branch...
wayland-1.24.0/src/scanner.c:2124:21: branch_false: ...to here
wayland-1.24.0/src/scanner.c:2124:20: branch_false: following ‘false’ branch...
wayland-1.24.0/src/scanner.c:2133:9: branch_false: ...to here
wayland-1.24.0/src/scanner.c:2134:9: throw: if ‘wl_list_init’ throws an exception...
wayland-1.24.0/src/scanner.c:2134:9: danger: ‘input’ leaks here; was allocated at [(11)](sarif:/runs/0/results/4/codeFlows/0/threadFlows/0/locations/10)
# 2132|   	/* initialize protocol structure */
# 2133|   	memset(&protocol, 0, sizeof protocol);
# 2134|-> 	wl_list_init(&protocol.interface_list);
# 2135|   	protocol.core_headers = core_headers;
# 2136|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def45]
wayland-1.24.0/src/wayland-client.c:553:24: warning[-Wanalyzer-malloc-leak]: leak of ‘calloc(1, 96)’
wayland-1.24.0/src/wayland-client.c:2158:1: enter_function: entry to ‘wl_display_dispatch_queue’
wayland-1.24.0/src/wayland-client.c:2163:15: call_function: calling ‘wl_display_dispatch_queue_timeout’ from ‘wl_display_dispatch_queue’
#  551|   	proxy->object.id = id;
#  552|   	proxy->display = display;
#  553|-> 	proxy->queue = factory->queue;
#  554|   	proxy->refcount = 1;
#  555|   	proxy->version = factory->version;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def46]
wayland-1.24.0/src/wayland-client.c:2701:29: warning[-Wanalyzer-malloc-leak]: leak of ‘calloc(1, 96)’
wayland-1.24.0/src/wayland-client.c:2692:1: enter_function: entry to ‘wl_proxy_create_wrapper’
wayland-1.24.0/src/wayland-client.c:2697:19: call_function: inlined call to ‘zalloc’ from ‘wl_proxy_create_wrapper’
wayland-1.24.0/src/wayland-client.c:2698:12: branch_false: following ‘false’ branch...
wayland-1.24.0/src/wayland-client.c:2701:29: branch_false: ...to here
wayland-1.24.0/src/wayland-client.c:2711:9: throw: if ‘wl_list_insert’ throws an exception...
wayland-1.24.0/src/wayland-client.c:2701:29: danger: ‘calloc(1, 96)’ leaks here; was allocated at [(3)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/2)
# 2699|   		return NULL;
# 2700|   
# 2701|-> 	pthread_mutex_lock(&wrapped_proxy->display->mutex);
# 2702|   
# 2703|   	wrapper->object.interface = wrapped_proxy->object.interface;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def47]
wayland-1.24.0/src/wayland-server-core.h:463:9: warning[-Wanalyzer-malloc-leak]: leak of ‘calloc(1, 128)’
wayland-1.24.0/src/wayland-server.c:2033:1: enter_function: entry to ‘wl_resource_create’
wayland-1.24.0/src/wayland-server.c:2039:20: call_function: inlined call to ‘zalloc’ from ‘wl_resource_create’
wayland-1.24.0/src/wayland-server.c:2040:12: branch_false: following ‘false’ branch...
wayland-1.24.0/src/wayland-server.c:2043:12: branch_false: ...to here
wayland-1.24.0/src/wayland-server.c:2055:9: call_function: inlined call to ‘wl_signal_init’ from ‘wl_resource_create’
#  461|   wl_signal_init(struct wl_signal *signal)
#  462|   {
#  463|-> 	wl_list_init(&signal->listener_list);
#  464|   }
#  465|   

Error: GCC_ANALYZER_WARNING (CWE-404): [#def48]
wayland-1.24.0/src/wayland-server.c:260:9: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
wayland-1.24.0/src/wayland-server.c:1089:1: enter_function: entry to ‘display_sync’
wayland-1.24.0/src/wayland-server.c:1097:17: call_function: inlined call to ‘wl_client_post_no_memory’ from ‘display_sync’
#  258|   
#  259|   	va_start(ap, opcode);
#  260|-> 	wl_argument_from_va_list(object->interface->events[opcode].signature,
#  261|   				 args, WL_CLOSURE_MAX_ARGS, ap);
#  262|   	va_end(ap);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def49]
wayland-1.24.0/src/wayland-server.c:1203:25: warning[-Wanalyzer-malloc-leak]: leak of ‘calloc(1, 232)’
wayland-1.24.0/src/wayland-server.c:1190:1: enter_function: entry to ‘wl_display_create’
wayland-1.24.0/src/wayland-server.c:1199:19: call_function: inlined call to ‘zalloc’ from ‘wl_display_create’
wayland-1.24.0/src/wayland-server.c:1200:12: branch_false: following ‘false’ branch...
wayland-1.24.0/src/wayland-server.c:1203:25: branch_false: ...to here
wayland-1.24.0/src/wayland-server.c:1203:25: throw: if ‘wl_event_loop_create’ throws an exception...
wayland-1.24.0/src/wayland-server.c:1203:25: danger: ‘calloc(1, 232)’ leaks here; was allocated at [(3)](sarif:/runs/0/results/2/codeFlows/0/threadFlows/0/locations/2)
# 1201|   		return NULL;
# 1202|   
# 1203|-> 	display->loop = wl_event_loop_create();
# 1204|   	if (display->loop == NULL) {
# 1205|   		free(display);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def50]
wayland-1.24.0/src/wayland-server.c:1213:32: warning[-Wanalyzer-malloc-leak]: leak of ‘calloc(1, 232)’
wayland-1.24.0/src/wayland-server.c:1190:1: enter_function: entry to ‘wl_display_create’
wayland-1.24.0/src/wayland-server.c:1199:19: call_function: inlined call to ‘zalloc’ from ‘wl_display_create’
wayland-1.24.0/src/wayland-server.c:1200:12: branch_false: following ‘false’ branch...
wayland-1.24.0/src/wayland-server.c:1203:25: branch_false: ...to here
wayland-1.24.0/src/wayland-server.c:1204:12: branch_false: following ‘false’ branch...
wayland-1.24.0/src/wayland-server.c:1209:34: branch_false: ...to here
wayland-1.24.0/src/wayland-server.c:1210:12: branch_false: following ‘false’ branch...
wayland-1.24.0/src/wayland-server.c:1213:32: branch_false: ...to here
wayland-1.24.0/src/wayland-server.c:1213:32: throw: if ‘wl_event_loop_add_fd’ throws an exception...
wayland-1.24.0/src/wayland-server.c:1213:32: danger: ‘calloc(1, 232)’ leaks here; was allocated at [(3)](sarif:/runs/0/results/3/codeFlows/0/threadFlows/0/locations/2)
# 1211|   		goto err_eventfd;
# 1212|   
# 1213|-> 	display->term_source = wl_event_loop_add_fd(display->loop,
# 1214|   						    display->terminate_efd,
# 1215|   						    WL_EVENT_READABLE,

Error: GCC_ANALYZER_WARNING (CWE-401): [#def51]
wayland-1.24.0/src/wayland-server.c:1245:9: warning[-Wanalyzer-malloc-leak]: leak of ‘calloc(1, 232)’
wayland-1.24.0/src/wayland-server.c:1190:1: enter_function: entry to ‘wl_display_create’
wayland-1.24.0/src/wayland-server.c:1199:19: call_function: inlined call to ‘zalloc’ from ‘wl_display_create’
wayland-1.24.0/src/wayland-server.c:1200:12: branch_false: following ‘false’ branch...
wayland-1.24.0/src/wayland-server.c:1203:25: branch_false: ...to here
wayland-1.24.0/src/wayland-server.c:1204:12: branch_false: following ‘false’ branch...
wayland-1.24.0/src/wayland-server.c:1209:34: branch_false: ...to here
wayland-1.24.0/src/wayland-server.c:1210:12: branch_true: following ‘true’ branch...
wayland-1.24.0/src/wayland-server.c:1211:17: branch_true: ...to here
wayland-1.24.0/src/wayland-server.c:1245:9: throw: if ‘wl_event_loop_destroy’ throws an exception...
wayland-1.24.0/src/wayland-server.c:1245:9: danger: ‘calloc(1, 232)’ leaks here; was allocated at [(3)](sarif:/runs/0/results/7/codeFlows/0/threadFlows/0/locations/2)
# 1243|   	close(display->terminate_efd);
# 1244|   err_eventfd:
# 1245|-> 	wl_event_loop_destroy(display->loop);
# 1246|   	free(display);
# 1247|   	return NULL;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def52]
wayland-1.24.0/src/wayland-server.c:1388:24: warning[-Wanalyzer-malloc-leak]: leak of ‘calloc(1, 64)’
wayland-1.24.0/src/wayland-server.c:1357:1: enter_function: entry to ‘wl_global_create’
wayland-1.24.0/src/wayland-server.c:1364:12: branch_false: following ‘false’ branch (when ‘version > 0’)...
wayland-1.24.0/src/wayland-server.c:1371:23: branch_false: ...to here
wayland-1.24.0/src/wayland-server.c:1371:12: branch_false: following ‘false’ branch...
wayland-1.24.0/src/wayland-server.c:1378:13: branch_false: ...to here
wayland-1.24.0/src/wayland-server.c:1378:12: branch_false: following ‘false’ branch...
wayland-1.24.0/src/wayland-server.c:1383:18: call_function: inlined call to ‘zalloc’ from ‘wl_global_create’
wayland-1.24.0/src/wayland-server.c:1384:12: branch_false: following ‘false’ branch...
wayland-1.24.0/src/wayland-server.c:1387:9: branch_false: ...to here
wayland-1.24.0/src/wayland-server.c:1394:9: throw: if ‘wl_list_insert’ throws an exception...
wayland-1.24.0/src/wayland-server.c:1388:24: danger: ‘calloc(1, 64)’ leaks here; was allocated at [(9)](sarif:/runs/0/results/8/codeFlows/0/threadFlows/0/locations/8)
# 1386|   
# 1387|   	global->display = display;
# 1388|-> 	global->name = display->next_global_name++;
# 1389|   	global->interface = interface;
# 1390|   	global->version = version;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def53]
wayland-1.24.0/src/wayland-server.c:1753:13: warning[-Wanalyzer-malloc-leak]: leak of ‘wl_socket_alloc()’
wayland-1.24.0/src/wayland-server.c:1934:1: enter_function: entry to ‘wl_display_add_socket’
wayland-1.24.0/src/wayland-server.c:1938:13: call_function: calling ‘wl_socket_alloc’ from ‘wl_display_add_socket’
wayland-1.24.0/src/wayland-server.c:1938:13: return_function: returning to ‘wl_display_add_socket’ from ‘wl_socket_alloc’
wayland-1.24.0/src/wayland-server.c:1939:12: branch_false: following ‘false’ branch...
wayland-1.24.0/src/wayland-server.c:1942:12: branch_false: ...to here
wayland-1.24.0/src/wayland-server.c:1947:13: call_function: calling ‘wl_socket_init_for_display_name’ from ‘wl_display_add_socket’
# 1751|   	const char *separator = "";
# 1752|   
# 1753|-> 	if (name[0] != '/') {
# 1754|   		runtime_dir = getenv("XDG_RUNTIME_DIR");
# 1755|   		if (!runtime_dir || runtime_dir[0] != '/') {

Error: GCC_ANALYZER_WARNING (CWE-775): [#def54]
wayland-1.24.0/src/wayland-server.c:1804:13: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘*s.fd’
wayland-1.24.0/src/wayland-server.c:1794:12: branch_false: following ‘false’ branch...
wayland-1.24.0/src/wayland-server.c:1798:65: branch_false: ...to here
wayland-1.24.0/src/wayland-server.c:1799:12: branch_false: following ‘false’ branch...
wayland-1.24.0/src/wayland-server.c:1804:13: branch_false: ...to here
wayland-1.24.0/src/wayland-server.c:1804:13: danger: ‘*s.fd’ leaks here
# 1802|   	}
# 1803|   
# 1804|-> 	if (listen(s->fd, 128) < 0) {
# 1805|   		wl_log("listen() failed with error: %s\n", strerror(errno));
# 1806|   		return -1;

Error: GCC_ANALYZER_WARNING (CWE-775): [#def55]
wayland-1.24.0/src/wayland-server.c:1805:17: warning[-Wanalyzer-fd-leak]: leak of file descriptor
wayland-1.24.0/src/wayland-server.c:1934:1: enter_function: entry to ‘wl_display_add_socket’
wayland-1.24.0/src/wayland-server.c:1938:13: call_function: calling ‘wl_socket_alloc’ from ‘wl_display_add_socket’
wayland-1.24.0/src/wayland-server.c:1938:13: return_function: returning to ‘wl_display_add_socket’ from ‘wl_socket_alloc’
wayland-1.24.0/src/wayland-server.c:1939:12: branch_false: following ‘false’ branch...
wayland-1.24.0/src/wayland-server.c:1942:12: branch_false: ...to here
wayland-1.24.0/src/wayland-server.c:1947:12: branch_false: following ‘false’ branch...
wayland-1.24.0/src/wayland-server.c:1952:13: branch_false: ...to here
wayland-1.24.0/src/wayland-server.c:1952:13: call_function: calling ‘wl_socket_lock’ from ‘wl_display_add_socket’
wayland-1.24.0/src/wayland-server.c:1952:13: return_function: returning to ‘wl_display_add_socket’ from ‘wl_socket_lock’
wayland-1.24.0/src/wayland-server.c:1952:12: branch_false: following ‘false’ branch...
wayland-1.24.0/src/wayland-server.c:1957:13: branch_false: ...to here
wayland-1.24.0/src/wayland-server.c:1957:13: call_function: calling ‘_wl_display_add_socket’ from ‘wl_display_add_socket’
# 1803|   
# 1804|   	if (listen(s->fd, 128) < 0) {
# 1805|-> 		wl_log("listen() failed with error: %s\n", strerror(errno));
# 1806|   		return -1;
# 1807|   	}

Error: GCC_ANALYZER_WARNING (CWE-401): [#def56]
wayland-1.24.0/src/wayland-server.c:1889:21: warning[-Wanalyzer-malloc-leak]: leak of ‘wl_socket_alloc()’
wayland-1.24.0/src/wayland-server.c:1875:1: enter_function: entry to ‘wl_display_add_socket_fd’
wayland-1.24.0/src/wayland-server.c:1881:12: branch_false: following ‘false’ branch...
wayland-1.24.0/src/wayland-server.c:1885:13: call_function: calling ‘wl_socket_alloc’ from ‘wl_display_add_socket_fd’
wayland-1.24.0/src/wayland-server.c:1885:13: return_function: returning to ‘wl_display_add_socket_fd’ from ‘wl_socket_alloc’
wayland-1.24.0/src/wayland-server.c:1886:12: branch_false: following ‘false’ branch...
wayland-1.24.0/src/wayland-server.c:1889:21: branch_false: ...to here
wayland-1.24.0/src/wayland-server.c:1889:21: throw: if ‘wl_event_loop_add_fd’ throws an exception...
wayland-1.24.0/src/wayland-server.c:1889:21: danger: ‘wl_socket_alloc()’ leaks here; was allocated at [(7)](sarif:/runs/0/results/12/codeFlows/0/threadFlows/0/locations/6)
# 1887|   		return -1;
# 1888|   
# 1889|-> 	s->source = wl_event_loop_add_fd(display->loop, sock_fd,
# 1890|   					 WL_EVENT_READABLE,
# 1891|   					 socket_data, display);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def57]
wayland-1.24.0/src/wayland-server.c:2044:22: warning[-Wanalyzer-malloc-leak]: leak of ‘calloc(1, 128)’
wayland-1.24.0/src/wayland-server.c:2033:1: enter_function: entry to ‘wl_resource_create’
wayland-1.24.0/src/wayland-server.c:2039:20: call_function: inlined call to ‘zalloc’ from ‘wl_resource_create’
wayland-1.24.0/src/wayland-server.c:2040:12: branch_false: following ‘false’ branch...
wayland-1.24.0/src/wayland-server.c:2043:12: branch_false: ...to here
wayland-1.24.0/src/wayland-server.c:2043:12: branch_true: following ‘true’ branch (when ‘id == 0’)...
wayland-1.24.0/src/wayland-server.c:2044:22: branch_true: ...to here
wayland-1.24.0/src/wayland-server.c:2044:22: throw: if ‘wl_map_insert_new’ throws an exception...
wayland-1.24.0/src/wayland-server.c:2044:22: danger: ‘calloc(1, 128)’ leaks here; was allocated at [(3)](sarif:/runs/0/results/15/codeFlows/0/threadFlows/0/locations/2)
# 2042|   
# 2043|   	if (id == 0) {
# 2044|-> 		id = wl_map_insert_new(&client->objects, 0, NULL);
# 2045|   		if (id == 0) {
# 2046|   			free(resource);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def58]
wayland-1.24.0/src/wayland-server.c:2118:9: warning[-Wanalyzer-malloc-leak]: leak of ‘calloc(1, 32)’
wayland-1.24.0/src/wayland-server.c:2107:1: enter_function: entry to ‘wl_display_add_protocol_logger’
wayland-1.24.0/src/wayland-server.c:2112:18: call_function: inlined call to ‘zalloc’ from ‘wl_display_add_protocol_logger’
wayland-1.24.0/src/wayland-server.c:2113:12: branch_false: following ‘false’ branch...
wayland-1.24.0/src/wayland-server.c:2116:9: branch_false: ...to here
wayland-1.24.0/src/wayland-server.c:2118:9: throw: if ‘wl_list_insert’ throws an exception...
wayland-1.24.0/src/wayland-server.c:2118:9: danger: ‘calloc(1, 32)’ leaks here; was allocated at [(3)](sarif:/runs/0/results/17/codeFlows/0/threadFlows/0/locations/2)
# 2116|   	logger->func = func;
# 2117|   	logger->user_data = user_data;
# 2118|-> 	wl_list_insert(&display->protocol_loggers, &logger->link);
# 2119|   
# 2120|   	return logger;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def59]
wayland-1.24.0/src/wayland-server.c:2421:9: warning[-Wanalyzer-malloc-leak]: leak of ‘calloc(1, 232)’
wayland-1.24.0/src/wayland-server.c:1678:1: enter_function: entry to ‘socket_data’
wayland-1.24.0/src/wayland-server.c:1688:12: branch_false: following ‘false’ branch...
wayland-1.24.0/src/wayland-server.c:1691:22: branch_false: ...to here
wayland-1.24.0/src/wayland-server.c:1691:22: call_function: calling ‘wl_client_create’ from ‘socket_data’
# 2419|   wl_priv_signal_init(struct wl_priv_signal *signal)
# 2420|   {
# 2421|-> 	wl_list_init(&signal->listener_list);
# 2422|   	wl_list_init(&signal->emit_list);
# 2423|   }

Error: GCC_ANALYZER_WARNING (CWE-401): [#def60]
wayland-1.24.0/src/wayland-shm.c:283:9: warning[-Wanalyzer-malloc-leak]: leak of ‘calloc(1, 80)’
wayland-1.24.0/src/wayland-shm.c:249:1: enter_function: entry to ‘shm_pool_create_buffer’
wayland-1.24.0/src/wayland-shm.c:257:12: branch_true: following ‘true’ branch...
wayland-1.24.0/src/wayland-shm.c:264:13: branch_true: ...to here
wayland-1.24.0/src/wayland-shm.c:264:12: branch_false: following ‘false’ branch...
wayland-1.24.0/src/wayland-shm.c:264:13: branch_false: following ‘false’ branch...
wayland-1.24.0/src/wayland-shm.c:274:18: call_function: inlined call to ‘zalloc’ from ‘shm_pool_create_buffer’
wayland-1.24.0/src/wayland-shm.c:275:12: branch_false: following ‘false’ branch...
wayland-1.24.0/src/wayland-shm.c:280:9: branch_false: ...to here
wayland-1.24.0/src/wayland-shm.c:283:9: throw: if ‘wl_client_add_destroy_listener’ throws an exception...
wayland-1.24.0/src/wayland-shm.c:283:9: danger: ‘calloc(1, 80)’ leaks here; was allocated at [(9)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/8)
#  281|   	buffer->client_destroy_listener.notify =
#  282|   		shm_buffer_client_destroy_notify;
#  283|-> 	wl_client_add_destroy_listener(buffer->client,
#  284|   				       &buffer->client_destroy_listener);
#  285|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def61]
wayland-1.24.0/src/wayland-shm.c:380:17: warning[-Wanalyzer-malloc-leak]: leak of ‘calloc(1, 48)’
wayland-1.24.0/src/wayland-shm.c:356:1: enter_function: entry to ‘shm_create_pool’
wayland-1.24.0/src/wayland-shm.c:366:12: branch_false: following ‘false’ branch (when ‘size > 0’)...
wayland-1.24.0/src/wayland-shm.c:373:16: call_function: inlined call to ‘zalloc’ from ‘shm_create_pool’
wayland-1.24.0/src/wayland-shm.c:374:12: branch_false: following ‘false’ branch...
wayland-1.24.0/src/wayland-shm.c:380:17: branch_false: ...to here
wayland-1.24.0/src/wayland-shm.c:380:17: throw: if ‘fcntl’ throws an exception...
wayland-1.24.0/src/wayland-shm.c:380:17: danger: ‘calloc(1, 48)’ leaks here; was allocated at [(5)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/4)
#  378|   
#  379|   #ifdef HAVE_MEMFD_CREATE
#  380|-> 	seals = fcntl(fd, F_GET_SEALS);
#  381|   	if (seals == -1)
#  382|   		seals = 0;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def62]
wayland-1.24.0/src/wayland-shm.c:394:9: warning[-Wanalyzer-malloc-leak]: leak of ‘calloc(1, 48)’
wayland-1.24.0/src/wayland-shm.c:356:1: enter_function: entry to ‘shm_create_pool’
wayland-1.24.0/src/wayland-shm.c:366:12: branch_false: following ‘false’ branch (when ‘size > 0’)...
wayland-1.24.0/src/wayland-shm.c:373:16: call_function: inlined call to ‘zalloc’ from ‘shm_create_pool’
wayland-1.24.0/src/wayland-shm.c:374:12: branch_false: following ‘false’ branch...
wayland-1.24.0/src/wayland-shm.c:380:17: branch_false: ...to here
wayland-1.24.0/src/wayland-shm.c:399:12: branch_false: following ‘false’ branch...
wayland-1.24.0/src/wayland-shm.c:411:9: branch_false: ...to here
wayland-1.24.0/src/wayland-shm.c:411:9: throw: if ‘close’ throws an exception...
wayland-1.24.0/src/wayland-shm.c:394:9: danger: ‘calloc(1, 48)’ leaks here; was allocated at [(5)](sarif:/runs/0/results/2/codeFlows/0/threadFlows/0/locations/4)
#  392|   	pool->internal_refcount = 1;
#  393|   	pool->external_refcount = 0;
#  394|-> 	pool->size = size;
#  395|   	pool->new_size = size;
#  396|   	prot = PROT_READ | PROT_WRITE;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def63]
wayland-1.24.0/src/wayland-shm.c:754:1: warning[-Wanalyzer-malloc-leak]: leak of ‘sigbus_data’
wayland-1.24.0/src/wayland-shm.c:729:1: enter_function: entry to ‘wl_shm_buffer_begin_access’
wayland-1.24.0/src/wayland-shm.c:734:12: branch_false: following ‘false’ branch...
wayland-1.24.0/src/wayland-shm.c:737:9: branch_false: ...to here
wayland-1.24.0/src/wayland-shm.c:740:12: branch_true: following ‘true’ branch (when ‘sigbus_data’ is NULL)...
wayland-1.24.0/src/wayland-shm.c:741:31: call_function: inlined call to ‘zalloc’ from ‘wl_shm_buffer_begin_access’
wayland-1.24.0/src/wayland-shm.c:742:20: branch_false: following ‘false’ branch...
wayland-1.24.0/src/wayland-shm.c:745:17: branch_false: ...to here
wayland-1.24.0/src/wayland-shm.c:748:12: branch_false: following ‘false’ branch...
wayland-1.24.0/src/wayland-shm.c:752:9: branch_false: ...to here
wayland-1.24.0/src/wayland-shm.c:754:1: danger: ‘sigbus_data’ leaks here; was allocated at [(7)](sarif:/runs/0/results/8/codeFlows/0/threadFlows/0/locations/6)
#  752|   	sigbus_data->current_pool = pool;
#  753|   	sigbus_data->access_count++;
#  754|-> }
#  755|   
#  756|   /** Ends the access to a buffer started by wl_shm_buffer_begin_access()

Error: GCC_ANALYZER_WARNING (CWE-404): [#def64]
wayland-1.24.0/src/wayland-util.c:463:9: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
wayland-1.24.0/src/wayland-util.c:462:9: acquire_resource: ‘va_start’ called here
wayland-1.24.0/src/wayland-util.c:463:9: throw: if the called function throws an exception...
wayland-1.24.0/src/wayland-util.c:463:9: danger: missing call to ‘va_end’ to match ‘va_start’ at [(1)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/0)
#  461|   
#  462|   	va_start(argp, fmt);
#  463|-> 	wl_log_handler(fmt, argp);
#  464|   	va_end(argp);
#  465|   }

Error: GCC_ANALYZER_WARNING (CWE-404): [#def65]
wayland-1.24.0/src/wayland-util.c:473:9: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
wayland-1.24.0/src/wayland-util.c:472:9: acquire_resource: ‘va_start’ called here
wayland-1.24.0/src/wayland-util.c:473:9: throw: if the called function throws an exception...
wayland-1.24.0/src/wayland-util.c:473:9: danger: missing call to ‘va_end’ to match ‘va_start’ at [(1)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/0)
#  471|   
#  472|   	va_start(argp, fmt);
#  473|-> 	wl_log_handler(fmt, argp);
#  474|   	va_end(argp);
#  475|   

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-243.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-namewayland-1.24.0-2.fc44
store-results-to/tmp/tmpbdajvr09/wayland-1.24.0-2.fc44.tar.xz
time-created2026-01-08 22:03:54
time-finished2026-01-08 22:05:26
toolcsmock
tool-args'/usr/bin/csmock' '-r' 'fedora-rawhide-x86_64' '-t' 'gcc,cppcheck,clippy,shellcheck,unicontrol' '-o' '/tmp/tmpbdajvr09/wayland-1.24.0-2.fc44.tar.xz' '--gcc-analyze' '--unicontrol-notests' '--unicontrol-bidi-only' '--install' 'pam' '--gcc-analyzer-bin=/usr/bin/gcc' '/tmp/tmpbdajvr09/wayland-1.24.0-2.fc44.src.rpm'
tool-versioncsmock-3.8.3.20251215.161544.g62de9a5-1.el9