Task #90379 - fixed.err

back to task #90379
download
Error: GCC_ANALYZER_WARNING (CWE-401):
dtc-1.7.2/srcpos.c:349:17: warning[-Wanalyzer-malloc-leak]: leak of ‘fname’
dtc-1.7.2/srcpos.c:316:1: enter_function: entry to ‘srcpos_string_comment’
dtc-1.7.2/srcpos.c:321:12: branch_false: following ‘false’ branch (when ‘pos’ is non-NULL)...
dtc-1.7.2/srcpos.c:330:14: branch_false: ...to here
dtc-1.7.2/srcpos.c:330:12: branch_false: following ‘false’ branch...
dtc-1.7.2/srcpos.c:332:19: branch_false: ...to here
dtc-1.7.2/srcpos.c:332:17: branch_false: following ‘false’ branch...
dtc-1.7.2/srcpos.c:334:17: branch_false: ...to here
dtc-1.7.2/srcpos.c:334:17: branch_false: following ‘false’ branch (when ‘level <= 1’)...
dtc-1.7.2/srcpos.c:337:31: branch_false: ...to here
dtc-1.7.2/srcpos.c:337:31: call_function: calling ‘shorten_to_initial_path’ from ‘srcpos_string_comment’
dtc-1.7.2/srcpos.c:337:31: return_function: returning to ‘srcpos_string_comment’ from ‘shorten_to_initial_path’
dtc-1.7.2/srcpos.c:338:20: branch_true: following ‘true’ branch...
dtc-1.7.2/srcpos.c:344:12: branch_true: ...to here
dtc-1.7.2/srcpos.c:344:12: branch_false: following ‘false’ branch (when ‘level <= 1’)...
dtc-1.7.2/srcpos.c:349:17: branch_false: ...to here
dtc-1.7.2/srcpos.c:349:17: throw: if ‘xasprintf’ throws an exception...
dtc-1.7.2/srcpos.c:349:17: danger: ‘fname’ leaks here; was allocated at [(20)](sarif:/runs/0/results/3/codeFlows/0/threadFlows/0/locations/19)
#  347|   			  pos->last_line, pos->last_column);
#  348|   	else
#  349|-> 		xasprintf(&first, "%s:%d", fname,
#  350|   			  first_line ? pos->first_line : pos->last_line);
#  351|