xfsprogs-6.17.0-1.fc44

List of Findings

Error: SHELLCHECK_WARNING: [#def1]
/usr/bin/fsck.xfs:37:2: warning[SC2220]: Invalid flags are not handled. Add a *) case.
#   35|   while getopts ":aApyf" c
#   36|   do
#   37|-> 	case $c in
#   38|   	a|A|p)		AUTO=true;;
#   39|   	y)		REPAIR=true;;

Error: SHELLCHECK_WARNING (CWE-569): [#def2]
/usr/bin/fsck.xfs:43:12: warning[SC1083]: This { is literal. Check expression (missing ;/\n?) or quote it.
#   41|   	esac
#   42|   done
#   43|-> eval DEV=\${$#}
#   44|   if [ ! -e $DEV ]; then
#   45|   	echo "$0: $DEV does not exist"

Error: SHELLCHECK_WARNING (CWE-569): [#def3]
/usr/bin/fsck.xfs:43:15: warning[SC1083]: This } is literal. Check expression (missing ;/\n?) or quote it.
#   41|   	esac
#   42|   done
#   43|-> eval DEV=\${$#}
#   44|   if [ ! -e $DEV ]; then
#   45|   	echo "$0: $DEV does not exist"

Error: SHELLCHECK_WARNING (CWE-156): [#def4]
/usr/bin/fsck.xfs:84:8: warning[SC2046]: Quote this to prevent word splitting.
#   82|   		done
#   83|   		test -b "$ROOT" || ROOT=$(blkid -t "$ROOT" -o device)
#   84|-> 		if [ $(basename $DEV) = $(basename $ROOT) ]; then
#   85|   			mount $DEV /tmp/repair_mnt $ROOTFLAGS || exit 1
#   86|   		else

Error: SHELLCHECK_WARNING (CWE-156): [#def5]
/usr/bin/fsck.xfs:84:27: warning[SC2046]: Quote this to prevent word splitting.
#   82|   		done
#   83|   		test -b "$ROOT" || ROOT=$(blkid -t "$ROOT" -o device)
#   84|-> 		if [ $(basename $DEV) = $(basename $ROOT) ]; then
#   85|   			mount $DEV /tmp/repair_mnt $ROOTFLAGS || exit 1
#   86|   		else

Error: SHELLCHECK_WARNING (CWE-149): [#def6]
/usr/bin/xfs_admin:36:34: warning[SC2027]: The surrounding quotes actually unquote this. Remove or escape them.
#   34|   		IO_OPTS=$IO_OPTS" -r -c label"
#   35|   		;;
#   36|-> 	L)	DB_OPTS=$DB_OPTS" -c 'label "$OPTARG"'"
#   37|   		IO_OPTS=$IO_OPTS" -c 'label -s "$OPTARG"'"
#   38|   		;;

Error: SHELLCHECK_WARNING (CWE-149): [#def7]
/usr/bin/xfs_admin:37:35: warning[SC2027]: The surrounding quotes actually unquote this. Remove or escape them.
#   35|   		;;
#   36|   	L)	DB_OPTS=$DB_OPTS" -c 'label "$OPTARG"'"
#   37|-> 		IO_OPTS=$IO_OPTS" -c 'label -s "$OPTARG"'"
#   38|   		;;
#   39|   	O)	REPAIR_OPTS=$REPAIR_OPTS" -c $OPTARG"

Error: SHELLCHECK_WARNING (CWE-149): [#def8]
/usr/bin/xfs_admin:52:33: warning[SC2027]: The surrounding quotes actually unquote this. Remove or escape them.
#   50|   		IO_OPTS=$IO_OPTS" -r -c fsuuid"
#   51|   		;;
#   52|-> 	U)	DB_OPTS=$DB_OPTS" -c 'uuid "$OPTARG"'"
#   53|   		require_offline=1
#   54|   		;;

Error: SHELLCHECK_WARNING (CWE-88): [#def9]
/usr/bin/xfs_admin:64:14: error[SC2068]: Double quote array expansions to avoid re-splitting elements.
#   62|   	esac
#   63|   done
#   64|-> set -- extra $@
#   65|   shift $OPTIND
#   66|   case $# in

Error: SHELLCHECK_WARNING (CWE-156): [#def10]
/usr/bin/xfs_bmap:29:7: warning[SC2046]: Quote this to prevent word splitting.
#   27|   $VERSION && $DIRNAME/xfs_io -p xfs_bmap -V
#   28|   
#   29|-> shift `expr $OPTIND - 1`
#   30|   
#   31|   while [ "$1" != "" ]

Error: SHELLCHECK_WARNING (CWE-563): [#def11]
/usr/bin/xfs_freeze:6:1: warning[SC2034]: OPTS appears unused. Verify use (or export if used externally).
#    4|   #
#    5|   
#    6|-> OPTS=""
#    7|   USAGE="Usage: xfs_freeze [-V] [-f | -u] <mountpoint>"
#    8|   DIRNAME=`dirname $0`

Error: SHELLCHECK_WARNING (CWE-156): [#def12]
/usr/bin/xfs_freeze:29:7: warning[SC2046]: Quote this to prevent word splitting.
#   27|   fi
#   28|   
#   29|-> shift `expr $OPTIND - 1`
#   30|   if [ "$1" = "" ]; then
#   31|   	echo $USAGE 1>&2

Error: SHELLCHECK_WARNING: [#def13]
/usr/bin/xfs_info:14:2: warning[SC3043]: In POSIX sh, 'local' is undefined.
#   12|   # the last line and return it if it's actually a block device.
#   13|   try_find_loop_dev_for_file() {
#   14|-> 	local x="$(losetup -O NAME -j "$1" 2> /dev/null | tail -n 1)"
#   15|   	test -b "$x" && echo "$x"
#   16|   }

Error: SHELLCHECK_WARNING (CWE-571): [#def14]
/usr/bin/xfs_info:14:8: warning[SC2155]: Declare and assign separately to avoid masking return values.
#   12|   # the last line and return it if it's actually a block device.
#   13|   try_find_loop_dev_for_file() {
#   14|-> 	local x="$(losetup -O NAME -j "$1" 2> /dev/null | tail -n 1)"
#   15|   	test -b "$x" && echo "$x"
#   16|   }

Error: SHELLCHECK_WARNING (CWE-149): [#def15]
/usr/bin/xfs_metadump:17:20: warning[SC2027]: The surrounding quotes actually unquote this. Remove or escape them.
#   15|   	e)	OPTS=$OPTS"-e ";;
#   16|   	g)	OPTS=$OPTS"-g ";;
#   17|-> 	m)	OPTS=$OPTS"-m "$OPTARG" ";;
#   18|   	o)	OPTS=$OPTS"-o ";;
#   19|   	w)	OPTS=$OPTS"-w ";;

Error: SHELLCHECK_WARNING (CWE-149): [#def16]
/usr/bin/xfs_metadump:21:25: warning[SC2027]: The surrounding quotes actually unquote this. Remove or escape them.
#   19|   	w)	OPTS=$OPTS"-w ";;
#   20|   	f)	DBOPTS=$DBOPTS" -f";;
#   21|-> 	l)	DBOPTS=$DBOPTS" -l "$OPTARG" ";;
#   22|   	F)	DBOPTS=$DBOPTS" -F";;
#   23|   	v)	OPTS=$OPTS"-v "$OPTARG" ";;

Error: SHELLCHECK_WARNING (CWE-149): [#def17]
/usr/bin/xfs_metadump:23:20: warning[SC2027]: The surrounding quotes actually unquote this. Remove or escape them.
#   21|   	l)	DBOPTS=$DBOPTS" -l "$OPTARG" ";;
#   22|   	F)	DBOPTS=$DBOPTS" -F";;
#   23|-> 	v)	OPTS=$OPTS"-v "$OPTARG" ";;
#   24|   	V)	xfs_db -p xfs_metadump -V
#   25|   		status=$?

Error: SHELLCHECK_WARNING (CWE-149): [#def18]
/usr/bin/xfs_metadump:28:24: warning[SC2027]: The surrounding quotes actually unquote this. Remove or escape them.
#   26|   		exit $status
#   27|   		;;
#   28|-> 	r)	DBOPTS=$DBOPTS"-R "$OPTARG" ";;
#   29|   	\?)	echo $USAGE 1>&2
#   30|   		exit 2

Error: SHELLCHECK_WARNING (CWE-88): [#def19]
/usr/bin/xfs_metadump:34:14: error[SC2068]: Double quote array expansions to avoid re-splitting elements.
#   32|   	esac
#   33|   done
#   34|-> set -- extra $@
#   35|   shift $OPTIND
#   36|   case $# in

Error: SHELLCHECK_WARNING (CWE-563): [#def20]
/usr/bin/xfs_mkfile:6:1: warning[SC2034]: OPTS appears unused. Verify use (or export if used externally).
#    4|   #
#    5|   
#    6|-> OPTS=""
#    7|   NOBYTES=false
#    8|   PREALLOC=false

Error: SHELLCHECK_WARNING (CWE-156): [#def21]
/usr/bin/xfs_mkfile:28:7: warning[SC2046]: Quote this to prevent word splitting.
#   26|   $VERSION && $XFS_IO -V
#   27|   
#   28|-> shift `expr $OPTIND - 1`
#   29|   [ "$1" != "" ] || exit 0
#   30|   SIZE="$1"

Error: SHELLCHECK_WARNING: [#def22]
/usr/bin/xfs_ncheck:14:2: warning[SC2213]: getopts specified -b, but it's not handled by this 'case'.
#   12|   while getopts "b:fi:l:svV" c
#   13|   do
#   14|-> 	case $c in
#   15|   	s)	OPTS=$OPTS"-s ";;
#   16|   	i)	OPTS=$OPTS"-i "$OPTARG" ";;

Error: SHELLCHECK_WARNING (CWE-149): [#def23]
/usr/bin/xfs_ncheck:16:20: warning[SC2027]: The surrounding quotes actually unquote this. Remove or escape them.
#   14|   	case $c in
#   15|   	s)	OPTS=$OPTS"-s ";;
#   16|-> 	i)	OPTS=$OPTS"-i "$OPTARG" ";;
#   17|   	v)	OPTS=$OPTS"-v ";;
#   18|   	f)	DBOPTS=$DBOPTS" -f";;

Error: SHELLCHECK_WARNING (CWE-149): [#def24]
/usr/bin/xfs_ncheck:19:25: warning[SC2027]: The surrounding quotes actually unquote this. Remove or escape them.
#   17|   	v)	OPTS=$OPTS"-v ";;
#   18|   	f)	DBOPTS=$DBOPTS" -f";;
#   19|-> 	l)	DBOPTS=$DBOPTS" -l "$OPTARG" ";;
#   20|   	V)	xfs_db -p xfs_ncheck -V
#   21|   		status=$?

Error: SHELLCHECK_WARNING (CWE-88): [#def25]
/usr/bin/xfs_ncheck:29:14: error[SC2068]: Double quote array expansions to avoid re-splitting elements.
#   27|   	esac
#   28|   done
#   29|-> set -- extra $@
#   30|   shift $OPTIND
#   31|   case $# in

Error: SHELLCHECK_WARNING (CWE-563): [#def26]
/usr/bin/xfs_property:8:1: warning[SC2034]: OPTS appears unused. Verify use (or export if used externally).
#    6|   #
#    7|   
#    8|-> OPTS=""
#    9|   USAGE="Usage: xfs_property [-V] [mountpoint|device|file] [list [-v]|get name...|set name=value...|remove name...]"
#   10|   

Error: SHELLCHECK_WARNING (CWE-571): [#def27]
/usr/bin/xfs_property:15:8: warning[SC2155]: Declare and assign separately to avoid masking return values.
#   13|   # the last line and return it if it's actually a block device.
#   14|   try_find_loop_dev_for_file() {
#   15|-> 	local x="$(losetup -O NAME -j "$1" 2> /dev/null | tail -n 1)"
#   16|   	test -b "${x}" && echo "${x}"
#   17|   }

Error: GCC_ANALYZER_WARNING (CWE-401): [#def28]
xfsprogs-6.17.0/copy/xfs_copy.c:1380:9: warning[-Wanalyzer-malloc-leak]: leak of ‘logbuf.data’
xfsprogs-6.17.0/copy/xfs_copy.c:1388:1: enter_function: entry to ‘format_logs’
xfsprogs-6.17.0/copy/xfs_copy.c:1396:12: branch_true: following ‘true’ branch...
xfsprogs-6.17.0/copy/xfs_copy.c:1397:27: branch_true: ...to here
xfsprogs-6.17.0/copy/xfs_copy.c:1398:22: call_function: calling ‘wbuf_init’ from ‘format_logs’
xfsprogs-6.17.0/copy/xfs_copy.c:1398:22: return_function: returning to ‘format_logs’ from ‘wbuf_init’
xfsprogs-6.17.0/copy/xfs_copy.c:1398:20: branch_false: following ‘false’ branch...
xfsprogs-6.17.0/copy/xfs_copy.c:1403:21: branch_false: ...to here
xfsprogs-6.17.0/copy/xfs_copy.c:1403:35: branch_true: following ‘true’ branch...
xfsprogs-6.17.0/copy/xfs_copy.c:1404:21: call_function: inlined call to ‘xfs_has_crc’ from ‘format_logs’
xfsprogs-6.17.0/copy/xfs_copy.c:1404:20: branch_true: following ‘true’ branch...
xfsprogs-6.17.0/copy/xfs_copy.c:1405:25: branch_true: ...to here
xfsprogs-6.17.0/copy/xfs_copy.c:1405:25: call_function: calling ‘format_log’ from ‘format_logs’
# 1378|   	 * write fails, mark the target inactive so the failure is reported.
# 1379|   	 */
# 1380|-> 	libxfs_log_clear(NULL, buf->data, logstart, length, &buf->owner->uuid,
# 1381|   			 xfs_has_logv2(mp) ? 2 : 1,
# 1382|   			 mp->m_sb.sb_logsunit, XLOG_FMT, cycle, true);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def29]
xfsprogs-6.17.0/copy/xfs_copy.c:1400:32: warning[-Wanalyzer-malloc-leak]: leak of ‘logbuf.data’
xfsprogs-6.17.0/copy/xfs_copy.c:1388:1: enter_function: entry to ‘format_logs’
xfsprogs-6.17.0/copy/xfs_copy.c:1396:12: branch_true: following ‘true’ branch...
xfsprogs-6.17.0/copy/xfs_copy.c:1397:27: branch_true: ...to here
xfsprogs-6.17.0/copy/xfs_copy.c:1398:22: call_function: calling ‘wbuf_init’ from ‘format_logs’
xfsprogs-6.17.0/copy/xfs_copy.c:1398:22: return_function: returning to ‘format_logs’ from ‘wbuf_init’
xfsprogs-6.17.0/copy/xfs_copy.c:1398:20: branch_false: following ‘false’ branch...
xfsprogs-6.17.0/copy/xfs_copy.c:1403:21: branch_false: ...to here
xfsprogs-6.17.0/copy/xfs_copy.c:1403:35: branch_false: following ‘false’ branch...
xfsprogs-6.17.0/copy/xfs_copy.c:1411:13: call_function: inlined call to ‘xfs_has_crc’ from ‘format_logs’
xfsprogs-6.17.0/copy/xfs_copy.c:1411:12: branch_false: following ‘false’ branch...
xfsprogs-6.17.0/copy/xfs_copy.c:1400:32: branch_false: ...to here
xfsprogs-6.17.0/copy/xfs_copy.c:1400:32: danger: ‘logbuf.data’ leaks here; was allocated at [(8)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/7)
# 1398|   		if (!wbuf_init(&logbuf, logsize, w_buf.data_align,
# 1399|   			       w_buf.min_io_size, w_buf.id))
# 1400|-> 			return -ENOMEM;
# 1401|   	}
# 1402|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def30]
xfsprogs-6.17.0/db/attrset.c:140:17: warning[-Wanalyzer-malloc-leak]: leak of ‘buf’
xfsprogs-6.17.0/db/attrset.c:132:15: acquire_memory: allocated here
xfsprogs-6.17.0/db/attrset.c:133:12: branch_false: following ‘false’ branch (when ‘buf’ is non-NULL)...
xfsprogs-6.17.0/db/attrset.c:138:14: branch_false: ...to here
xfsprogs-6.17.0/db/attrset.c:139:12: branch_true: following ‘true’ branch...
xfsprogs-6.17.0/db/attrset.c:140:17: branch_true: ...to here
xfsprogs-6.17.0/db/attrset.c:140:17: throw: if ‘perror’ throws an exception...
xfsprogs-6.17.0/db/attrset.c:140:17: danger: ‘buf’ leaks here; was allocated at [(1)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/0)
#  138|   	fp = fopen(fname, "r");
#  139|   	if (!fp) {
#  140|-> 		perror(fname);
#  141|   		goto out_free;
#  142|   	}

Error: GCC_ANALYZER_WARNING (CWE-401): [#def31]
xfsprogs-6.17.0/db/attrset.c:371:25: warning[-Wanalyzer-malloc-leak]: leak of ‘args.name’
xfsprogs-6.17.0/db/attrset.c:218:1: enter_function: entry to ‘attr_set_f’
xfsprogs-6.17.0/db/attrset.c:236:12: branch_false: following ‘false’ branch...
xfsprogs-6.17.0/db/attrset.c:240:13: branch_false: ...to here
xfsprogs-6.17.0/db/attrset.c:240:12: branch_false: following ‘false’ branch...
xfsprogs-6.17.0/db/attrset.c:240:12: branch_false: ...to here
xfsprogs-6.17.0/db/attrset.c:245:16: branch_true: following ‘true’ branch (when ‘c != -1’)...
xfsprogs-6.17.0/db/attrset.c:246:17: branch_true: ...to here
xfsprogs-6.17.0/db/attrset.c:316:12: branch_true: following ‘true’ branch (when ‘name_from_file’ is non-NULL)...
xfsprogs-6.17.0/db/attrset.c:317:21: branch_true: ...to here
xfsprogs-6.17.0/db/attrset.c:319:20: branch_false: following ‘false’ branch...
xfsprogs-6.17.0/db/attrset.c:324:29: branch_false: ...to here
xfsprogs-6.17.0/db/attrset.c:324:29: call_function: calling ‘get_buf_from_file’ from ‘attr_set_f’
xfsprogs-6.17.0/db/attrset.c:324:29: return_function: returning to ‘attr_set_f’ from ‘get_buf_from_file’
xfsprogs-6.17.0/db/attrset.c:326:20: branch_false: following ‘false’ branch...
xfsprogs-6.17.0/db/attrset.c:329:17: branch_false: ...to here
xfsprogs-6.17.0/db/attrset.c:350:12: branch_false: following ‘false’ branch (when ‘value_from_file’ is NULL)...
xfsprogs-6.17.0/db/attrset.c:359:20: branch_false: ...to here
xfsprogs-6.17.0/db/attrset.c:359:19: branch_false: following ‘false’ branch...
xfsprogs-6.17.0/db/attrset.c:367:30: branch_false: ...to here
xfsprogs-6.17.0/db/attrset.c:367:19: branch_true: following ‘true’ branch...
xfsprogs-6.17.0/db/attrset.c:367:19: branch_true: ...to here
xfsprogs-6.17.0/db/attrset.c:370:20: branch_true: following ‘true’ branch...
xfsprogs-6.17.0/db/attrset.c:371:34: branch_true: ...to here
xfsprogs-6.17.0/db/attrset.c:371:25: throw: if ‘dbprintf’ throws an exception...
xfsprogs-6.17.0/db/attrset.c:371:25: danger: ‘args.name’ leaks here; was allocated at [(14)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/13)
#  369|   		args.value = strdup(argv[optind + 1]);
#  370|   		if (!args.value) {
#  371|-> 			dbprintf(_("cannot allocate buffer (%d)\n"),
#  372|   					args.valuelen);
#  373|   			goto out;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def32]
xfsprogs-6.17.0/db/attrset.c:388:13: warning[-Wanalyzer-malloc-leak]: leak of ‘args.value’
xfsprogs-6.17.0/db/attrset.c:236:12: branch_false: following ‘false’ branch...
xfsprogs-6.17.0/db/attrset.c:240:13: branch_false: ...to here
xfsprogs-6.17.0/db/attrset.c:240:12: branch_false: following ‘false’ branch...
xfsprogs-6.17.0/db/attrset.c:240:12: branch_false: ...to here
xfsprogs-6.17.0/db/attrset.c:316:12: branch_false: following ‘false’ branch (when ‘name_from_file’ is NULL)...
xfsprogs-6.17.0/db/attrset.c:332:31: branch_false: ...to here
xfsprogs-6.17.0/db/attrset.c:338:20: branch_false: following ‘false’ branch...
xfsprogs-6.17.0/db/attrset.c:343:32: branch_false: ...to here
xfsprogs-6.17.0/db/attrset.c:344:20: branch_false: following ‘false’ branch...
xfsprogs-6.17.0/db/attrset.c:350:12: branch_false: ...to here
xfsprogs-6.17.0/db/attrset.c:350:12: branch_false: following ‘false’ branch (when ‘value_from_file’ is NULL)...
xfsprogs-6.17.0/db/attrset.c:359:20: branch_false: ...to here
xfsprogs-6.17.0/db/attrset.c:359:19: branch_false: following ‘false’ branch...
xfsprogs-6.17.0/db/attrset.c:367:30: branch_false: ...to here
xfsprogs-6.17.0/db/attrset.c:367:19: branch_true: following ‘true’ branch...
xfsprogs-6.17.0/db/attrset.c:367:19: branch_true: ...to here
xfsprogs-6.17.0/db/attrset.c:369:30: acquire_memory: allocated here
xfsprogs-6.17.0/db/attrset.c:370:20: branch_false: following ‘false’ branch...
xfsprogs-6.17.0/db/attrset.c:377:12: branch_false: ...to here
xfsprogs-6.17.0/db/attrset.c:377:12: branch_false: following ‘false’ branch (when ‘fsprop == 0’)...
xfsprogs-6.17.0/db/attrset.c:388:44: branch_false: ...to here
xfsprogs-6.17.0/db/attrset.c:388:13: throw: if ‘libxfs_iget’ throws an exception...
xfsprogs-6.17.0/db/attrset.c:388:13: danger: ‘args.value’ leaks here; was allocated at [(17)](sarif:/runs/0/results/2/codeFlows/0/threadFlows/0/locations/16)
#  386|   	}
#  387|   
#  388|-> 	if (libxfs_iget(mp, NULL, iocur_top->ino, 0, &args.dp)) {
#  389|   		dbprintf(_("failed to iget inode %llu\n"),
#  390|   			(unsigned long long)iocur_top->ino);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def33]
xfsprogs-6.17.0/db/attrset.c:522:13: warning[-Wanalyzer-malloc-leak]: leak of ‘args.name’
xfsprogs-6.17.0/db/attrset.c:422:1: enter_function: entry to ‘attr_remove_f’
xfsprogs-6.17.0/db/attrset.c:437:12: branch_false: following ‘false’ branch...
xfsprogs-6.17.0/db/attrset.c:441:13: branch_false: ...to here
xfsprogs-6.17.0/db/attrset.c:441:12: branch_false: following ‘false’ branch...
xfsprogs-6.17.0/db/attrset.c:441:12: branch_false: ...to here
xfsprogs-6.17.0/db/attrset.c:446:16: branch_true: following ‘true’ branch (when ‘c != -1’)...
xfsprogs-6.17.0/db/attrset.c:447:17: branch_true: ...to here
xfsprogs-6.17.0/db/attrset.c:485:12: branch_true: following ‘true’ branch (when ‘name_from_file’ is non-NULL)...
xfsprogs-6.17.0/db/attrset.c:486:21: branch_true: ...to here
xfsprogs-6.17.0/db/attrset.c:488:20: branch_false: following ‘false’ branch...
xfsprogs-6.17.0/db/attrset.c:493:29: branch_false: ...to here
xfsprogs-6.17.0/db/attrset.c:493:29: call_function: calling ‘get_buf_from_file’ from ‘attr_remove_f’
xfsprogs-6.17.0/db/attrset.c:493:29: return_function: returning to ‘attr_remove_f’ from ‘get_buf_from_file’
xfsprogs-6.17.0/db/attrset.c:495:20: branch_false: following ‘false’ branch...
xfsprogs-6.17.0/db/attrset.c:498:17: branch_false: ...to here
xfsprogs-6.17.0/db/attrset.c:519:12: branch_false: following ‘false’ branch (when ‘fsprop == 0’)...
xfsprogs-6.17.0/db/attrset.c:522:44: branch_false: ...to here
xfsprogs-6.17.0/db/attrset.c:522:13: throw: if ‘libxfs_iget’ throws an exception...
xfsprogs-6.17.0/db/attrset.c:522:13: danger: ‘args.name’ leaks here; was allocated at [(14)](sarif:/runs/0/results/3/codeFlows/0/threadFlows/0/locations/13)
#  520|   		goto out;
#  521|   
#  522|-> 	if (libxfs_iget(mp, NULL, iocur_top->ino, 0, &args.dp)) {
#  523|   		dbprintf(_("failed to iget inode %llu\n"),
#  524|   			(unsigned long long)iocur_top->ino);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def34]
xfsprogs-6.17.0/db/attrset.c:641:13: warning[-Wanalyzer-malloc-leak]: leak of ‘args.name’
xfsprogs-6.17.0/db/attrset.c:552:1: enter_function: entry to ‘attr_get_f’
xfsprogs-6.17.0/db/attrset.c:567:12: branch_false: following ‘false’ branch...
xfsprogs-6.17.0/db/attrset.c:571:13: branch_false: ...to here
xfsprogs-6.17.0/db/attrset.c:571:12: branch_false: following ‘false’ branch...
xfsprogs-6.17.0/db/attrset.c:571:12: branch_false: ...to here
xfsprogs-6.17.0/db/attrset.c:576:16: branch_true: following ‘true’ branch (when ‘c != -1’)...
xfsprogs-6.17.0/db/attrset.c:577:17: branch_true: ...to here
xfsprogs-6.17.0/db/attrset.c:607:12: branch_true: following ‘true’ branch (when ‘name_from_file’ is non-NULL)...
xfsprogs-6.17.0/db/attrset.c:608:21: branch_true: ...to here
xfsprogs-6.17.0/db/attrset.c:610:20: branch_false: following ‘false’ branch...
xfsprogs-6.17.0/db/attrset.c:615:29: branch_false: ...to here
xfsprogs-6.17.0/db/attrset.c:615:29: call_function: calling ‘get_buf_from_file’ from ‘attr_get_f’
xfsprogs-6.17.0/db/attrset.c:615:29: return_function: returning to ‘attr_get_f’ from ‘get_buf_from_file’
xfsprogs-6.17.0/db/attrset.c:617:20: branch_false: following ‘false’ branch...
xfsprogs-6.17.0/db/attrset.c:620:17: branch_false: ...to here
xfsprogs-6.17.0/db/attrset.c:641:13: throw: if ‘libxfs_iget’ throws an exception...
xfsprogs-6.17.0/db/attrset.c:641:13: danger: ‘args.name’ leaks here; was allocated at [(14)](sarif:/runs/0/results/4/codeFlows/0/threadFlows/0/locations/13)
#  639|   	}
#  640|   
#  641|-> 	if (libxfs_iget(mp, NULL, iocur_top->ino, 0, &args.dp)) {
#  642|   		dbprintf(_("failed to iget inode %llu\n"),
#  643|   			(unsigned long long)iocur_top->ino);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def35]
xfsprogs-6.17.0/db/block.c:268:9: warning[-Wanalyzer-malloc-leak]: leak of ‘bmp’
xfsprogs-6.17.0/db/block.c:253:12: branch_false: following ‘false’ branch...
xfsprogs-6.17.0/db/block.c:257:9: branch_false: ...to here
xfsprogs-6.17.0/db/block.c:262:12: branch_false: following ‘false’ branch...
xfsprogs-6.17.0/db/block.c:266:20: branch_false: ...to here
xfsprogs-6.17.0/db/block.c:267:15: acquire_memory: allocated here
xfsprogs-6.17.0/db/block.c:268:9: throw: if ‘bmap’ throws an exception...
xfsprogs-6.17.0/db/block.c:268:9: danger: ‘bmp’ leaks here; was allocated at [(5)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/4)
#  266|   	nex = nb = type == TYP_DIR2 ? mp->m_dir_geo->fsbcount : 1;
#  267|   	bmp = malloc(nb * sizeof(*bmp));
#  268|-> 	bmap(bno, nb, XFS_DATA_FORK, &nex, bmp);
#  269|   	if (nex == 0) {
#  270|   		dbprintf(_("file data block is unmapped\n"));

Error: GCC_ANALYZER_WARNING (CWE-476): [#def36]
xfsprogs-6.17.0/db/btblock.c:186:22: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’
xfsprogs-6.17.0/db/btblock.c:262:9: branch_true: following ‘true’ branch (when ‘startoff == 0’)...
xfsprogs-6.17.0/db/btblock.c:263:9: branch_true: ...to here
xfsprogs-6.17.0/db/btblock.c:263:9: branch_true: following ‘true’ branch...
xfsprogs-6.17.0/db/btblock.c:265:41: branch_true: ...to here
xfsprogs-6.17.0/db/btblock.c:265:19: call_function: inlined call to ‘btblock_maxrecs’ from ‘btblock_ptr_offset’
#  184|   btblock_maxrecs(struct xfs_db_btree *bt, int blocksize)
#  185|   {
#  186|-> 	blocksize -= bt->block_len;
#  187|   
#  188|   	return blocksize / (bt->key_len + bt->ptr_len);

Error: GCC_ANALYZER_WARNING (CWE-476): [#def37]
xfsprogs-6.17.0/db/btblock.c:244:18: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’
xfsprogs-6.17.0/db/btblock.c:241:9: branch_true: following ‘true’ branch (when ‘startoff == 0’)...
xfsprogs-6.17.0/db/btblock.c:242:9: branch_true: ...to here
xfsprogs-6.17.0/db/btblock.c:242:9: branch_true: following ‘true’ branch...
xfsprogs-6.17.0/db/btblock.c:244:18: branch_true: ...to here
xfsprogs-6.17.0/db/btblock.c:244:18: danger: dereference of NULL ‘block_to_bt(obj)’
#  242|   	ASSERT(block->bb_level != 0);
#  243|   
#  244|-> 	offset = bt->block_len + (idx - 1) * bt->key_len;
#  245|   	return bitize(offset);
#  246|   }

Error: GCC_ANALYZER_WARNING (CWE-476): [#def38]
xfsprogs-6.17.0/db/btblock.c:289:18: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’
xfsprogs-6.17.0/db/btblock.c:286:9: branch_true: following ‘true’ branch (when ‘startoff == 0’)...
xfsprogs-6.17.0/db/btblock.c:287:9: branch_true: ...to here
xfsprogs-6.17.0/db/btblock.c:287:9: branch_true: following ‘true’ branch...
xfsprogs-6.17.0/db/btblock.c:289:18: branch_true: ...to here
xfsprogs-6.17.0/db/btblock.c:289:18: danger: dereference of NULL ‘block_to_bt(obj)’
#  287|   	ASSERT(block->bb_level == 0);
#  288|   
#  289|-> 	offset = bt->block_len + (idx - 1) * bt->rec_len;
#  290|   	return bitize(offset);
#  291|   }

Error: COMPILER_WARNING (CWE-704): [#def39]
xfsprogs-6.17.0/db/btheight.c: scope_hint: In function ‘construct_records_per_block’
xfsprogs-6.17.0/db/btheight.c:158:11: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type
#  158 |         p = strchr(tag, ':');
#      |           ^
#  156|   	}
#  157|   
#  158|-> 	p = strchr(tag, ':');
#  159|   	if (!p) {
#  160|   		fprintf(stderr, _("%s: expected a btree geometry specification.\n"), tag);

Error: COMPILER_WARNING (CWE-704): [#def40]
xfsprogs-6.17.0/db/btheight.c:158:11: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type
#  156|   	}
#  157|   
#  158|-> 	p = strchr(tag, ':');
#  159|   	if (!p) {
#  160|   		fprintf(stderr, _("%s: expected a btree geometry specification.\n"), tag);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def41]
xfsprogs-6.17.0/db/btheight.c:172:23: warning[-Wanalyzer-malloc-leak]: leak of ‘toktag’
xfsprogs-6.17.0/db/btheight.c:387:1: enter_function: entry to ‘report_all’
xfsprogs-6.17.0/db/btheight.c:395:31: branch_true: following ‘true’ branch (when ‘i != 9’)...
xfsprogs-6.17.0/db/btheight.c:396:17: branch_true: ...to here
xfsprogs-6.17.0/db/btheight.c:396:17: call_function: calling ‘report’ from ‘report_all’
#  170|   		goto out;
#  171|   	}
#  172|-> 	record_size = cvt_u16(p, 0);
#  173|   	if (errno) {
#  174|   		perror(p);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def42]
xfsprogs-6.17.0/db/faddr.c:141:9: warning[-Wanalyzer-malloc-leak]: leak of ‘bmp’
xfsprogs-6.17.0/db/faddr.c:135:12: branch_false: following ‘false’ branch (when ‘bno != 18446744073709551615’)...
xfsprogs-6.17.0/db/faddr.c:139:20: branch_false: ...to here
xfsprogs-6.17.0/db/faddr.c:140:15: acquire_memory: allocated here
xfsprogs-6.17.0/db/faddr.c:141:9: throw: if ‘bmap’ throws an exception...
xfsprogs-6.17.0/db/faddr.c:141:9: danger: ‘bmp’ leaks here; was allocated at [(3)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/2)
#  139|   	nex = nb = next == TYP_DIR2 ? mp->m_dir_geo->fsbcount : 1;
#  140|   	bmp = malloc(nb * sizeof(*bmp));
#  141|-> 	bmap(bno, nb, XFS_DATA_FORK, &nex, bmp);
#  142|   	if (nex == 0) {
#  143|   		dbprintf(_("file block is unmapped\n"));

Error: GCC_ANALYZER_WARNING (CWE-401): [#def43]
xfsprogs-6.17.0/db/faddr.c:225:9: warning[-Wanalyzer-malloc-leak]: leak of ‘bmp’
xfsprogs-6.17.0/db/faddr.c:219:12: branch_false: following ‘false’ branch (when ‘bno != 18446744073709551615’)...
xfsprogs-6.17.0/db/faddr.c:223:20: branch_false: ...to here
xfsprogs-6.17.0/db/faddr.c:224:15: acquire_memory: allocated here
xfsprogs-6.17.0/db/faddr.c:225:9: throw: if ‘bmap’ throws an exception...
xfsprogs-6.17.0/db/faddr.c:225:9: danger: ‘bmp’ leaks here; was allocated at [(3)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/2)
#  223|   	nex = nb = next == TYP_DIR2 ? mp->m_dir_geo->fsbcount : 1;
#  224|   	bmp = malloc(nb * sizeof(*bmp));
#  225|-> 	bmap(bno, nb, XFS_DATA_FORK, &nex, bmp);
#  226|   	if (nex == 0) {
#  227|   		dbprintf(_("file block is unmapped\n"));

Error: GCC_ANALYZER_WARNING (CWE-401): [#def44]
xfsprogs-6.17.0/db/faddr.c:278:9: warning[-Wanalyzer-malloc-leak]: leak of ‘bmp’
xfsprogs-6.17.0/db/faddr.c:272:12: branch_false: following ‘false’ branch (when ‘bno != 0’)...
xfsprogs-6.17.0/db/faddr.c:276:17: branch_false: ...to here
xfsprogs-6.17.0/db/faddr.c:277:15: acquire_memory: allocated here
xfsprogs-6.17.0/db/faddr.c:278:9: throw: if ‘bmap’ throws an exception...
xfsprogs-6.17.0/db/faddr.c:278:9: danger: ‘bmp’ leaks here; was allocated at [(3)](sarif:/runs/0/results/2/codeFlows/0/threadFlows/0/locations/2)
#  276|   	nex = mp->m_dir_geo->fsbcount;
#  277|   	bmp = malloc(nex * sizeof(*bmp));
#  278|-> 	bmap(bno, mp->m_dir_geo->fsbcount, XFS_DATA_FORK, &nex, bmp);
#  279|   	if (nex == 0) {
#  280|   		dbprintf(_("directory block is unmapped\n"));

Error: GCC_ANALYZER_WARNING (CWE-401): [#def45]
xfsprogs-6.17.0/db/fuzz.c:336:9: warning[-Wanalyzer-malloc-leak]: leak of ‘b’
xfsprogs-6.17.0/db/fuzz.c:327:20: acquire_memory: allocated here
xfsprogs-6.17.0/db/fuzz.c:328:12: branch_false: following ‘false’ branch (when ‘b’ is non-NULL)...
xfsprogs-6.17.0/db/fuzz.c:328:12: branch_false: ...to here
xfsprogs-6.17.0/db/fuzz.c:333:21: branch_false: following ‘false’ branch (when ‘i >= bytes’)...
xfsprogs-6.17.0/db/fuzz.c:336:9: branch_false: ...to here
xfsprogs-6.17.0/db/fuzz.c:336:9: throw: if ‘setbitval’ throws an exception...
xfsprogs-6.17.0/db/fuzz.c:336:9: danger: ‘b’ leaks here; was allocated at [(1)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/0)
#  334|   		*b++ = (char)lrand48();
#  335|   
#  336|-> 	setbitval(buf, bitoff, nbits, rbuf);
#  337|   	free(rbuf);
#  338|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def46]
xfsprogs-6.17.0/db/hash.c:205:39: warning[-Wanalyzer-malloc-leak]: leak of ‘tab’
xfsprogs-6.17.0/db/hash.c:382:1: enter_function: entry to ‘hashcoll_f’
xfsprogs-6.17.0/db/hash.c:418:12: branch_false: following ‘false’ branch (when ‘path’ is NULL)...
xfsprogs-6.17.0/db/hash.c:432:12: branch_false: ...to here
xfsprogs-6.17.0/db/hash.c:435:12: branch_false: following ‘false’ branch (when ‘read_stdin == 0’)...
xfsprogs-6.17.0/db/hash.c:452:14: branch_false: ...to here
xfsprogs-6.17.0/db/hash.c:452:26: branch_true: following ‘true’ branch (when ‘c < argc’)...
xfsprogs-6.17.0/db/hash.c:453:42: branch_true: ...to here
xfsprogs-6.17.0/db/hash.c:455:20: branch_false: following ‘false’ branch (when ‘create_xattr == 0’)...
xfsprogs-6.17.0/db/hash.c:458:33: branch_false: ...to here
xfsprogs-6.17.0/db/hash.c:458:33: call_function: calling ‘collide_dirents’ from ‘hashcoll_f’
#  203|   {
#  204|   	struct name_dup		*ent;
#  205|-> 	uint32_t		crc = crc32c(~0, name, namelen);
#  206|   
#  207|   	ent = tab->buckets[crc % tab->nr_buckets];

Error: GCC_ANALYZER_WARNING (CWE-401): [#def47]
xfsprogs-6.17.0/db/hash.c:235:31: warning[-Wanalyzer-malloc-leak]: leak of ‘tab’
xfsprogs-6.17.0/db/hash.c:382:1: enter_function: entry to ‘hashcoll_f’
xfsprogs-6.17.0/db/hash.c:418:12: branch_false: following ‘false’ branch (when ‘path’ is NULL)...
xfsprogs-6.17.0/db/hash.c:432:12: branch_false: ...to here
xfsprogs-6.17.0/db/hash.c:435:12: branch_false: following ‘false’ branch (when ‘read_stdin == 0’)...
xfsprogs-6.17.0/db/hash.c:452:14: branch_false: ...to here
xfsprogs-6.17.0/db/hash.c:452:26: branch_true: following ‘true’ branch (when ‘c < argc’)...
xfsprogs-6.17.0/db/hash.c:453:42: branch_true: ...to here
xfsprogs-6.17.0/db/hash.c:455:20: branch_false: following ‘false’ branch (when ‘create_xattr == 0’)...
xfsprogs-6.17.0/db/hash.c:458:33: branch_false: ...to here
xfsprogs-6.17.0/db/hash.c:458:33: call_function: calling ‘collide_dirents’ from ‘hashcoll_f’
#  233|   
#  234|   		do {
#  235|-> 			ret = find_alternate(namelen, (uint8_t *)name, seq++);
#  236|   		} while (ret == 0);
#  237|   		if (ret < 0)

Error: GCC_ANALYZER_WARNING (CWE-401): [#def48]
xfsprogs-6.17.0/db/hash.c:245:20: warning[-Wanalyzer-malloc-leak]: leak of ‘dup’
xfsprogs-6.17.0/db/hash.c:382:1: enter_function: entry to ‘hashcoll_f’
xfsprogs-6.17.0/db/hash.c:418:12: branch_false: following ‘false’ branch (when ‘path’ is NULL)...
xfsprogs-6.17.0/db/hash.c:432:12: branch_false: ...to here
xfsprogs-6.17.0/db/hash.c:435:12: branch_false: following ‘false’ branch (when ‘read_stdin == 0’)...
xfsprogs-6.17.0/db/hash.c:452:14: branch_false: ...to here
xfsprogs-6.17.0/db/hash.c:452:26: branch_true: following ‘true’ branch (when ‘c < argc’)...
xfsprogs-6.17.0/db/hash.c:453:42: branch_true: ...to here
xfsprogs-6.17.0/db/hash.c:455:20: branch_false: following ‘false’ branch (when ‘create_xattr == 0’)...
xfsprogs-6.17.0/db/hash.c:458:33: branch_false: ...to here
xfsprogs-6.17.0/db/hash.c:458:33: call_function: calling ‘collide_dirents’ from ‘hashcoll_f’
#  243|   		return ENOMEM;
#  244|   
#  245|-> 	dup->crc = crc32c(~0, name, namelen);
#  246|   	dup->namelen = namelen;
#  247|   	memcpy(dup->name, name, namelen);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def49]
xfsprogs-6.17.0/db/hash.c:245:20: warning[-Wanalyzer-malloc-leak]: leak of ‘tab’
xfsprogs-6.17.0/db/hash.c:382:1: enter_function: entry to ‘hashcoll_f’
xfsprogs-6.17.0/db/hash.c:418:12: branch_false: following ‘false’ branch (when ‘path’ is NULL)...
xfsprogs-6.17.0/db/hash.c:432:12: branch_false: ...to here
xfsprogs-6.17.0/db/hash.c:435:12: branch_false: following ‘false’ branch (when ‘read_stdin == 0’)...
xfsprogs-6.17.0/db/hash.c:452:14: branch_false: ...to here
xfsprogs-6.17.0/db/hash.c:452:26: branch_true: following ‘true’ branch (when ‘c < argc’)...
xfsprogs-6.17.0/db/hash.c:453:42: branch_true: ...to here
xfsprogs-6.17.0/db/hash.c:455:20: branch_false: following ‘false’ branch (when ‘create_xattr == 0’)...
xfsprogs-6.17.0/db/hash.c:458:33: branch_false: ...to here
xfsprogs-6.17.0/db/hash.c:458:33: call_function: calling ‘collide_dirents’ from ‘hashcoll_f’
#  243|   		return ENOMEM;
#  244|   
#  245|-> 	dup->crc = crc32c(~0, name, namelen);
#  246|   	dup->namelen = namelen;
#  247|   	memcpy(dup->name, name, namelen);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def50]
xfsprogs-6.17.0/db/hash.c:297:17: warning[-Wanalyzer-malloc-leak]: leak of ‘tab’
xfsprogs-6.17.0/db/hash.c:382:1: enter_function: entry to ‘hashcoll_f’
xfsprogs-6.17.0/db/hash.c:418:12: branch_false: following ‘false’ branch (when ‘path’ is NULL)...
xfsprogs-6.17.0/db/hash.c:432:12: branch_false: ...to here
xfsprogs-6.17.0/db/hash.c:435:12: branch_false: following ‘false’ branch (when ‘read_stdin == 0’)...
xfsprogs-6.17.0/db/hash.c:452:14: branch_false: ...to here
xfsprogs-6.17.0/db/hash.c:452:26: branch_true: following ‘true’ branch (when ‘c < argc’)...
xfsprogs-6.17.0/db/hash.c:453:42: branch_true: ...to here
xfsprogs-6.17.0/db/hash.c:455:20: branch_false: following ‘false’ branch (when ‘create_xattr == 0’)...
xfsprogs-6.17.0/db/hash.c:458:33: branch_false: ...to here
xfsprogs-6.17.0/db/hash.c:458:33: call_function: calling ‘collide_dirents’ from ‘hashcoll_f’
#  295|   	for (i = 0; i < nr; i++) {
#  296|   		strncpy(direntname, name, MAXNAMELEN);
#  297|-> 		obfuscate_name(old_hash, namelen, (uint8_t *)direntname, true);
#  298|   		ASSERT(old_hash == libxfs_dir2_hashname(mp, &dname));
#  299|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def51]
xfsprogs-6.17.0/db/hash.c:298:17: warning[-Wanalyzer-malloc-leak]: leak of ‘tab’
xfsprogs-6.17.0/db/hash.c:382:1: enter_function: entry to ‘hashcoll_f’
xfsprogs-6.17.0/db/hash.c:418:12: branch_false: following ‘false’ branch (when ‘path’ is NULL)...
xfsprogs-6.17.0/db/hash.c:432:12: branch_false: ...to here
xfsprogs-6.17.0/db/hash.c:435:12: branch_false: following ‘false’ branch (when ‘read_stdin == 0’)...
xfsprogs-6.17.0/db/hash.c:452:14: branch_false: ...to here
xfsprogs-6.17.0/db/hash.c:452:26: branch_true: following ‘true’ branch (when ‘c < argc’)...
xfsprogs-6.17.0/db/hash.c:453:42: branch_true: ...to here
xfsprogs-6.17.0/db/hash.c:455:20: branch_false: following ‘false’ branch (when ‘create_xattr == 0’)...
xfsprogs-6.17.0/db/hash.c:458:33: branch_false: ...to here
xfsprogs-6.17.0/db/hash.c:458:33: call_function: calling ‘collide_dirents’ from ‘hashcoll_f’
#  296|   		strncpy(direntname, name, MAXNAMELEN);
#  297|   		obfuscate_name(old_hash, namelen, (uint8_t *)direntname, true);
#  298|-> 		ASSERT(old_hash == libxfs_dir2_hashname(mp, &dname));
#  299|   
#  300|   		if (fd >= 0) {

Error: GCC_ANALYZER_WARNING (CWE-775): [#def52]
xfsprogs-6.17.0/db/hash.c:467:17: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘fd’
xfsprogs-6.17.0/db/hash.c:394:16: branch_true: following ‘true’ branch (when ‘c != -1’)...
xfsprogs-6.17.0/db/hash.c:395:17: branch_true: ...to here
xfsprogs-6.17.0/db/hash.c:418:12: branch_true: following ‘true’ branch (when ‘path’ is non-NULL)...
xfsprogs-6.17.0/db/hash.c:421:20: branch_true: ...to here
xfsprogs-6.17.0/db/hash.c:424:22: acquire_resource: opened here
xfsprogs-6.17.0/db/hash.c:425:20: branch_false: following ‘false’ branch...
xfsprogs-6.17.0/db/hash.c:432:12: branch_false: ...to here
xfsprogs-6.17.0/db/hash.c:435:12: branch_false: following ‘false’ branch (when ‘read_stdin == 0’)...
xfsprogs-6.17.0/db/hash.c:452:14: branch_false: ...to here
xfsprogs-6.17.0/db/hash.c:452:26: branch_false: following ‘false’ branch (when ‘c >= argc’)...
xfsprogs-6.17.0/db/hash.c:465:1: branch_false: ...to here
xfsprogs-6.17.0/db/hash.c:466:12: branch_true: following ‘true’ branch (when ‘fd != -1’)...
xfsprogs-6.17.0/db/hash.c:467:17: branch_true: ...to here
xfsprogs-6.17.0/db/hash.c:467:17: throw: if ‘close’ throws an exception...
xfsprogs-6.17.0/db/hash.c:467:17: danger: ‘fd’ leaks here; was opened at [(5)](sarif:/runs/0/results/6/codeFlows/0/threadFlows/0/locations/4)
#  465|   done:
#  466|   	if (fd >= 0)
#  467|-> 		close(fd);
#  468|   	return 0;
#  469|   }

Error: GCC_ANALYZER_WARNING (CWE-775): [#def53]
xfsprogs-6.17.0/db/input.c:287:25: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(argv[1], "r")’
xfsprogs-6.17.0/db/input.c:294:1: enter_function: entry to ‘source_f’
xfsprogs-6.17.0/db/input.c:303:13: acquire_resource: opened here
xfsprogs-6.17.0/db/input.c:304:12: branch_false: following ‘false’ branch...
xfsprogs-6.17.0/db/input.c:310:9: branch_false: ...to here
xfsprogs-6.17.0/db/input.c:310:9: call_function: calling ‘pushfile’ from ‘source_f’
#  285|   	inputstack =
#  286|   		xrealloc(inputstack,
#  287|-> 			(inputstacksize + 1) * sizeof(*inputstack));
#  288|   	inputstacksize++;
#  289|   	curinput = inputstack[inputstacksize - 1] = file;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def54]
xfsprogs-6.17.0/db/input.c:287:25: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(argv[1], "r")’
xfsprogs-6.17.0/db/input.c:294:1: enter_function: entry to ‘source_f’
xfsprogs-6.17.0/db/input.c:303:13: acquire_memory: allocated here
xfsprogs-6.17.0/db/input.c:304:12: branch_false: following ‘false’ branch...
xfsprogs-6.17.0/db/input.c:310:9: branch_false: ...to here
xfsprogs-6.17.0/db/input.c:310:9: call_function: calling ‘pushfile’ from ‘source_f’
#  285|   	inputstack =
#  286|   		xrealloc(inputstack,
#  287|-> 			(inputstacksize + 1) * sizeof(*inputstack));
#  288|   	inputstacksize++;
#  289|   	curinput = inputstack[inputstacksize - 1] = file;

Error: GCC_ANALYZER_WARNING (CWE-775): [#def55]
xfsprogs-6.17.0/db/metadump.c:3542:25: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘outfd’
xfsprogs-6.17.0/db/metadump.c:3393:12: branch_false: following ‘false’ branch...
xfsprogs-6.17.0/db/metadump.c:3403:13: branch_false: ...to here
xfsprogs-6.17.0/db/metadump.c:3453:12: branch_false: following ‘false’ branch...
xfsprogs-6.17.0/db/metadump.c:3458:15: branch_false: ...to here
xfsprogs-6.17.0/db/metadump.c:3494:25: branch_true: following ‘true’ branch...
xfsprogs-6.17.0/db/metadump.c:3498:41: branch_true: ...to here
xfsprogs-6.17.0/db/metadump.c:3520:12: branch_true: following ‘true’ branch (when the strings are equal)...
xfsprogs-6.17.0/db/metadump.c:3521:21: branch_true: ...to here
xfsprogs-6.17.0/db/metadump.c:3521:20: branch_false: following ‘false’ branch...
xfsprogs-6.17.0/db/metadump.c:3534:17: branch_false: ...to here
xfsprogs-6.17.0/db/metadump.c:3535:25: acquire_resource: opened here
xfsprogs-6.17.0/db/metadump.c:3536:20: branch_false: following ‘false’ branch (when ‘outfd >= 0’)...
xfsprogs-6.17.0/db/metadump.c:3540:23: branch_false: ...to here
xfsprogs-6.17.0/db/metadump.c:3541:20: branch_true: following ‘true’ branch (when ‘ret < 0’)...
xfsprogs-6.17.0/db/metadump.c:3542:25: branch_true: ...to here
xfsprogs-6.17.0/db/metadump.c:3542:25: throw: if ‘perror’ throws an exception...
xfsprogs-6.17.0/db/metadump.c:3542:25: danger: ‘outfd’ leaks here; was opened at [(12)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/11)
# 3540|   		ret = dup2(STDERR_FILENO, STDOUT_FILENO);
# 3541|   		if (ret < 0) {
# 3542|-> 			perror("redirecting stdout");
# 3543|   			close(outfd);
# 3544|   			goto out;

Error: GCC_ANALYZER_WARNING (CWE-775): [#def56]
xfsprogs-6.17.0/db/metadump.c:3543:25: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘outfd’
xfsprogs-6.17.0/db/metadump.c:3393:12: branch_false: following ‘false’ branch...
xfsprogs-6.17.0/db/metadump.c:3403:13: branch_false: ...to here
xfsprogs-6.17.0/db/metadump.c:3453:12: branch_false: following ‘false’ branch...
xfsprogs-6.17.0/db/metadump.c:3458:15: branch_false: ...to here
xfsprogs-6.17.0/db/metadump.c:3494:25: branch_true: following ‘true’ branch...
xfsprogs-6.17.0/db/metadump.c:3498:41: branch_true: ...to here
xfsprogs-6.17.0/db/metadump.c:3520:12: branch_true: following ‘true’ branch (when the strings are equal)...
xfsprogs-6.17.0/db/metadump.c:3521:21: branch_true: ...to here
xfsprogs-6.17.0/db/metadump.c:3521:20: branch_false: following ‘false’ branch...
xfsprogs-6.17.0/db/metadump.c:3534:17: branch_false: ...to here
xfsprogs-6.17.0/db/metadump.c:3535:25: acquire_resource: opened here
xfsprogs-6.17.0/db/metadump.c:3536:20: branch_false: following ‘false’ branch (when ‘outfd >= 0’)...
xfsprogs-6.17.0/db/metadump.c:3540:23: branch_false: ...to here
xfsprogs-6.17.0/db/metadump.c:3541:20: branch_true: following ‘true’ branch (when ‘ret < 0’)...
xfsprogs-6.17.0/db/metadump.c:3542:25: branch_true: ...to here
xfsprogs-6.17.0/db/metadump.c:3543:25: throw: if ‘close’ throws an exception...
xfsprogs-6.17.0/db/metadump.c:3543:25: danger: ‘outfd’ leaks here; was opened at [(12)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/11)
# 3541|   		if (ret < 0) {
# 3542|   			perror("redirecting stdout");
# 3543|-> 			close(outfd);
# 3544|   			goto out;
# 3545|   		}

Error: GCC_ANALYZER_WARNING (CWE-775): [#def57]
xfsprogs-6.17.0/db/metadump.c:3550:25: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘ret’
xfsprogs-6.17.0/db/metadump.c:3393:12: branch_false: following ‘false’ branch...
xfsprogs-6.17.0/db/metadump.c:3403:13: branch_false: ...to here
xfsprogs-6.17.0/db/metadump.c:3453:12: branch_false: following ‘false’ branch...
xfsprogs-6.17.0/db/metadump.c:3458:15: branch_false: ...to here
xfsprogs-6.17.0/db/metadump.c:3494:25: branch_true: following ‘true’ branch...
xfsprogs-6.17.0/db/metadump.c:3498:41: branch_true: ...to here
xfsprogs-6.17.0/db/metadump.c:3520:12: branch_true: following ‘true’ branch (when the strings are equal)...
xfsprogs-6.17.0/db/metadump.c:3521:21: branch_true: ...to here
xfsprogs-6.17.0/db/metadump.c:3521:20: branch_false: following ‘false’ branch...
xfsprogs-6.17.0/db/metadump.c:3534:17: branch_false: ...to here
xfsprogs-6.17.0/db/metadump.c:3536:20: branch_false: following ‘false’ branch (when ‘outfd >= 0’)...
xfsprogs-6.17.0/db/metadump.c:3540:23: branch_false: ...to here
xfsprogs-6.17.0/db/metadump.c:3540:23: acquire_resource: opened here
xfsprogs-6.17.0/db/metadump.c:3541:20: branch_false: following ‘false’ branch (when ‘ret >= 0’)...
xfsprogs-6.17.0/db/metadump.c:3546:33: branch_false: ...to here
xfsprogs-6.17.0/db/metadump.c:3547:20: branch_true: following ‘true’ branch...
xfsprogs-6.17.0/db/metadump.c:3548:25: branch_true: ...to here
xfsprogs-6.17.0/db/metadump.c:3550:25: throw: if ‘close’ throws an exception...
xfsprogs-6.17.0/db/metadump.c:3550:25: danger: ‘ret’ leaks here; was opened at [(14)](sarif:/runs/0/results/2/codeFlows/0/threadFlows/0/locations/13)
# 3548|   			fprintf(stderr, "cannot create dump stream\n");
# 3549|   			dup2(outfd, STDOUT_FILENO);
# 3550|-> 			close(outfd);
# 3551|   			goto out;
# 3552|   		}

Error: GCC_ANALYZER_WARNING (CWE-775): [#def58]
xfsprogs-6.17.0/db/metadump.c:3567:15: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘ret’
xfsprogs-6.17.0/db/metadump.c:3393:12: branch_false: following ‘false’ branch...
xfsprogs-6.17.0/db/metadump.c:3403:13: branch_false: ...to here
xfsprogs-6.17.0/db/metadump.c:3453:12: branch_false: following ‘false’ branch...
xfsprogs-6.17.0/db/metadump.c:3458:15: branch_false: ...to here
xfsprogs-6.17.0/db/metadump.c:3494:25: branch_true: following ‘true’ branch...
xfsprogs-6.17.0/db/metadump.c:3498:41: branch_true: ...to here
xfsprogs-6.17.0/db/metadump.c:3520:12: branch_true: following ‘true’ branch (when the strings are equal)...
xfsprogs-6.17.0/db/metadump.c:3521:21: branch_true: ...to here
xfsprogs-6.17.0/db/metadump.c:3521:20: branch_false: following ‘false’ branch...
xfsprogs-6.17.0/db/metadump.c:3534:17: branch_false: ...to here
xfsprogs-6.17.0/db/metadump.c:3536:20: branch_false: following ‘false’ branch (when ‘outfd >= 0’)...
xfsprogs-6.17.0/db/metadump.c:3540:23: branch_false: ...to here
xfsprogs-6.17.0/db/metadump.c:3540:23: acquire_resource: opened here
xfsprogs-6.17.0/db/metadump.c:3541:20: branch_false: following ‘false’ branch (when ‘ret >= 0’)...
xfsprogs-6.17.0/db/metadump.c:3546:33: branch_false: ...to here
xfsprogs-6.17.0/db/metadump.c:3547:20: branch_false: following ‘false’ branch...
xfsprogs-6.17.0/db/metadump.c:3553:17: branch_false: ...to here
xfsprogs-6.17.0/db/metadump.c:3562:12: branch_true: following ‘true’ branch...
xfsprogs-6.17.0/db/metadump.c:3562:12: branch_true: ...to here
xfsprogs-6.17.0/db/metadump.c:3567:15: throw: if the called function throws an exception...
xfsprogs-6.17.0/db/metadump.c:3567:15: danger: ‘ret’ leaks here; was opened at [(14)](sarif:/runs/0/results/3/codeFlows/0/threadFlows/0/locations/13)
# 3565|   		metadump.mdops = &metadump2_ops;
# 3566|   
# 3567|-> 	ret = metadump.mdops->init();
# 3568|   	if (ret)
# 3569|   		goto out;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def59]
xfsprogs-6.17.0/db/namei.c:67:28: warning[-Wanalyzer-malloc-leak]: leak of ‘<unknown>’
xfsprogs-6.17.0/db/namei.c:1116:1: enter_function: entry to ‘link_f’
xfsprogs-6.17.0/db/namei.c:1127:16: branch_true: following ‘true’ branch (when ‘c != -1’)...
xfsprogs-6.17.0/db/namei.c:1128:17: branch_true: ...to here
xfsprogs-6.17.0/db/namei.c:1143:33: call_function: calling ‘path_walk’ from ‘link_f’
#   65|   			next_slash = endp;
#   66|   
#   67|-> 		new_path = realloc(dirpath->path,
#   68|   				(dirpath->depth + 1) * sizeof(char *));
#   69|   		if (!new_path) {

Error: GCC_ANALYZER_WARNING (CWE-401): [#def60]
xfsprogs-6.17.0/db/namei.c:68:34: warning[-Wanalyzer-malloc-leak]: leak of ‘path_parse(p)’
xfsprogs-6.17.0/db/namei.c:1116:1: enter_function: entry to ‘link_f’
xfsprogs-6.17.0/db/namei.c:1127:16: branch_true: following ‘true’ branch (when ‘c != -1’)...
xfsprogs-6.17.0/db/namei.c:1128:17: branch_true: ...to here
xfsprogs-6.17.0/db/namei.c:1143:33: call_function: calling ‘path_walk’ from ‘link_f’
#   66|   
#   67|   		new_path = realloc(dirpath->path,
#   68|-> 				(dirpath->depth + 1) * sizeof(char *));
#   69|   		if (!new_path) {
#   70|   			path_free(dirpath);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def61]
xfsprogs-6.17.0/db/namei.c:97:14: warning[-Wanalyzer-malloc-leak]: leak of ‘<unknown>’
xfsprogs-6.17.0/db/namei.c:1116:1: enter_function: entry to ‘link_f’
xfsprogs-6.17.0/db/namei.c:1127:16: branch_true: following ‘true’ branch (when ‘c != -1’)...
xfsprogs-6.17.0/db/namei.c:1128:17: branch_true: ...to here
xfsprogs-6.17.0/db/namei.c:1143:33: call_function: calling ‘path_walk’ from ‘link_f’
#   95|   	int			error;
#   96|   
#   97|-> 	tp = libxfs_trans_alloc_empty(mp);
#   98|   
#   99|   	error = -libxfs_iget(mp, tp, ino, 0, &dp);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def62]
xfsprogs-6.17.0/db/namei.c:99:18: warning[-Wanalyzer-malloc-leak]: leak of ‘<unknown>’
xfsprogs-6.17.0/db/namei.c:1116:1: enter_function: entry to ‘link_f’
xfsprogs-6.17.0/db/namei.c:1127:16: branch_true: following ‘true’ branch (when ‘c != -1’)...
xfsprogs-6.17.0/db/namei.c:1128:17: branch_true: ...to here
xfsprogs-6.17.0/db/namei.c:1143:33: call_function: calling ‘path_walk’ from ‘link_f’
#   97|   	tp = libxfs_trans_alloc_empty(mp);
#   98|   
#   99|-> 	error = -libxfs_iget(mp, tp, ino, 0, &dp);
#  100|   	if (error)
#  101|   		goto out_trans;

Error: GCC_ANALYZER_WARNING (CWE-688): [#def63]
xfsprogs-6.17.0/db/namei.c:106:35: warning[-Wanalyzer-possible-null-argument]: use of possibly-NULL ‘xname.name’ where non-null expected
xfsprogs-6.17.0/db/namei.c:1116:1: enter_function: entry to ‘link_f’
xfsprogs-6.17.0/db/namei.c:1127:16: branch_true: following ‘true’ branch (when ‘c != -1’)...
xfsprogs-6.17.0/db/namei.c:1128:17: branch_true: ...to here
xfsprogs-6.17.0/db/namei.c:1143:33: call_function: calling ‘path_walk’ from ‘link_f’
#  104|   		struct xfs_name	xname = {
#  105|   			.name	= (unsigned char *)dirpath->path[i],
#  106|-> 			.len	= strlen(dirpath->path[i]),
#  107|   		};
#  108|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def64]
xfsprogs-6.17.0/db/namei.c:171:17: warning[-Wanalyzer-malloc-leak]: leak of ‘path_parse(p)’
xfsprogs-6.17.0/db/namei.c:1116:1: enter_function: entry to ‘link_f’
xfsprogs-6.17.0/db/namei.c:1127:16: branch_true: following ‘true’ branch (when ‘c != -1’)...
xfsprogs-6.17.0/db/namei.c:1128:17: branch_true: ...to here
xfsprogs-6.17.0/db/namei.c:1143:33: call_function: calling ‘path_walk’ from ‘link_f’
#  169|   		return ENOMEM;
#  170|   
#  171|-> 	error = path_navigate(mp, rootino, dirpath);
#  172|   	path_free(dirpath);
#  173|   	return error;

Error: GCC_ANALYZER_WARNING (CWE-404): [#def65]
xfsprogs-6.17.0/db/output.c:34:9: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
xfsprogs-6.17.0/db/output.c:31:12: branch_false: following ‘false’ branch...
xfsprogs-6.17.0/db/output.c:33:9: branch_false: ...to here
xfsprogs-6.17.0/db/output.c:33:9: acquire_resource: ‘va_start’ called here
xfsprogs-6.17.0/db/output.c:34:9: throw: if ‘blockint’ throws an exception...
xfsprogs-6.17.0/db/output.c:34:9: danger: missing call to ‘va_end’ to match ‘va_start’ at [(3)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/2)
#   32|   		return 0;
#   33|   	va_start(ap, fmt);
#   34|-> 	blockint();
#   35|   	i = 0;
#   36|   	if (dbprefix)

Error: GCC_ANALYZER_WARNING (CWE-404): [#def66]
xfsprogs-6.17.0/db/output.c:39:9: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
xfsprogs-6.17.0/db/output.c:31:12: branch_false: following ‘false’ branch...
xfsprogs-6.17.0/db/output.c:33:9: branch_false: ...to here
xfsprogs-6.17.0/db/output.c:33:9: acquire_resource: ‘va_start’ called here
xfsprogs-6.17.0/db/output.c:39:9: throw: if ‘unblockint’ throws an exception...
xfsprogs-6.17.0/db/output.c:39:9: danger: missing call to ‘va_end’ to match ‘va_start’ at [(3)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/2)
#   37|   		i += printf("%s: ", x.data.name);
#   38|   	i += vprintf(fmt, ap);
#   39|-> 	unblockint();
#   40|   	va_end(ap);
#   41|   	if (log_file) {

Error: GCC_ANALYZER_WARNING (CWE-401): [#def67]
xfsprogs-6.17.0/db/rdump.c:98:35: warning[-Wanalyzer-malloc-leak]: leak of ‘cd’
xfsprogs-6.17.0/db/rdump.c:871:1: enter_function: entry to ‘rdump_path’
xfsprogs-6.17.0/db/rdump.c:884:12: branch_false: following ‘false’ branch...
xfsprogs-6.17.0/db/rdump.c:889:16: branch_false: ...to here
xfsprogs-6.17.0/db/rdump.c:890:12: branch_false: following ‘false’ branch (when ‘pbuf’ is non-NULL)...
xfsprogs-6.17.0/db/rdump.c:894:20: branch_false: ...to here
xfsprogs-6.17.0/db/rdump.c:931:15: call_function: calling ‘rdump_file’ from ‘rdump_path’
#   96|   		.fsx_projid	= ip->i_projid,
#   97|   		.fsx_cowextsize	= ip->i_cowextsize,
#   98|-> 		.fsx_xflags	= xfs_ip2xflags(ip),
#   99|   	};
#  100|   	int			ret;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def68]
xfsprogs-6.17.0/db/rdump.c:98:35: warning[-Wanalyzer-malloc-leak]: leak of ‘pbuf’
xfsprogs-6.17.0/db/rdump.c:871:1: enter_function: entry to ‘rdump_path’
xfsprogs-6.17.0/db/rdump.c:884:12: branch_false: following ‘false’ branch...
xfsprogs-6.17.0/db/rdump.c:889:16: branch_false: ...to here
xfsprogs-6.17.0/db/rdump.c:889:16: acquire_memory: allocated here
xfsprogs-6.17.0/db/rdump.c:890:12: branch_false: following ‘false’ branch (when ‘pbuf’ is non-NULL)...
xfsprogs-6.17.0/db/rdump.c:894:20: branch_false: ...to here
xfsprogs-6.17.0/db/rdump.c:931:15: call_function: calling ‘rdump_file’ from ‘rdump_path’
#   96|   		.fsx_projid	= ip->i_projid,
#   97|   		.fsx_cowextsize	= ip->i_cowextsize,
#   98|-> 		.fsx_xflags	= xfs_ip2xflags(ip),
#   99|   	};
#  100|   	int			ret;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def69]
xfsprogs-6.17.0/db/rdump.c:107:25: warning[-Wanalyzer-malloc-leak]: leak of ‘cd’
xfsprogs-6.17.0/db/rdump.c:871:1: enter_function: entry to ‘rdump_path’
xfsprogs-6.17.0/db/rdump.c:884:12: branch_false: following ‘false’ branch...
xfsprogs-6.17.0/db/rdump.c:889:16: branch_false: ...to here
xfsprogs-6.17.0/db/rdump.c:890:12: branch_false: following ‘false’ branch (when ‘pbuf’ is non-NULL)...
xfsprogs-6.17.0/db/rdump.c:894:20: branch_false: ...to here
xfsprogs-6.17.0/db/rdump.c:931:15: call_function: calling ‘rdump_file’ from ‘rdump_path’
#  105|   			lost_mask |= LOST_MODE;
#  106|   		else
#  107|-> 			dbprintf(_("%s%s%s: fchmod %s\n"), destdir->path,
#  108|   					destdir->sep, pbuf->path,
#  109|   					strerror(errno));

Error: GCC_ANALYZER_WARNING (CWE-401): [#def70]
xfsprogs-6.17.0/db/rdump.c:107:25: warning[-Wanalyzer-malloc-leak]: leak of ‘pbuf’
xfsprogs-6.17.0/db/rdump.c:871:1: enter_function: entry to ‘rdump_path’
xfsprogs-6.17.0/db/rdump.c:884:12: branch_false: following ‘false’ branch...
xfsprogs-6.17.0/db/rdump.c:889:16: branch_false: ...to here
xfsprogs-6.17.0/db/rdump.c:889:16: acquire_memory: allocated here
xfsprogs-6.17.0/db/rdump.c:890:12: branch_false: following ‘false’ branch (when ‘pbuf’ is non-NULL)...
xfsprogs-6.17.0/db/rdump.c:894:20: branch_false: ...to here
xfsprogs-6.17.0/db/rdump.c:931:15: call_function: calling ‘rdump_file’ from ‘rdump_path’
#  105|   			lost_mask |= LOST_MODE;
#  106|   		else
#  107|-> 			dbprintf(_("%s%s%s: fchmod %s\n"), destdir->path,
#  108|   					destdir->sep, pbuf->path,
#  109|   					strerror(errno));

Error: GCC_ANALYZER_WARNING (CWE-401): [#def71]
xfsprogs-6.17.0/db/rdump.c:119:25: warning[-Wanalyzer-malloc-leak]: leak of ‘cd’
xfsprogs-6.17.0/db/rdump.c:871:1: enter_function: entry to ‘rdump_path’
xfsprogs-6.17.0/db/rdump.c:884:12: branch_false: following ‘false’ branch...
xfsprogs-6.17.0/db/rdump.c:889:16: branch_false: ...to here
xfsprogs-6.17.0/db/rdump.c:890:12: branch_false: following ‘false’ branch (when ‘pbuf’ is non-NULL)...
xfsprogs-6.17.0/db/rdump.c:894:20: branch_false: ...to here
xfsprogs-6.17.0/db/rdump.c:931:15: call_function: calling ‘rdump_file’ from ‘rdump_path’
#  117|   			lost_mask |= LOST_OWNER;
#  118|   		else
#  119|-> 			dbprintf(_("%s%s%s: fchown %s\n"), destdir->path,
#  120|   					destdir->sep, pbuf->path,
#  121|   					strerror(errno));

Error: GCC_ANALYZER_WARNING (CWE-401): [#def72]
xfsprogs-6.17.0/db/rdump.c:139:25: warning[-Wanalyzer-malloc-leak]: leak of ‘cd’
xfsprogs-6.17.0/db/rdump.c:871:1: enter_function: entry to ‘rdump_path’
xfsprogs-6.17.0/db/rdump.c:884:12: branch_false: following ‘false’ branch...
xfsprogs-6.17.0/db/rdump.c:889:16: branch_false: ...to here
xfsprogs-6.17.0/db/rdump.c:890:12: branch_false: following ‘false’ branch (when ‘pbuf’ is non-NULL)...
xfsprogs-6.17.0/db/rdump.c:894:20: branch_false: ...to here
xfsprogs-6.17.0/db/rdump.c:931:15: call_function: calling ‘rdump_file’ from ‘rdump_path’
#  137|   			lost_mask |= LOST_FSXATTR;
#  138|   		else
#  139|-> 			dbprintf(_("%s%s%s: fssetxattr %s\n"), destdir->path,
#  140|   					destdir->sep, pbuf->path,
#  141|   					strerror(errno));

Error: GCC_ANALYZER_WARNING (CWE-401): [#def73]
xfsprogs-6.17.0/db/rdump.c:428:17: warning[-Wanalyzer-malloc-leak]: leak of ‘cd’
xfsprogs-6.17.0/db/rdump.c:871:1: enter_function: entry to ‘rdump_path’
xfsprogs-6.17.0/db/rdump.c:884:12: branch_false: following ‘false’ branch...
xfsprogs-6.17.0/db/rdump.c:889:16: branch_false: ...to here
xfsprogs-6.17.0/db/rdump.c:890:12: branch_false: following ‘false’ branch (when ‘pbuf’ is non-NULL)...
xfsprogs-6.17.0/db/rdump.c:894:20: branch_false: ...to here
xfsprogs-6.17.0/db/rdump.c:931:15: call_function: calling ‘rdump_file’ from ‘rdump_path’
#  426|   	cx = calloc(1, sizeof(struct copyxattr));
#  427|   	if (!cx) {
#  428|-> 		dbprintf(_("%s%s%s: allocating xattr buffer %s\n"),
#  429|   				destdir->path, destdir->sep, pbuf->path,
#  430|   				strerror(errno));

Error: GCC_ANALYZER_WARNING (CWE-401): [#def74]
xfsprogs-6.17.0/db/rdump.c:437:15: warning[-Wanalyzer-malloc-leak]: leak of ‘cd’
xfsprogs-6.17.0/db/rdump.c:871:1: enter_function: entry to ‘rdump_path’
xfsprogs-6.17.0/db/rdump.c:884:12: branch_false: following ‘false’ branch...
xfsprogs-6.17.0/db/rdump.c:889:16: branch_false: ...to here
xfsprogs-6.17.0/db/rdump.c:890:12: branch_false: following ‘false’ branch (when ‘pbuf’ is non-NULL)...
xfsprogs-6.17.0/db/rdump.c:894:20: branch_false: ...to here
xfsprogs-6.17.0/db/rdump.c:931:15: call_function: calling ‘rdump_file’ from ‘rdump_path’
#  435|   	cx->fd = fd;
#  436|   
#  437|-> 	ret = xattr_walk(tp, ip, rdump_xattr, cx);
#  438|   	if (ret && ret != ECANCELED) {
#  439|   		dbprintf(_("%s%s%s: listxattr %s\n"), destdir->path,

Error: GCC_ANALYZER_WARNING (CWE-401): [#def75]
xfsprogs-6.17.0/db/rdump.c:437:15: warning[-Wanalyzer-malloc-leak]: leak of ‘cx’
xfsprogs-6.17.0/db/rdump.c:871:1: enter_function: entry to ‘rdump_path’
xfsprogs-6.17.0/db/rdump.c:884:12: branch_false: following ‘false’ branch...
xfsprogs-6.17.0/db/rdump.c:889:16: branch_false: ...to here
xfsprogs-6.17.0/db/rdump.c:890:12: branch_false: following ‘false’ branch (when ‘pbuf’ is non-NULL)...
xfsprogs-6.17.0/db/rdump.c:894:20: branch_false: ...to here
xfsprogs-6.17.0/db/rdump.c:931:15: call_function: calling ‘rdump_file’ from ‘rdump_path’
#  435|   	cx->fd = fd;
#  436|   
#  437|-> 	ret = xattr_walk(tp, ip, rdump_xattr, cx);
#  438|   	if (ret && ret != ECANCELED) {
#  439|   		dbprintf(_("%s%s%s: listxattr %s\n"), destdir->path,

Error: GCC_ANALYZER_WARNING (CWE-401): [#def76]
xfsprogs-6.17.0/db/rdump.c:439:17: warning[-Wanalyzer-malloc-leak]: leak of ‘cd’
xfsprogs-6.17.0/db/rdump.c:871:1: enter_function: entry to ‘rdump_path’
xfsprogs-6.17.0/db/rdump.c:884:12: branch_false: following ‘false’ branch...
xfsprogs-6.17.0/db/rdump.c:889:16: branch_false: ...to here
xfsprogs-6.17.0/db/rdump.c:890:12: branch_false: following ‘false’ branch (when ‘pbuf’ is non-NULL)...
xfsprogs-6.17.0/db/rdump.c:894:20: branch_false: ...to here
xfsprogs-6.17.0/db/rdump.c:931:15: call_function: calling ‘rdump_file’ from ‘rdump_path’
#  437|   	ret = xattr_walk(tp, ip, rdump_xattr, cx);
#  438|   	if (ret && ret != ECANCELED) {
#  439|-> 		dbprintf(_("%s%s%s: listxattr %s\n"), destdir->path,
#  440|   				destdir->sep, pbuf->path, strerror(errno));
#  441|   		if (strict_errors)

Error: GCC_ANALYZER_WARNING (CWE-775): [#def77]
xfsprogs-6.17.0/db/rdump.c:520:17: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘destdir.fd’
xfsprogs-6.17.0/db/rdump.c:938:1: enter_function: entry to ‘rdump_f’
xfsprogs-6.17.0/db/rdump.c:960:12: branch_false: following ‘false’ branch...
xfsprogs-6.17.0/db/rdump.c:967:28: branch_false: ...to here
xfsprogs-6.17.0/db/rdump.c:975:12: branch_false: following ‘false’ branch...
xfsprogs-6.17.0/db/rdump.c:982:26: branch_false: ...to here
xfsprogs-6.17.0/db/rdump.c:986:22: acquire_resource: opened here
xfsprogs-6.17.0/db/rdump.c:987:12: branch_false: following ‘false’ branch...
xfsprogs-6.17.0/db/rdump.c:993:23: branch_false: ...to here
xfsprogs-6.17.0/db/rdump.c:993:12: branch_true: following ‘true’ branch...
xfsprogs-6.17.0/db/rdump.c:995:17: branch_true: ...to here
xfsprogs-6.17.0/db/rdump.c:996:23: call_function: calling ‘rdump_path’ from ‘rdump_f’
#  518|   	cd = calloc(1, sizeof(struct copydirent));
#  519|   	if (!cd) {
#  520|-> 		dbprintf(_("%s%s%s: %s\n"), destdir->path, destdir->sep,
#  521|   				pbuf->path, strerror(errno));
#  522|   		return 1;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def78]
xfsprogs-6.17.0/db/rdump.c:520:17: warning[-Wanalyzer-malloc-leak]: leak of ‘pbuf’
xfsprogs-6.17.0/db/rdump.c:871:1: enter_function: entry to ‘rdump_path’
xfsprogs-6.17.0/db/rdump.c:884:12: branch_false: following ‘false’ branch...
xfsprogs-6.17.0/db/rdump.c:889:16: branch_false: ...to here
xfsprogs-6.17.0/db/rdump.c:889:16: acquire_memory: allocated here
xfsprogs-6.17.0/db/rdump.c:890:12: branch_false: following ‘false’ branch (when ‘pbuf’ is non-NULL)...
xfsprogs-6.17.0/db/rdump.c:894:20: branch_false: ...to here
xfsprogs-6.17.0/db/rdump.c:931:15: call_function: calling ‘rdump_file’ from ‘rdump_path’
#  518|   	cd = calloc(1, sizeof(struct copydirent));
#  519|   	if (!cd) {
#  520|-> 		dbprintf(_("%s%s%s: %s\n"), destdir->path, destdir->sep,
#  521|   				pbuf->path, strerror(errno));
#  522|   		return 1;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def79]
xfsprogs-6.17.0/db/rdump.c:534:25: warning[-Wanalyzer-malloc-leak]: leak of ‘cd’
xfsprogs-6.17.0/db/rdump.c:871:1: enter_function: entry to ‘rdump_path’
xfsprogs-6.17.0/db/rdump.c:884:12: branch_false: following ‘false’ branch...
xfsprogs-6.17.0/db/rdump.c:889:16: branch_false: ...to here
xfsprogs-6.17.0/db/rdump.c:890:12: branch_false: following ‘false’ branch (when ‘pbuf’ is non-NULL)...
xfsprogs-6.17.0/db/rdump.c:894:20: branch_false: ...to here
xfsprogs-6.17.0/db/rdump.c:931:15: call_function: calling ‘rdump_file’ from ‘rdump_path’
#  532|   		ret = mkdirat(destdir->fd, pbuf->path, 0600);
#  533|   		if (ret && errno != EEXIST) {
#  534|-> 			dbprintf(_("%s%s%s: %s\n"), destdir->path,
#  535|   					destdir->sep, pbuf->path,
#  536|   					strerror(errno));

Error: GCC_ANALYZER_WARNING (CWE-401): [#def80]
xfsprogs-6.17.0/db/rdump.c:534:25: warning[-Wanalyzer-malloc-leak]: leak of ‘pbuf’
xfsprogs-6.17.0/db/rdump.c:871:1: enter_function: entry to ‘rdump_path’
xfsprogs-6.17.0/db/rdump.c:884:12: branch_false: following ‘false’ branch...
xfsprogs-6.17.0/db/rdump.c:889:16: branch_false: ...to here
xfsprogs-6.17.0/db/rdump.c:889:16: acquire_memory: allocated here
xfsprogs-6.17.0/db/rdump.c:890:12: branch_false: following ‘false’ branch (when ‘pbuf’ is non-NULL)...
xfsprogs-6.17.0/db/rdump.c:894:20: branch_false: ...to here
xfsprogs-6.17.0/db/rdump.c:931:15: call_function: calling ‘rdump_file’ from ‘rdump_path’
#  532|   		ret = mkdirat(destdir->fd, pbuf->path, 0600);
#  533|   		if (ret && errno != EEXIST) {
#  534|-> 			dbprintf(_("%s%s%s: %s\n"), destdir->path,
#  535|   					destdir->sep, pbuf->path,
#  536|   					strerror(errno));

Error: GCC_ANALYZER_WARNING (CWE-401): [#def81]
xfsprogs-6.17.0/db/rdump.c:540:26: warning[-Wanalyzer-malloc-leak]: leak of ‘cd’
xfsprogs-6.17.0/db/rdump.c:871:1: enter_function: entry to ‘rdump_path’
xfsprogs-6.17.0/db/rdump.c:884:12: branch_false: following ‘false’ branch...
xfsprogs-6.17.0/db/rdump.c:889:16: branch_false: ...to here
xfsprogs-6.17.0/db/rdump.c:890:12: branch_false: following ‘false’ branch (when ‘pbuf’ is non-NULL)...
xfsprogs-6.17.0/db/rdump.c:894:20: branch_false: ...to here
xfsprogs-6.17.0/db/rdump.c:931:15: call_function: calling ‘rdump_file’ from ‘rdump_path’
#  538|   		}
#  539|   
#  540|-> 		cd->fd = openat(destdir->fd, pbuf->path,
#  541|   				O_RDONLY | O_DIRECTORY);
#  542|   		if (cd->fd < 0) {

Error: GCC_ANALYZER_WARNING (CWE-401): [#def82]
xfsprogs-6.17.0/db/rdump.c:540:26: warning[-Wanalyzer-malloc-leak]: leak of ‘pbuf’
xfsprogs-6.17.0/db/rdump.c:871:1: enter_function: entry to ‘rdump_path’
xfsprogs-6.17.0/db/rdump.c:884:12: branch_false: following ‘false’ branch...
xfsprogs-6.17.0/db/rdump.c:889:16: branch_false: ...to here
xfsprogs-6.17.0/db/rdump.c:889:16: acquire_memory: allocated here
xfsprogs-6.17.0/db/rdump.c:890:12: branch_false: following ‘false’ branch (when ‘pbuf’ is non-NULL)...
xfsprogs-6.17.0/db/rdump.c:894:20: branch_false: ...to here
xfsprogs-6.17.0/db/rdump.c:931:15: call_function: calling ‘rdump_file’ from ‘rdump_path’
#  538|   		}
#  539|   
#  540|-> 		cd->fd = openat(destdir->fd, pbuf->path,
#  541|   				O_RDONLY | O_DIRECTORY);
#  542|   		if (cd->fd < 0) {

Error: GCC_ANALYZER_WARNING (CWE-401): [#def83]
xfsprogs-6.17.0/db/rdump.c:543:25: warning[-Wanalyzer-malloc-leak]: leak of ‘cd’
xfsprogs-6.17.0/db/rdump.c:871:1: enter_function: entry to ‘rdump_path’
xfsprogs-6.17.0/db/rdump.c:884:12: branch_false: following ‘false’ branch...
xfsprogs-6.17.0/db/rdump.c:889:16: branch_false: ...to here
xfsprogs-6.17.0/db/rdump.c:890:12: branch_false: following ‘false’ branch (when ‘pbuf’ is non-NULL)...
xfsprogs-6.17.0/db/rdump.c:894:20: branch_false: ...to here
xfsprogs-6.17.0/db/rdump.c:931:15: call_function: calling ‘rdump_file’ from ‘rdump_path’
#  541|   				O_RDONLY | O_DIRECTORY);
#  542|   		if (cd->fd < 0) {
#  543|-> 			dbprintf(_("%s%s%s: %s\n"), destdir->path,
#  544|   					destdir->sep, pbuf->path,
#  545|   					strerror(errno));

Error: GCC_ANALYZER_WARNING (CWE-401): [#def84]
xfsprogs-6.17.0/db/rdump.c:543:25: warning[-Wanalyzer-malloc-leak]: leak of ‘pbuf’
xfsprogs-6.17.0/db/rdump.c:871:1: enter_function: entry to ‘rdump_path’
xfsprogs-6.17.0/db/rdump.c:884:12: branch_false: following ‘false’ branch...
xfsprogs-6.17.0/db/rdump.c:889:16: branch_false: ...to here
xfsprogs-6.17.0/db/rdump.c:889:16: acquire_memory: allocated here
xfsprogs-6.17.0/db/rdump.c:890:12: branch_false: following ‘false’ branch (when ‘pbuf’ is non-NULL)...
xfsprogs-6.17.0/db/rdump.c:894:20: branch_false: ...to here
xfsprogs-6.17.0/db/rdump.c:931:15: call_function: calling ‘rdump_file’ from ‘rdump_path’
#  541|   				O_RDONLY | O_DIRECTORY);
#  542|   		if (cd->fd < 0) {
#  543|-> 			dbprintf(_("%s%s%s: %s\n"), destdir->path,
#  544|   					destdir->sep, pbuf->path,
#  545|   					strerror(errno));

Error: GCC_ANALYZER_WARNING (CWE-401): [#def85]
xfsprogs-6.17.0/db/rdump.c:567:15: warning[-Wanalyzer-malloc-leak]: leak of ‘cd’
xfsprogs-6.17.0/db/rdump.c:871:1: enter_function: entry to ‘rdump_path’
xfsprogs-6.17.0/db/rdump.c:884:12: branch_false: following ‘false’ branch...
xfsprogs-6.17.0/db/rdump.c:889:16: branch_false: ...to here
xfsprogs-6.17.0/db/rdump.c:890:12: branch_false: following ‘false’ branch (when ‘pbuf’ is non-NULL)...
xfsprogs-6.17.0/db/rdump.c:894:20: branch_false: ...to here
xfsprogs-6.17.0/db/rdump.c:931:15: call_function: calling ‘rdump_file’ from ‘rdump_path’
#  565|   	}
#  566|   
#  567|-> 	ret = listdir(tp, dp, rdump_dirent, cd);
#  568|   	if (ret && ret != ECANCELED) {
#  569|   		dbprintf(_("%s%s%s: readdir %s\n"), destdir->path,

Error: GCC_ANALYZER_WARNING (CWE-401): [#def86]
xfsprogs-6.17.0/db/rdump.c:583:24: warning[-Wanalyzer-malloc-leak]: leak of ‘cd’
xfsprogs-6.17.0/db/rdump.c:871:1: enter_function: entry to ‘rdump_path’
xfsprogs-6.17.0/db/rdump.c:884:12: branch_false: following ‘false’ branch...
xfsprogs-6.17.0/db/rdump.c:889:16: branch_false: ...to here
xfsprogs-6.17.0/db/rdump.c:890:12: branch_false: following ‘false’ branch (when ‘pbuf’ is non-NULL)...
xfsprogs-6.17.0/db/rdump.c:894:20: branch_false: ...to here
xfsprogs-6.17.0/db/rdump.c:931:15: call_function: calling ‘rdump_file’ from ‘rdump_path’
#  581|   out_close:
#  582|   	if (cd->fd != destdir->fd) {
#  583|-> 		ret2 = close(cd->fd);
#  584|   		if (ret2) {
#  585|   			if (!ret)

Error: GCC_ANALYZER_WARNING (CWE-401): [#def87]
xfsprogs-6.17.0/db/rdump.c:587:25: warning[-Wanalyzer-malloc-leak]: leak of ‘cd’
xfsprogs-6.17.0/db/rdump.c:871:1: enter_function: entry to ‘rdump_path’
xfsprogs-6.17.0/db/rdump.c:884:12: branch_false: following ‘false’ branch...
xfsprogs-6.17.0/db/rdump.c:889:16: branch_false: ...to here
xfsprogs-6.17.0/db/rdump.c:890:12: branch_false: following ‘false’ branch (when ‘pbuf’ is non-NULL)...
xfsprogs-6.17.0/db/rdump.c:894:20: branch_false: ...to here
xfsprogs-6.17.0/db/rdump.c:931:15: call_function: calling ‘rdump_file’ from ‘rdump_path’
#  585|   			if (!ret)
#  586|   				ret = ret2;
#  587|-> 			dbprintf(_("%s%s%s: %s\n"), destdir->path,
#  588|   					destdir->sep, pbuf->path,
#  589|   					strerror(errno));

Error: GCC_ANALYZER_WARNING (CWE-775): [#def88]
xfsprogs-6.17.0/db/rdump.c:844:16: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘destdir.fd’
xfsprogs-6.17.0/db/rdump.c:938:1: enter_function: entry to ‘rdump_f’
xfsprogs-6.17.0/db/rdump.c:960:12: branch_false: following ‘false’ branch...
xfsprogs-6.17.0/db/rdump.c:967:28: branch_false: ...to here
xfsprogs-6.17.0/db/rdump.c:975:12: branch_false: following ‘false’ branch...
xfsprogs-6.17.0/db/rdump.c:982:26: branch_false: ...to here
xfsprogs-6.17.0/db/rdump.c:986:22: acquire_resource: opened here
xfsprogs-6.17.0/db/rdump.c:987:12: branch_false: following ‘false’ branch...
xfsprogs-6.17.0/db/rdump.c:993:23: branch_false: ...to here
xfsprogs-6.17.0/db/rdump.c:993:12: branch_true: following ‘true’ branch...
xfsprogs-6.17.0/db/rdump.c:995:17: branch_true: ...to here
xfsprogs-6.17.0/db/rdump.c:996:23: call_function: calling ‘rdump_path’ from ‘rdump_f’
#  842|   	int			ret;
#  843|   
#  844|-> 	ret = -libxfs_iget(mp, tp, ino, 0, &ip);
#  845|   	if (ret) {
#  846|   		dbprintf(_("%s: %s\n"), pbuf->path, strerror(ret));

Error: GCC_ANALYZER_WARNING (CWE-401): [#def89]
xfsprogs-6.17.0/db/rdump.c:844:16: warning[-Wanalyzer-malloc-leak]: leak of ‘pbuf’
xfsprogs-6.17.0/db/rdump.c:871:1: enter_function: entry to ‘rdump_path’
xfsprogs-6.17.0/db/rdump.c:884:12: branch_false: following ‘false’ branch...
xfsprogs-6.17.0/db/rdump.c:889:16: branch_false: ...to here
xfsprogs-6.17.0/db/rdump.c:889:16: acquire_memory: allocated here
xfsprogs-6.17.0/db/rdump.c:890:12: branch_false: following ‘false’ branch (when ‘pbuf’ is non-NULL)...
xfsprogs-6.17.0/db/rdump.c:894:20: branch_false: ...to here
xfsprogs-6.17.0/db/rdump.c:931:15: call_function: calling ‘rdump_file’ from ‘rdump_path’
#  842|   	int			ret;
#  843|   
#  844|-> 	ret = -libxfs_iget(mp, tp, ino, 0, &ip);
#  845|   	if (ret) {
#  846|   		dbprintf(_("%s: %s\n"), pbuf->path, strerror(ret));

Error: GCC_ANALYZER_WARNING (CWE-775): [#def90]
xfsprogs-6.17.0/db/rdump.c:846:17: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘destdir.fd’
xfsprogs-6.17.0/db/rdump.c:938:1: enter_function: entry to ‘rdump_f’
xfsprogs-6.17.0/db/rdump.c:960:12: branch_false: following ‘false’ branch...
xfsprogs-6.17.0/db/rdump.c:967:28: branch_false: ...to here
xfsprogs-6.17.0/db/rdump.c:975:12: branch_false: following ‘false’ branch...
xfsprogs-6.17.0/db/rdump.c:982:26: branch_false: ...to here
xfsprogs-6.17.0/db/rdump.c:986:22: acquire_resource: opened here
xfsprogs-6.17.0/db/rdump.c:987:12: branch_false: following ‘false’ branch...
xfsprogs-6.17.0/db/rdump.c:993:23: branch_false: ...to here
xfsprogs-6.17.0/db/rdump.c:993:12: branch_true: following ‘true’ branch...
xfsprogs-6.17.0/db/rdump.c:995:17: branch_true: ...to here
xfsprogs-6.17.0/db/rdump.c:996:23: call_function: calling ‘rdump_path’ from ‘rdump_f’
#  844|   	ret = -libxfs_iget(mp, tp, ino, 0, &ip);
#  845|   	if (ret) {
#  846|-> 		dbprintf(_("%s: %s\n"), pbuf->path, strerror(ret));
#  847|   		return strict_errors ? ret : 0;
#  848|   	}

Error: GCC_ANALYZER_WARNING (CWE-401): [#def91]
xfsprogs-6.17.0/db/rdump.c:846:17: warning[-Wanalyzer-malloc-leak]: leak of ‘pbuf’
xfsprogs-6.17.0/db/rdump.c:871:1: enter_function: entry to ‘rdump_path’
xfsprogs-6.17.0/db/rdump.c:884:12: branch_false: following ‘false’ branch...
xfsprogs-6.17.0/db/rdump.c:889:16: branch_false: ...to here
xfsprogs-6.17.0/db/rdump.c:889:16: acquire_memory: allocated here
xfsprogs-6.17.0/db/rdump.c:890:12: branch_false: following ‘false’ branch (when ‘pbuf’ is non-NULL)...
xfsprogs-6.17.0/db/rdump.c:894:20: branch_false: ...to here
xfsprogs-6.17.0/db/rdump.c:931:15: call_function: calling ‘rdump_file’ from ‘rdump_path’
#  844|   	ret = -libxfs_iget(mp, tp, ino, 0, &ip);
#  845|   	if (ret) {
#  846|-> 		dbprintf(_("%s: %s\n"), pbuf->path, strerror(ret));
#  847|   		return strict_errors ? ret : 0;
#  848|   	}

Error: GCC_ANALYZER_WARNING (CWE-775): [#def92]
xfsprogs-6.17.0/db/rdump.c:891:17: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘destdir.fd’
xfsprogs-6.17.0/db/rdump.c:938:1: enter_function: entry to ‘rdump_f’
xfsprogs-6.17.0/db/rdump.c:960:12: branch_false: following ‘false’ branch...
xfsprogs-6.17.0/db/rdump.c:967:28: branch_false: ...to here
xfsprogs-6.17.0/db/rdump.c:975:12: branch_false: following ‘false’ branch...
xfsprogs-6.17.0/db/rdump.c:982:26: branch_false: ...to here
xfsprogs-6.17.0/db/rdump.c:986:22: acquire_resource: opened here
xfsprogs-6.17.0/db/rdump.c:987:12: branch_false: following ‘false’ branch...
xfsprogs-6.17.0/db/rdump.c:993:23: branch_false: ...to here
xfsprogs-6.17.0/db/rdump.c:993:12: branch_true: following ‘true’ branch...
xfsprogs-6.17.0/db/rdump.c:995:17: branch_true: ...to here
xfsprogs-6.17.0/db/rdump.c:996:23: call_function: calling ‘rdump_path’ from ‘rdump_f’
#  889|   	pbuf = calloc(1, sizeof(struct pathbuf));
#  890|   	if (!pbuf) {
#  891|-> 		dbprintf(_("allocating path buf: %s\n"), strerror(errno));
#  892|   		return 1;
#  893|   	}

Error: GCC_ANALYZER_WARNING (CWE-401): [#def93]
xfsprogs-6.17.0/db/rdump.c:906:23: warning[-Wanalyzer-malloc-leak]: leak of ‘pbuf’
xfsprogs-6.17.0/db/rdump.c:884:12: branch_false: following ‘false’ branch...
xfsprogs-6.17.0/db/rdump.c:889:16: branch_false: ...to here
xfsprogs-6.17.0/db/rdump.c:889:16: acquire_memory: allocated here
xfsprogs-6.17.0/db/rdump.c:890:12: branch_false: following ‘false’ branch (when ‘pbuf’ is non-NULL)...
xfsprogs-6.17.0/db/rdump.c:894:20: branch_false: ...to here
xfsprogs-6.17.0/db/rdump.c:905:12: branch_true: following ‘true’ branch...
xfsprogs-6.17.0/db/rdump.c:906:23: branch_true: ...to here
xfsprogs-6.17.0/db/rdump.c:906:23: throw: if ‘path_walk’ throws an exception...
xfsprogs-6.17.0/db/rdump.c:906:23: danger: ‘pbuf’ leaks here; was allocated at [(3)](sarif:/runs/0/results/26/codeFlows/0/threadFlows/0/locations/2)
#  904|   	/* Dump the inode referenced. */
#  905|   	if (pathlen) {
#  906|-> 		ret = path_walk(mp->m_sb.sb_rootino, path);
#  907|   		if (ret) {
#  908|   			dbprintf(_("%s: %s\n"), path, strerror(ret));

Error: GCC_ANALYZER_WARNING (CWE-401): [#def94]
xfsprogs-6.17.0/db/rdump.c:908:25: warning[-Wanalyzer-malloc-leak]: leak of ‘pbuf’
xfsprogs-6.17.0/db/rdump.c:884:12: branch_false: following ‘false’ branch...
xfsprogs-6.17.0/db/rdump.c:889:16: branch_false: ...to here
xfsprogs-6.17.0/db/rdump.c:889:16: acquire_memory: allocated here
xfsprogs-6.17.0/db/rdump.c:890:12: branch_false: following ‘false’ branch (when ‘pbuf’ is non-NULL)...
xfsprogs-6.17.0/db/rdump.c:894:20: branch_false: ...to here
xfsprogs-6.17.0/db/rdump.c:905:12: branch_true: following ‘true’ branch...
xfsprogs-6.17.0/db/rdump.c:906:23: branch_true: ...to here
xfsprogs-6.17.0/db/rdump.c:907:20: branch_true: following ‘true’ branch...
xfsprogs-6.17.0/db/rdump.c:908:25: branch_true: ...to here
xfsprogs-6.17.0/db/rdump.c:908:25: throw: if ‘dbprintf’ throws an exception...
xfsprogs-6.17.0/db/rdump.c:908:25: danger: ‘pbuf’ leaks here; was allocated at [(3)](sarif:/runs/0/results/27/codeFlows/0/threadFlows/0/locations/2)
#  906|   		ret = path_walk(mp->m_sb.sb_rootino, path);
#  907|   		if (ret) {
#  908|-> 			dbprintf(_("%s: %s\n"), path, strerror(ret));
#  909|   			return 1;
#  910|   		}

Error: GCC_ANALYZER_WARNING (CWE-775): [#def95]
xfsprogs-6.17.0/db/rdump.c:926:17: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘destdir.fd’
xfsprogs-6.17.0/db/rdump.c:938:1: enter_function: entry to ‘rdump_f’
xfsprogs-6.17.0/db/rdump.c:960:12: branch_false: following ‘false’ branch...
xfsprogs-6.17.0/db/rdump.c:967:28: branch_false: ...to here
xfsprogs-6.17.0/db/rdump.c:975:12: branch_false: following ‘false’ branch...
xfsprogs-6.17.0/db/rdump.c:982:26: branch_false: ...to here
xfsprogs-6.17.0/db/rdump.c:986:22: acquire_resource: opened here
xfsprogs-6.17.0/db/rdump.c:987:12: branch_false: following ‘false’ branch...
xfsprogs-6.17.0/db/rdump.c:993:23: branch_false: ...to here
xfsprogs-6.17.0/db/rdump.c:993:12: branch_true: following ‘true’ branch...
xfsprogs-6.17.0/db/rdump.c:995:17: branch_true: ...to here
xfsprogs-6.17.0/db/rdump.c:996:23: call_function: calling ‘rdump_path’ from ‘rdump_f’
#  924|   		}
#  925|   	} else {
#  926|-> 		set_cur_inode(mp->m_sb.sb_rootino);
#  927|   	}
#  928|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def96]
xfsprogs-6.17.0/db/rdump.c:926:17: warning[-Wanalyzer-malloc-leak]: leak of ‘pbuf’
xfsprogs-6.17.0/db/rdump.c:884:12: branch_false: following ‘false’ branch...
xfsprogs-6.17.0/db/rdump.c:889:16: branch_false: ...to here
xfsprogs-6.17.0/db/rdump.c:889:16: acquire_memory: allocated here
xfsprogs-6.17.0/db/rdump.c:890:12: branch_false: following ‘false’ branch (when ‘pbuf’ is non-NULL)...
xfsprogs-6.17.0/db/rdump.c:894:20: branch_false: ...to here
xfsprogs-6.17.0/db/rdump.c:905:12: branch_false: following ‘false’ branch...
xfsprogs-6.17.0/db/rdump.c:926:17: branch_false: ...to here
xfsprogs-6.17.0/db/rdump.c:926:17: throw: if ‘set_cur_inode’ throws an exception...
xfsprogs-6.17.0/db/rdump.c:926:17: danger: ‘pbuf’ leaks here; was allocated at [(3)](sarif:/runs/0/results/29/codeFlows/0/threadFlows/0/locations/2)
#  924|   		}
#  925|   	} else {
#  926|-> 		set_cur_inode(mp->m_sb.sb_rootino);
#  927|   	}
#  928|   

Error: GCC_ANALYZER_WARNING (CWE-775): [#def97]
xfsprogs-6.17.0/db/rdump.c:929:14: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘destdir.fd’
xfsprogs-6.17.0/db/rdump.c:938:1: enter_function: entry to ‘rdump_f’
xfsprogs-6.17.0/db/rdump.c:960:12: branch_false: following ‘false’ branch...
xfsprogs-6.17.0/db/rdump.c:967:28: branch_false: ...to here
xfsprogs-6.17.0/db/rdump.c:975:12: branch_false: following ‘false’ branch...
xfsprogs-6.17.0/db/rdump.c:982:26: branch_false: ...to here
xfsprogs-6.17.0/db/rdump.c:986:22: acquire_resource: opened here
xfsprogs-6.17.0/db/rdump.c:987:12: branch_false: following ‘false’ branch...
xfsprogs-6.17.0/db/rdump.c:993:23: branch_false: ...to here
xfsprogs-6.17.0/db/rdump.c:993:12: branch_true: following ‘true’ branch...
xfsprogs-6.17.0/db/rdump.c:995:17: branch_true: ...to here
xfsprogs-6.17.0/db/rdump.c:996:23: call_function: calling ‘rdump_path’ from ‘rdump_f’
#  927|   	}
#  928|   
#  929|-> 	tp = libxfs_trans_alloc_empty(mp);
#  930|   
#  931|   	ret = rdump_file(tp, iocur_top->ino, destdir, pbuf);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def98]
xfsprogs-6.17.0/db/rdump.c:929:14: warning[-Wanalyzer-malloc-leak]: leak of ‘pbuf’
xfsprogs-6.17.0/db/rdump.c:884:12: branch_false: following ‘false’ branch...
xfsprogs-6.17.0/db/rdump.c:889:16: branch_false: ...to here
xfsprogs-6.17.0/db/rdump.c:889:16: acquire_memory: allocated here
xfsprogs-6.17.0/db/rdump.c:890:12: branch_false: following ‘false’ branch (when ‘pbuf’ is non-NULL)...
xfsprogs-6.17.0/db/rdump.c:894:20: branch_false: ...to here
xfsprogs-6.17.0/db/rdump.c:929:14: throw: if ‘libxfs_trans_alloc_empty’ throws an exception...
xfsprogs-6.17.0/db/rdump.c:929:14: danger: ‘pbuf’ leaks here; was allocated at [(3)](sarif:/runs/0/results/31/codeFlows/0/threadFlows/0/locations/2)
#  927|   	}
#  928|   
#  929|-> 	tp = libxfs_trans_alloc_empty(mp);
#  930|   
#  931|   	ret = rdump_file(tp, iocur_top->ino, destdir, pbuf);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def99]
xfsprogs-6.17.0/db/rdump.c:935:1: warning[-Wanalyzer-malloc-leak]: leak of ‘pbuf’
xfsprogs-6.17.0/db/rdump.c:938:1: enter_function: entry to ‘rdump_f’
xfsprogs-6.17.0/db/rdump.c:960:12: branch_false: following ‘false’ branch...
xfsprogs-6.17.0/db/rdump.c:967:28: branch_false: ...to here
xfsprogs-6.17.0/db/rdump.c:975:12: branch_false: following ‘false’ branch...
xfsprogs-6.17.0/db/rdump.c:982:26: branch_false: ...to here
xfsprogs-6.17.0/db/rdump.c:987:12: branch_false: following ‘false’ branch...
xfsprogs-6.17.0/db/rdump.c:993:23: branch_false: ...to here
xfsprogs-6.17.0/db/rdump.c:993:12: branch_false: following ‘false’ branch...
xfsprogs-6.17.0/db/rdump.c:993:12: branch_false: ...to here
xfsprogs-6.17.0/db/rdump.c:1003:26: branch_true: following ‘true’ branch...
xfsprogs-6.17.0/db/rdump.c:1004:42: branch_true: ...to here
xfsprogs-6.17.0/db/rdump.c:1012:23: call_function: calling ‘rdump_path’ from ‘rdump_f’
#  933|   	free(pbuf);
#  934|   	return ret;
#  935|-> }
#  936|   
#  937|   static int

Error: GCC_ANALYZER_WARNING (CWE-775): [#def100]
xfsprogs-6.17.0/db/rdump.c:995:17: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘destdir.fd’
xfsprogs-6.17.0/db/rdump.c:960:12: branch_false: following ‘false’ branch...
xfsprogs-6.17.0/db/rdump.c:967:28: branch_false: ...to here
xfsprogs-6.17.0/db/rdump.c:975:12: branch_false: following ‘false’ branch...
xfsprogs-6.17.0/db/rdump.c:982:26: branch_false: ...to here
xfsprogs-6.17.0/db/rdump.c:986:22: acquire_resource: opened here
xfsprogs-6.17.0/db/rdump.c:987:12: branch_false: following ‘false’ branch...
xfsprogs-6.17.0/db/rdump.c:993:23: branch_false: ...to here
xfsprogs-6.17.0/db/rdump.c:993:12: branch_true: following ‘true’ branch...
xfsprogs-6.17.0/db/rdump.c:995:17: branch_true: ...to here
xfsprogs-6.17.0/db/rdump.c:995:17: throw: if ‘push_cur’ throws an exception...
xfsprogs-6.17.0/db/rdump.c:995:17: danger: ‘destdir.fd’ leaks here; was opened at [(5)](sarif:/runs/0/results/33/codeFlows/0/threadFlows/0/locations/4)
#  993|   	if (optind == argc - 1) {
#  994|   		/* no dirs given, just do the whole fs */
#  995|-> 		push_cur();
#  996|   		ret = rdump_path(mp, false, "", &destdir);
#  997|   		pop_cur();

Error: GCC_ANALYZER_WARNING (CWE-775): [#def101]
xfsprogs-6.17.0/db/rdump.c:1023:15: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘destdir.fd’
xfsprogs-6.17.0/db/rdump.c:960:12: branch_false: following ‘false’ branch...
xfsprogs-6.17.0/db/rdump.c:967:28: branch_false: ...to here
xfsprogs-6.17.0/db/rdump.c:975:12: branch_false: following ‘false’ branch...
xfsprogs-6.17.0/db/rdump.c:982:26: branch_false: ...to here
xfsprogs-6.17.0/db/rdump.c:986:22: acquire_resource: opened here
xfsprogs-6.17.0/db/rdump.c:987:12: branch_false: following ‘false’ branch...
xfsprogs-6.17.0/db/rdump.c:993:23: branch_false: ...to here
xfsprogs-6.17.0/db/rdump.c:993:12: branch_false: following ‘false’ branch...
xfsprogs-6.17.0/db/rdump.c:993:12: branch_false: ...to here
xfsprogs-6.17.0/db/rdump.c:1003:26: branch_false: following ‘false’ branch...
xfsprogs-6.17.0/db/rdump.c:1022:1: branch_false: ...to here
xfsprogs-6.17.0/db/rdump.c:1023:15: throw: if ‘close’ throws an exception...
xfsprogs-6.17.0/db/rdump.c:1023:15: danger: ‘destdir.fd’ leaks here; was opened at [(5)](sarif:/runs/0/results/34/codeFlows/0/threadFlows/0/locations/4)
# 1021|   
# 1022|   out_close:
# 1023|-> 	ret = close(destdir.fd);
# 1024|   	if (ret) {
# 1025|   		dbprintf(_("%s: %s\n"), destdir.path, strerror(errno));

Error: GCC_ANALYZER_WARNING (CWE-476): [#def102]
xfsprogs-6.17.0/db/write.c:753:48: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘buf’
xfsprogs-6.17.0/db/write.c:738:1: enter_function: entry to ‘write_string’
xfsprogs-6.17.0/db/write.c:746:12: branch_false: following ‘false’ branch (when ‘argc == 1’)...
xfsprogs-6.17.0/db/write.c:751:43: branch_false: ...to here
xfsprogs-6.17.0/db/write.c:751:15: call_function: calling ‘convert_arg’ from ‘write_string’
xfsprogs-6.17.0/db/write.c:751:15: return_function: returning to ‘write_string’ from ‘convert_arg’
xfsprogs-6.17.0/db/write.c:752:21: branch_true: following ‘true’ branch...
xfsprogs-6.17.0/db/write.c:753:26: branch_true: ...to here
xfsprogs-6.17.0/db/write.c:753:48: danger: dereference of NULL ‘buf’
#  751|   	buf = convert_arg(argv[0], (int)((strlen(argv[0])+1)*8));
#  752|   	for (i = 0; i < iocur_top->len; i++) {
#  753|-> 		((char *)iocur_top->data)[i] = *buf;
#  754|   		if (*buf++ == '\0')
#  755|   			break;

Error: GCC_ANALYZER_WARNING (CWE-688): [#def103]
xfsprogs-6.17.0/fsr/xfs_fsr.c:373:29: warning[-Wanalyzer-null-argument]: use of NULL ‘cp’ where non-null expected
xfsprogs-6.17.0/fsr/xfs_fsr.c:348:12: branch_false: following ‘false’ branch...
xfsprogs-6.17.0/fsr/xfs_fsr.c:348:12: branch_false: ...to here
xfsprogs-6.17.0/fsr/xfs_fsr.c:358:12: branch_false: following ‘false’ branch...
xfsprogs-6.17.0/fsr/xfs_fsr.c:358:12: branch_false: ...to here
xfsprogs-6.17.0/fsr/xfs_fsr.c:363:16: branch_true: following ‘true’ branch...
xfsprogs-6.17.0/fsr/xfs_fsr.c:366:28: branch_true: ...to here
xfsprogs-6.17.0/fsr/xfs_fsr.c:373:29: danger: argument 2 (‘cp’) NULL where non-null expected
#  371|   		cp = strtok(mnt->mnt_opts,",");
#  372|   		do {
#  373|-> 			if (strcmp("rw", cp) == 0)
#  374|   				rw++;
#  375|   		} while ((cp = strtok(NULL, ",")) != NULL);

Error: GCC_ANALYZER_WARNING (CWE-457): [#def104]
xfsprogs-6.17.0/fsr/xfs_fsr.c:1210:13: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘cur_nextents’
xfsprogs-6.17.0/fsr/xfs_fsr.c:1180:1: enter_function: entry to ‘packfile’
xfsprogs-6.17.0/fsr/xfs_fsr.c:1208:20: call_function: calling ‘read_fd_bmap’ from ‘packfile’
xfsprogs-6.17.0/fsr/xfs_fsr.c:1208:20: return_function: returning to ‘packfile’ from ‘read_fd_bmap’
xfsprogs-6.17.0/fsr/xfs_fsr.c:1210:13: danger: use of uninitialized value ‘cur_nextents’ here
# 1208|   	nextents = read_fd_bmap(file_fd->fd, statp, &cur_nextents);
# 1209|   
# 1210|-> 	if (cur_nextents == 1 || cur_nextents <= nextents) {
# 1211|   		if (vflag)
# 1212|   			fsrprintf(_("%s already fully defragmented.\n"), fname);

Error: GCC_ANALYZER_WARNING (CWE-404): [#def105]
xfsprogs-6.17.0/fsr/xfs_fsr.c:1707:25: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
xfsprogs-6.17.0/fsr/xfs_fsr.c:1703:9: acquire_resource: ‘va_start’ called here
xfsprogs-6.17.0/fsr/xfs_fsr.c:1704:12: branch_true: following ‘true’ branch...
xfsprogs-6.17.0/fsr/xfs_fsr.c:1706:21: branch_true: ...to here
xfsprogs-6.17.0/fsr/xfs_fsr.c:1706:20: branch_true: following ‘true’ branch...
xfsprogs-6.17.0/fsr/xfs_fsr.c:1707:25: branch_true: ...to here
xfsprogs-6.17.0/fsr/xfs_fsr.c:1707:25: throw: if ‘openlog’ throws an exception...
xfsprogs-6.17.0/fsr/xfs_fsr.c:1707:25: danger: missing call to ‘va_end’ to match ‘va_start’ at [(1)](sarif:/runs/0/results/4/codeFlows/0/threadFlows/0/locations/0)
# 1705|   		static int didopenlog;
# 1706|   		if (!didopenlog) {
# 1707|-> 			openlog("fsr", LOG_PID, LOG_USER);
# 1708|   			didopenlog = 1;
# 1709|   		}

Error: GCC_ANALYZER_WARNING (CWE-404): [#def106]
xfsprogs-6.17.0/fsr/xfs_fsr.c:1710:17: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
xfsprogs-6.17.0/fsr/xfs_fsr.c:1703:9: acquire_resource: ‘va_start’ called here
xfsprogs-6.17.0/fsr/xfs_fsr.c:1704:12: branch_true: following ‘true’ branch...
xfsprogs-6.17.0/fsr/xfs_fsr.c:1706:21: branch_true: ...to here
xfsprogs-6.17.0/fsr/xfs_fsr.c:1710:17: throw: if ‘vsyslog’ throws an exception...
xfsprogs-6.17.0/fsr/xfs_fsr.c:1710:17: danger: missing call to ‘va_end’ to match ‘va_start’ at [(1)](sarif:/runs/0/results/5/codeFlows/0/threadFlows/0/locations/0)
# 1708|   			didopenlog = 1;
# 1709|   		}
# 1710|-> 		vsyslog(LOG_INFO, fmt, ap);
# 1711|   	} else
# 1712|   		vprintf(fmt, ap);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def107]
xfsprogs-6.17.0/io/encrypt.c:785:34: warning[-Wanalyzer-malloc-leak]: leak of ‘arg’
xfsprogs-6.17.0/io/encrypt.c:762:15: acquire_memory: allocated here
xfsprogs-6.17.0/io/encrypt.c:763:12: branch_false: following ‘false’ branch (when ‘arg’ is non-NULL)...
xfsprogs-6.17.0/io/encrypt.c:769:9: branch_false: ...to here
xfsprogs-6.17.0/io/encrypt.c:771:16: branch_true: following ‘true’ branch (when ‘c != -1’)...
xfsprogs-6.17.0/io/encrypt.c:772:17: branch_true: ...to here
xfsprogs-6.17.0/io/encrypt.c:785:34: throw: if ‘command_usage’ throws an exception...
xfsprogs-6.17.0/io/encrypt.c:785:34: danger: ‘arg’ leaks here; was allocated at [(1)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/0)
#  783|   		default:
#  784|   			exitcode = 1;
#  785|-> 			retval = command_usage(&add_enckey_cmd);
#  786|   			goto out;
#  787|   		}

Error: GCC_ANALYZER_WARNING (CWE-401): [#def108]
xfsprogs-6.17.0/io/encrypt.c:794:26: warning[-Wanalyzer-malloc-leak]: leak of ‘arg’
xfsprogs-6.17.0/io/encrypt.c:762:15: acquire_memory: allocated here
xfsprogs-6.17.0/io/encrypt.c:763:12: branch_false: following ‘false’ branch (when ‘arg’ is non-NULL)...
xfsprogs-6.17.0/io/encrypt.c:769:9: branch_false: ...to here
xfsprogs-6.17.0/io/encrypt.c:771:16: branch_false: following ‘false’ branch (when ‘c == -1’)...
xfsprogs-6.17.0/io/encrypt.c:789:14: branch_false: ...to here
xfsprogs-6.17.0/io/encrypt.c:792:12: branch_true: following ‘true’ branch...
xfsprogs-6.17.0/io/encrypt.c:793:17: branch_true: ...to here
xfsprogs-6.17.0/io/encrypt.c:794:26: throw: if ‘command_usage’ throws an exception...
xfsprogs-6.17.0/io/encrypt.c:794:26: danger: ‘arg’ leaks here; was allocated at [(1)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/0)
#  792|   	if (argc != 0) {
#  793|   		exitcode = 1;
#  794|-> 		retval = command_usage(&add_enckey_cmd);
#  795|   		goto out;
#  796|   	}

Error: GCC_ANALYZER_WARNING (CWE-401): [#def109]
xfsprogs-6.17.0/io/exchrange.c:273:19: warning[-Wanalyzer-malloc-leak]: leak of ‘path’
xfsprogs-6.17.0/io/exchrange.c:235:12: branch_false: following ‘false’ branch...
xfsprogs-6.17.0/io/exchrange.c:241:30: branch_false: ...to here
xfsprogs-6.17.0/io/exchrange.c:242:12: branch_false: following ‘false’ branch (when ‘p’ is non-NULL)...
xfsprogs-6.17.0/io/exchrange.c:246:9: branch_false: ...to here
xfsprogs-6.17.0/io/exchrange.c:253:12: branch_false: following ‘false’ branch (when ‘ret == 0’)...
xfsprogs-6.17.0/io/exchrange.c:259:25: branch_false: ...to here
xfsprogs-6.17.0/io/exchrange.c:264:16: acquire_memory: allocated here
xfsprogs-6.17.0/io/exchrange.c:266:12: branch_false: following ‘false’ branch (when ‘d’ is non-NULL)...
xfsprogs-6.17.0/io/exchrange.c:270:9: branch_false: ...to here
xfsprogs-6.17.0/io/exchrange.c:273:19: throw: if ‘openfile’ throws an exception...
xfsprogs-6.17.0/io/exchrange.c:273:19: danger: ‘path’ leaks here; was allocated at [(8)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/7)
#  271|   
#  272|   	/* Open a temporary file to stage the new contents. */
#  273|-> 	temp_fd = openfile(path, &fsgeom, flags, 0600, &fspath);
#  274|   	if (temp_fd < 0) {
#  275|   		perror(path);

Error: GCC_ANALYZER_WARNING (CWE-126): [#def110]
xfsprogs-6.17.0/io/mmap.c:44:33: warning[-Wanalyzer-out-of-bounds]: buffer over-read
xfsprogs-6.17.0/io/mmap.c:44:33: branch_true: following ‘true’ branch...
xfsprogs-6.17.0/io/mmap.c:45:30: branch_true: ...to here
xfsprogs-6.17.0/io/mmap.c:45:17: branch_true: following ‘true’ branch...
xfsprogs-6.17.0/io/mmap.c:45:53: branch_true: ...to here
xfsprogs-6.17.0/io/mmap.c:44:33: branch_true: following ‘true’ branch...
xfsprogs-6.17.0/io/mmap.c:45:30: branch_true: ...to here
xfsprogs-6.17.0/io/mmap.c:45:17: branch_true: following ‘true’ branch...
xfsprogs-6.17.0/io/mmap.c:45:53: branch_true: ...to here
xfsprogs-6.17.0/io/mmap.c:44:33: branch_true: following ‘true’ branch...
xfsprogs-6.17.0/io/mmap.c:45:30: branch_true: ...to here
xfsprogs-6.17.0/io/mmap.c:45:17: branch_true: following ‘true’ branch...
xfsprogs-6.17.0/io/mmap.c:45:53: branch_true: ...to here
xfsprogs-6.17.0/io/mmap.c:44:33: branch_true: following ‘true’ branch...
xfsprogs-6.17.0/io/mmap.c:45:30: branch_true: ...to here
xfsprogs-6.17.0/io/mmap.c:45:17: branch_true: following ‘true’ branch...
xfsprogs-6.17.0/io/mmap.c:45:53: branch_true: ...to here
xfsprogs-6.17.0/io/mmap.c:44:33: danger: out-of-bounds read from byte 32 till byte 35 but ‘pflags’ ends at byte 32
#   42|   	};
#   43|   
#   44|-> 	for (i = 0, p = pflags; p->prot != PROT_NONE; i++, p++)
#   45|   		buffer[i] = (map->prot & p->prot) ? p->mode : '-';
#   46|   

Error: GCC_ANALYZER_WARNING (CWE-476): [#def111]
xfsprogs-6.17.0/io/mmap.c:45:30: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘map’
xfsprogs-6.17.0/io/mmap.c:501:1: enter_function: entry to ‘munmap_f’
xfsprogs-6.17.0/io/mmap.c:508:12: branch_false: following ‘false’ branch...
xfsprogs-6.17.0/io/mmap.c:513:21: branch_false: ...to here
xfsprogs-6.17.0/io/mmap.c:523:12: branch_true: following ‘true’ branch...
xfsprogs-6.17.0/io/mmap.c:524:45: branch_true: ...to here
xfsprogs-6.17.0/io/mmap.c:533:9: call_function: calling ‘maplist_f’ from ‘munmap_f’
#   43|   
#   44|   	for (i = 0, p = pflags; p->prot != PROT_NONE; i++, p++)
#   45|-> 		buffer[i] = (map->prot & p->prot) ? p->mode : '-';
#   46|   
#   47|   #ifdef HAVE_MAP_SYNC

Error: GCC_ANALYZER_WARNING (CWE-126): [#def112]
xfsprogs-6.17.0/io/mmap.c:45:53: warning[-Wanalyzer-out-of-bounds]: buffer over-read
xfsprogs-6.17.0/io/mmap.c:44:33: branch_true: following ‘true’ branch...
xfsprogs-6.17.0/io/mmap.c:45:30: branch_true: ...to here
xfsprogs-6.17.0/io/mmap.c:45:17: branch_true: following ‘true’ branch...
xfsprogs-6.17.0/io/mmap.c:45:53: branch_true: ...to here
xfsprogs-6.17.0/io/mmap.c:44:33: branch_true: following ‘true’ branch...
xfsprogs-6.17.0/io/mmap.c:45:30: branch_true: ...to here
xfsprogs-6.17.0/io/mmap.c:45:17: branch_true: following ‘true’ branch...
xfsprogs-6.17.0/io/mmap.c:45:53: branch_true: ...to here
xfsprogs-6.17.0/io/mmap.c:44:33: branch_true: following ‘true’ branch...
xfsprogs-6.17.0/io/mmap.c:45:30: branch_true: ...to here
xfsprogs-6.17.0/io/mmap.c:45:17: branch_true: following ‘true’ branch...
xfsprogs-6.17.0/io/mmap.c:45:53: branch_true: ...to here
xfsprogs-6.17.0/io/mmap.c:44:33: branch_true: following ‘true’ branch...
xfsprogs-6.17.0/io/mmap.c:45:30: branch_true: ...to here
xfsprogs-6.17.0/io/mmap.c:45:17: branch_true: following ‘true’ branch...
xfsprogs-6.17.0/io/mmap.c:45:53: branch_true: ...to here
xfsprogs-6.17.0/io/mmap.c:44:33: branch_true: following ‘true’ branch...
xfsprogs-6.17.0/io/mmap.c:45:30: branch_true: ...to here
xfsprogs-6.17.0/io/mmap.c:45:17: branch_true: following ‘true’ branch...
xfsprogs-6.17.0/io/mmap.c:45:53: branch_true: ...to here
xfsprogs-6.17.0/io/mmap.c:45:53: danger: out-of-bounds read from byte 36 till byte 39 but ‘pflags’ ends at byte 32
#   43|   
#   44|   	for (i = 0, p = pflags; p->prot != PROT_NONE; i++, p++)
#   45|-> 		buffer[i] = (map->prot & p->prot) ? p->mode : '-';
#   46|   
#   47|   #ifdef HAVE_MAP_SYNC

Error: GCC_ANALYZER_WARNING (CWE-476): [#def113]
xfsprogs-6.17.0/io/mmap.c:48:14: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘map’
xfsprogs-6.17.0/io/mmap.c:501:1: enter_function: entry to ‘munmap_f’
xfsprogs-6.17.0/io/mmap.c:508:12: branch_false: following ‘false’ branch...
xfsprogs-6.17.0/io/mmap.c:513:21: branch_false: ...to here
xfsprogs-6.17.0/io/mmap.c:523:12: branch_true: following ‘true’ branch...
xfsprogs-6.17.0/io/mmap.c:524:45: branch_true: ...to here
xfsprogs-6.17.0/io/mmap.c:533:9: call_function: calling ‘maplist_f’ from ‘munmap_f’
#   46|   
#   47|   #ifdef HAVE_MAP_SYNC
#   48|-> 	if ((map->flags & (MAP_SYNC | MAP_SHARED_VALIDATE)) ==
#   49|   			  (MAP_SYNC | MAP_SHARED_VALIDATE))
#   50|   		sprintf(&buffer[i], " S");

Error: GCC_ANALYZER_WARNING (CWE-401): [#def114]
xfsprogs-6.17.0/io/mmap.c:259:17: warning[-Wanalyzer-malloc-leak]: leak of ‘filename’
xfsprogs-6.17.0/io/mmap.c:164:12: branch_false: following ‘false’ branch (when ‘argc != 1’)...
xfsprogs-6.17.0/io/mmap.c:172:19: branch_false: ...to here
xfsprogs-6.17.0/io/mmap.c:172:19: branch_false: following ‘false’ branch (when ‘argc != 2’)...
xfsprogs-6.17.0/io/mmap.c:180:20: branch_false: ...to here
xfsprogs-6.17.0/io/mmap.c:180:19: branch_false: following ‘false’ branch...
xfsprogs-6.17.0/io/mmap.c:186:9: branch_false: ...to here
xfsprogs-6.17.0/io/mmap.c:219:12: branch_false: following ‘false’ branch...
xfsprogs-6.17.0/io/mmap.c:224:50: branch_false: ...to here
xfsprogs-6.17.0/io/mmap.c:225:12: branch_false: following ‘false’ branch...
xfsprogs-6.17.0/io/mmap.c:230:9: branch_false: ...to here
xfsprogs-6.17.0/io/mmap.c:232:12: branch_false: following ‘false’ branch...
xfsprogs-6.17.0/io/mmap.c:238:31: branch_false: ...to here
xfsprogs-6.17.0/io/mmap.c:238:20: acquire_memory: allocated here
xfsprogs-6.17.0/io/mmap.c:239:12: branch_false: following ‘false’ branch (when ‘filename’ is non-NULL)...
xfsprogs-6.17.0/io/mmap.c:252:12: branch_false: ...to here
xfsprogs-6.17.0/io/mmap.c:258:12: branch_true: following ‘true’ branch (when ‘address == 18446744073709551615’)...
xfsprogs-6.17.0/io/mmap.c:259:17: branch_true: ...to here
xfsprogs-6.17.0/io/mmap.c:259:17: throw: if ‘perror’ throws an exception...
xfsprogs-6.17.0/io/mmap.c:259:17: danger: ‘filename’ leaks here; was allocated at [(13)](sarif:/runs/0/results/10/codeFlows/0/threadFlows/0/locations/12)
#  257|   	address = mmap(address, length, prot, flags, file->fd, offset);
#  258|   	if (address == MAP_FAILED) {
#  259|-> 		perror("mmap");
#  260|   		free(filename);
#  261|   		exitcode = 1;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def115]
xfsprogs-6.17.0/io/mmap.c:269:17: warning[-Wanalyzer-malloc-leak]: leak of ‘filename’
xfsprogs-6.17.0/io/mmap.c:164:12: branch_false: following ‘false’ branch (when ‘argc != 1’)...
xfsprogs-6.17.0/io/mmap.c:172:19: branch_false: ...to here
xfsprogs-6.17.0/io/mmap.c:172:19: branch_false: following ‘false’ branch (when ‘argc != 2’)...
xfsprogs-6.17.0/io/mmap.c:180:20: branch_false: ...to here
xfsprogs-6.17.0/io/mmap.c:180:19: branch_false: following ‘false’ branch...
xfsprogs-6.17.0/io/mmap.c:186:9: branch_false: ...to here
xfsprogs-6.17.0/io/mmap.c:219:12: branch_false: following ‘false’ branch...
xfsprogs-6.17.0/io/mmap.c:224:50: branch_false: ...to here
xfsprogs-6.17.0/io/mmap.c:225:12: branch_false: following ‘false’ branch...
xfsprogs-6.17.0/io/mmap.c:230:9: branch_false: ...to here
xfsprogs-6.17.0/io/mmap.c:232:12: branch_false: following ‘false’ branch...
xfsprogs-6.17.0/io/mmap.c:238:31: branch_false: ...to here
xfsprogs-6.17.0/io/mmap.c:238:20: acquire_memory: allocated here
xfsprogs-6.17.0/io/mmap.c:239:12: branch_false: following ‘false’ branch (when ‘filename’ is non-NULL)...
xfsprogs-6.17.0/io/mmap.c:252:12: branch_false: ...to here
xfsprogs-6.17.0/io/mmap.c:258:12: branch_false: following ‘false’ branch (when ‘address != 18446744073709551615’)...
xfsprogs-6.17.0/io/mmap.c:267:41: branch_false: ...to here
xfsprogs-6.17.0/io/mmap.c:268:12: branch_true: following ‘true’ branch...
xfsprogs-6.17.0/io/mmap.c:269:17: branch_true: ...to here
xfsprogs-6.17.0/io/mmap.c:269:17: throw: if ‘perror’ throws an exception...
xfsprogs-6.17.0/io/mmap.c:269:17: danger: ‘filename’ leaks here; was allocated at [(13)](sarif:/runs/0/results/11/codeFlows/0/threadFlows/0/locations/12)
#  267|   					++mapcount * sizeof(mmap_region_t));
#  268|   	if (!maptable) {
#  269|-> 		perror("realloc");
#  270|   		mapcount = 0;
#  271|   		munmap(address, length);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def116]
xfsprogs-6.17.0/io/open.c:185:17: warning[-Wanalyzer-malloc-leak]: leak of ‘filename’
xfsprogs-6.17.0/io/open.c:174:20: acquire_memory: allocated here
xfsprogs-6.17.0/io/open.c:175:12: branch_false: following ‘false’ branch (when ‘filename’ is non-NULL)...
xfsprogs-6.17.0/io/open.c:183:41: branch_false: ...to here
xfsprogs-6.17.0/io/open.c:184:12: branch_true: following ‘true’ branch...
xfsprogs-6.17.0/io/open.c:185:17: branch_true: ...to here
xfsprogs-6.17.0/io/open.c:185:17: throw: if ‘perror’ throws an exception...
xfsprogs-6.17.0/io/open.c:185:17: danger: ‘filename’ leaks here; was allocated at [(1)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/0)
#  183|   					++filecount * sizeof(fileio_t));
#  184|   	if (!filetable) {
#  185|-> 		perror("realloc");
#  186|   		filecount = 0;
#  187|   		free(filename);

Error: GCC_ANALYZER_WARNING (CWE-775): [#def117]
xfsprogs-6.17.0/io/open.c:426:21: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘open(path, 0)’
xfsprogs-6.17.0/io/open.c:421:19: acquire_resource: opened here
xfsprogs-6.17.0/io/open.c:421:12: branch_false: following ‘false’ branch...
xfsprogs-6.17.0/io/open.c:426:21: branch_false: ...to here
xfsprogs-6.17.0/io/open.c:426:21: throw: if ‘getprojid’ throws an exception...
xfsprogs-6.17.0/io/open.c:426:21: danger: ‘open(path, 0)’ leaks here; was opened at [(1)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/0)
#  424|   		exitcode = 1;
#  425|   	} else {
#  426|-> 		if (getprojid(path, fd, &projid) == 0)
#  427|   			printf("[%u] %s\n", (unsigned int)projid, path);
#  428|   		else

Error: GCC_ANALYZER_WARNING (CWE-775): [#def118]
xfsprogs-6.17.0/io/open.c:503:21: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘open(path, 0)’
xfsprogs-6.17.0/io/open.c:498:19: acquire_resource: opened here
xfsprogs-6.17.0/io/open.c:498:12: branch_false: following ‘false’ branch...
xfsprogs-6.17.0/io/open.c:503:21: branch_false: ...to here
xfsprogs-6.17.0/io/open.c:503:21: throw: if ‘setprojid’ throws an exception...
xfsprogs-6.17.0/io/open.c:503:21: danger: ‘open(path, 0)’ leaks here; was opened at [(1)](sarif:/runs/0/results/2/codeFlows/0/threadFlows/0/locations/0)
#  501|   		exitcode = 1;
#  502|   	} else {
#  503|-> 		if (setprojid(path, fd, prid) < 0) {
#  504|   			perror("setprojid");
#  505|   			exitcode = 1;

Error: GCC_ANALYZER_WARNING (CWE-775): [#def119]
xfsprogs-6.17.0/io/readdir.c:165:15: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘dfd’
xfsprogs-6.17.0/io/readdir.c:142:16: branch_false: following ‘false’ branch (when ‘c == -1’)...
xfsprogs-6.17.0/io/readdir.c:159:23: branch_false: ...to here
xfsprogs-6.17.0/io/readdir.c:159:15: acquire_resource: opened here
xfsprogs-6.17.0/io/readdir.c:160:12: branch_false: following ‘false’ branch (when ‘dfd >= 0’)...
xfsprogs-6.17.0/io/readdir.c:165:15: branch_false: ...to here
xfsprogs-6.17.0/io/readdir.c:165:15: throw: if ‘fdopendir’ throws an exception...
xfsprogs-6.17.0/io/readdir.c:165:15: danger: ‘dfd’ leaks here; was opened at [(3)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/2)
#  163|   	}
#  164|   
#  165|-> 	dir = fdopendir(dfd);
#  166|   	if (!dir) {
#  167|   		close(dfd);

Error: GCC_ANALYZER_WARNING (CWE-476): [#def120]
xfsprogs-6.17.0/io/scrub.c:494:17: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’
xfsprogs-6.17.0/io/scrub.c:479:1: enter_function: entry to ‘scrubv_fill_group’
xfsprogs-6.17.0/io/scrub.c:489:42: branch_true: following ‘true’ branch (when ‘i != 33’)...
xfsprogs-6.17.0/io/scrub.c:490:21: branch_true: ...to here
xfsprogs-6.17.0/io/scrub.c:493:21: call_function: inlined call to ‘xfrog_scrubv_next_vector’ from ‘scrubv_fill_group’
xfsprogs-6.17.0/io/scrub.c:494:17: branch_true: ...to here
xfsprogs-6.17.0/io/scrub.c:494:17: danger: dereference of NULL ‘<unknown>’
#  492|   
#  493|   		v = xfrog_scrubv_next_vector(scrubv);
#  494|-> 		v->sv_type = i;
#  495|   
#  496|   		if (barrier_interval &&

Error: GCC_ANALYZER_WARNING (CWE-476): [#def121]
xfsprogs-6.17.0/io/scrub.c:499:25: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’
xfsprogs-6.17.0/io/scrub.c:479:1: enter_function: entry to ‘scrubv_fill_group’
xfsprogs-6.17.0/io/scrub.c:489:42: branch_true: following ‘true’ branch (when ‘i != 33’)...
xfsprogs-6.17.0/io/scrub.c:490:21: branch_true: ...to here
xfsprogs-6.17.0/io/scrub.c:493:21: call_function: inlined call to ‘xfrog_scrubv_next_vector’ from ‘scrubv_fill_group’
xfsprogs-6.17.0/io/scrub.c:496:20: branch_true: following ‘true’ branch (when ‘barrier_interval != 0’)...
xfsprogs-6.17.0/io/scrub.c:497:21: branch_true: ...to here
xfsprogs-6.17.0/io/scrub.c:496:21: branch_true: following ‘true’ branch...
xfsprogs-6.17.0/io/scrub.c:498:29: call_function: inlined call to ‘xfrog_scrubv_next_vector’ from ‘scrubv_fill_group’
xfsprogs-6.17.0/io/scrub.c:499:25: branch_true: ...to here
xfsprogs-6.17.0/io/scrub.c:499:25: danger: dereference of NULL ‘<unknown>’
#  497|   		    scrubv->head.svh_nr % (barrier_interval + 1) == 0) {
#  498|   			v = xfrog_scrubv_next_vector(scrubv);
#  499|-> 			v->sv_flags = barrier_mask;
#  500|   			v->sv_type = XFS_SCRUB_TYPE_BARRIER;
#  501|   		}

Error: GCC_ANALYZER_WARNING (CWE-401): [#def122]
xfsprogs-6.17.0/libfrog/bitmap.c:154:44: warning[-Wanalyzer-malloc-leak]: leak of 'bitmap_node_init(start,  length)'
xfsprogs-6.17.0/libfrog/bitmap.c:142:1: enter_function: entry to '__bitmap_insert'
xfsprogs-6.17.0/libfrog/bitmap.c:150:15: call_function: calling 'bitmap_node_init' from '__bitmap_insert'
xfsprogs-6.17.0/libfrog/bitmap.c:150:15: return_function: returning to '__bitmap_insert' from 'bitmap_node_init'
xfsprogs-6.17.0/libfrog/bitmap.c:151:12: branch_false: following 'false' branch...
xfsprogs-6.17.0/libfrog/bitmap.c:154:44: branch_false: ...to here
xfsprogs-6.17.0/libfrog/bitmap.c:154:16: throw: if 'avl64_insert' throws an exception...
xfsprogs-6.17.0/libfrog/bitmap.c:154:44: danger: 'bitmap_node_init(start,  length)' leaks here; was allocated at [(4)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/3)
#  152|   		return -errno;
#  153|   
#  154|-> 	node = avl64_insert(bmap->bt_tree, &ext->btn_node);
#  155|   	if (node == NULL) {
#  156|   		free(ext);

Error: GCC_ANALYZER_WARNING (CWE-476): [#def123]
xfsprogs-6.17.0/libfrog/bitmap.c:195:21: warning[-Wanalyzer-null-dereference]: dereference of NULL 'pos'
xfsprogs-6.17.0/libfrog/bitmap.c:187:9: branch_true: following 'true' branch...
xfsprogs-6.17.0/libfrog/bitmap.c:191:9: branch_true: following 'true' branch (when 'pos != l')...
xfsprogs-6.17.0/libfrog/bitmap.c:195:21: branch_true: ...to here
xfsprogs-6.17.0/libfrog/bitmap.c:191:9: branch_true: following 'true' branch (when 'pos != l')...
xfsprogs-6.17.0/libfrog/bitmap.c:195:21: branch_true: ...to here
xfsprogs-6.17.0/libfrog/bitmap.c:195:21: danger: dereference of NULL 'pos'
#  193|   
#  194|   		/* Bail if the new extent is contained within an old one. */
#  195|-> 		if (ext->btn_start <= start &&
#  196|   		    ext->btn_start + ext->btn_length >= start + length)
#  197|   			return 0;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def124]
xfsprogs-6.17.0/libfrog/bitmap.c:271:21: warning[-Wanalyzer-null-dereference]: dereference of NULL 'pos'
xfsprogs-6.17.0/libfrog/bitmap.c:264:9: branch_true: following 'true' branch...
xfsprogs-6.17.0/libfrog/bitmap.c:267:9: branch_true: following 'true' branch (when 'pos != l')...
xfsprogs-6.17.0/libfrog/bitmap.c:271:21: branch_true: ...to here
xfsprogs-6.17.0/libfrog/bitmap.c:267:9: branch_true: following 'true' branch (when 'pos != l')...
xfsprogs-6.17.0/libfrog/bitmap.c:271:21: branch_true: ...to here
xfsprogs-6.17.0/libfrog/bitmap.c:271:21: danger: dereference of NULL 'pos'
#  269|   
#  270|   		stat = 0;
#  271|-> 		if (ext->btn_start < start)
#  272|   			stat |= 1;
#  273|   		if (ext->btn_start + ext->btn_length > start + len)

Error: GCC_ANALYZER_WARNING (CWE-401): [#def125]
xfsprogs-6.17.0/libfrog/bitmap.c:304:60: warning[-Wanalyzer-malloc-leak]: leak of 'bitmap_node_init(start + len,  new_length)'
xfsprogs-6.17.0/libfrog/bitmap.c:238:1: enter_function: entry to '__bitmap_clear'
xfsprogs-6.17.0/libfrog/bitmap.c:264:9: branch_true: following 'true' branch...
xfsprogs-6.17.0/libfrog/bitmap.c:267:9: branch_true: following 'true' branch (when 'pos != l')...
xfsprogs-6.17.0/libfrog/bitmap.c:271:21: branch_true: ...to here
xfsprogs-6.17.0/libfrog/bitmap.c:271:20: branch_true: following 'true' branch...
xfsprogs-6.17.0/libfrog/bitmap.c:271:20: branch_true: ...to here
xfsprogs-6.17.0/libfrog/bitmap.c:273:20: branch_true: following 'true' branch...
xfsprogs-6.17.0/libfrog/bitmap.c:274:25: branch_true: ...to here
xfsprogs-6.17.0/libfrog/bitmap.c:298:31: call_function: calling 'bitmap_node_init' from '__bitmap_clear'
xfsprogs-6.17.0/libfrog/bitmap.c:298:31: return_function: returning to '__bitmap_clear' from 'bitmap_node_init'
xfsprogs-6.17.0/libfrog/bitmap.c:299:28: branch_false: following 'false' branch...
xfsprogs-6.17.0/libfrog/bitmap.c:304:60: branch_false: ...to here
xfsprogs-6.17.0/libfrog/bitmap.c:304:60: danger: 'bitmap_node_init(start + len,  new_length)' leaks here; was allocated at [(14)](sarif:/runs/0/results/3/codeFlows/0/threadFlows/0/locations/13)
#  302|   			}
#  303|   
#  304|-> 			node = avl64_insert(bmap->bt_tree, &ext->btn_node);
#  305|   			if (node == NULL) {
#  306|   				ret = -EEXIST;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def126]
xfsprogs-6.17.0/libfrog/bitmap.c:383:23: warning[-Wanalyzer-null-dereference]: dereference of NULL 'pos'
xfsprogs-6.17.0/libfrog/bitmap.c:381:9: branch_true: following 'true' branch (when 'pos != l')...
xfsprogs-6.17.0/libfrog/bitmap.c:383:23: branch_true: ...to here
xfsprogs-6.17.0/libfrog/bitmap.c:384:20: branch_false: following 'false' branch...
xfsprogs-6.17.0/libfrog/bitmap.c:381:9: branch_false: ...to here
xfsprogs-6.17.0/libfrog/bitmap.c:381:9: branch_true: following 'true' branch (when 'pos != l')...
xfsprogs-6.17.0/libfrog/bitmap.c:383:23: branch_true: ...to here
xfsprogs-6.17.0/libfrog/bitmap.c:383:23: danger: dereference of NULL 'pos'
#  381|   	avl_for_each_range_safe(pos, n, l, firstn, lastn) {
#  382|   		ext = container_of(pos, struct bitmap_node, btn_node);
#  383|-> 		ret = fn(ext->btn_start, ext->btn_length, arg);
#  384|   		if (ret)
#  385|   			break;

Error: GCC_ANALYZER_WARNING (CWE-416): [#def127]
xfsprogs-6.17.0/libfrog/bitmask.h:25:9: warning[-Wanalyzer-use-after-free]: use after 'free' of 'lip'
xfsprogs-6.17.0/libxfs/trans.c:1236:1: enter_function: entry to 'libxfs_trans_alloc_dir'
xfsprogs-6.17.0/libxfs/trans.c:1250:17: call_function: calling 'libxfs_trans_alloc' from 'libxfs_trans_alloc_dir'
#   23|   	unsigned long *p = ((unsigned long *)addr) + BIT_WORD(nr);
#   24|   
#   25|-> 	*p &= ~mask;
#   26|   }
#   27|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def128]
xfsprogs-6.17.0/libfrog/fakelibattr.h:32:16: warning[-Wanalyzer-malloc-leak]: leak of 'attrlist'
xfsprogs-6.17.0/libfrog/fsprops.c:65:1: enter_function: entry to 'fsprops_walk_names'
xfsprogs-6.17.0/libfrog/fsprops.c:74:20: acquire_memory: allocated here
xfsprogs-6.17.0/libfrog/fsprops.c:75:12: branch_false: following 'false' branch (when 'attrlist' is non-NULL)...
xfsprogs-6.17.0/libfrog/fsprops.c:75:12: branch_false: ...to here
xfsprogs-6.17.0/libfrog/fsprops.c:78:23: call_function: inlined call to 'libfrog_attr_list_by_handle' from 'fsprops_walk_names'
#   30|   	struct xfs_attrlist_cursor	*cursor)
#   31|   {
#   32|-> 	return attr_list_by_handle(hanp, hlen, buf, bufsize, flags,
#   33|   			(struct attrlist_cursor *)cursor);
#   34|   }

Error: GCC_ANALYZER_WARNING (CWE-401): [#def129]
xfsprogs-6.17.0/libfrog/fakelibattr.h:32:16: warning[-Wanalyzer-malloc-leak]: leak of ‘attrlist’
xfsprogs-6.17.0/scrub/phase5.c:184:1: enter_function: entry to ‘check_xattr_ns_names’
xfsprogs-6.17.0/scrub/phase5.c:198:20: acquire_memory: allocated here
xfsprogs-6.17.0/scrub/phase5.c:199:12: branch_false: following ‘false’ branch (when ‘attrlist’ is non-NULL)...
xfsprogs-6.17.0/scrub/phase5.c:205:18: branch_false: ...to here
xfsprogs-6.17.0/scrub/phase5.c:206:12: branch_false: following ‘false’ branch (when ‘keybuf’ is non-NULL)...
xfsprogs-6.17.0/scrub/phase5.c:212:17: branch_false: ...to here
xfsprogs-6.17.0/scrub/phase5.c:213:12: branch_false: following ‘false’ branch...
xfsprogs-6.17.0/scrub/phase5.c:213:12: branch_false: ...to here
xfsprogs-6.17.0/scrub/phase5.c:218:25: call_function: inlined call to ‘libfrog_attr_list_by_handle’ from ‘check_xattr_ns_names’
#   30|   	struct xfs_attrlist_cursor	*cursor)
#   31|   {
#   32|-> 	return attr_list_by_handle(hanp, hlen, buf, bufsize, flags,
#   33|   			(struct attrlist_cursor *)cursor);
#   34|   }

Error: GCC_ANALYZER_WARNING (CWE-401): [#def130]
xfsprogs-6.17.0/libfrog/fakelibattr.h:32:16: warning[-Wanalyzer-malloc-leak]: leak of ‘keybuf’
xfsprogs-6.17.0/scrub/phase5.c:184:1: enter_function: entry to ‘check_xattr_ns_names’
xfsprogs-6.17.0/scrub/phase5.c:199:12: branch_false: following ‘false’ branch (when ‘attrlist’ is non-NULL)...
xfsprogs-6.17.0/scrub/phase5.c:205:18: branch_false: ...to here
xfsprogs-6.17.0/scrub/phase5.c:205:18: acquire_memory: allocated here
xfsprogs-6.17.0/scrub/phase5.c:206:12: branch_false: following ‘false’ branch (when ‘keybuf’ is non-NULL)...
xfsprogs-6.17.0/scrub/phase5.c:212:17: branch_false: ...to here
xfsprogs-6.17.0/scrub/phase5.c:213:12: branch_false: following ‘false’ branch...
xfsprogs-6.17.0/scrub/phase5.c:213:12: branch_false: ...to here
xfsprogs-6.17.0/scrub/phase5.c:218:25: call_function: inlined call to ‘libfrog_attr_list_by_handle’ from ‘check_xattr_ns_names’
#   30|   	struct xfs_attrlist_cursor	*cursor)
#   31|   {
#   32|-> 	return attr_list_by_handle(hanp, hlen, buf, bufsize, flags,
#   33|   			(struct attrlist_cursor *)cursor);
#   34|   }

Error: GCC_ANALYZER_WARNING (CWE-122): [#def131]
xfsprogs-6.17.0/libfrog/histogram.c:137:9: warning[-Wanalyzer-out-of-bounds]: heap-based buffer overflow
xfsprogs-6.17.0/libfrog/histogram.c:119:9: branch_true: following 'true' branch...
xfsprogs-6.17.0/libfrog/histogram.c:121:15: branch_true: ...to here
xfsprogs-6.17.0/libfrog/histogram.c:122:12: branch_false: following 'false' branch (when 'cdf' is non-NULL)...
xfsprogs-6.17.0/libfrog/histogram.c:124:9: branch_false: ...to here
xfsprogs-6.17.0/libfrog/histogram.c:126:12: branch_false: following 'false' branch...
xfsprogs-6.17.0/libfrog/histogram.c:131:24: branch_false: ...to here
xfsprogs-6.17.0/libfrog/histogram.c:132:12: branch_false: following 'false' branch...
xfsprogs-6.17.0/libfrog/histogram.c:137:34: branch_false: ...to here
xfsprogs-6.17.0/libfrog/histogram.c:137:9: danger: write of 8 bytes at offset '(long unsigned int)(*hs.nr_buckets + 4294967295) * 32 + 16' exceeds the buffer
#  135|   	}
#  136|   
#  137|-> 	cdf->buckets[i].nr_obs = hs->buckets[i].nr_obs;
#  138|   	cdf->buckets[i].sum = hs->buckets[i].sum;
#  139|   	i--;

Error: GCC_ANALYZER_WARNING (CWE-122): [#def132]
xfsprogs-6.17.0/libfrog/histogram.c:138:9: warning[-Wanalyzer-out-of-bounds]: heap-based buffer overflow
xfsprogs-6.17.0/libfrog/histogram.c:119:9: branch_true: following 'true' branch...
xfsprogs-6.17.0/libfrog/histogram.c:121:15: branch_true: ...to here
xfsprogs-6.17.0/libfrog/histogram.c:122:12: branch_false: following 'false' branch (when 'cdf' is non-NULL)...
xfsprogs-6.17.0/libfrog/histogram.c:124:9: branch_false: ...to here
xfsprogs-6.17.0/libfrog/histogram.c:126:12: branch_false: following 'false' branch...
xfsprogs-6.17.0/libfrog/histogram.c:131:24: branch_false: ...to here
xfsprogs-6.17.0/libfrog/histogram.c:132:12: branch_false: following 'false' branch...
xfsprogs-6.17.0/libfrog/histogram.c:137:34: branch_false: ...to here
xfsprogs-6.17.0/libfrog/histogram.c:138:9: danger: write of 8 bytes at offset '(long unsigned int)(*hs.nr_buckets + 4294967295) * 32 + 24' exceeds the buffer
#  136|   
#  137|   	cdf->buckets[i].nr_obs = hs->buckets[i].nr_obs;
#  138|-> 	cdf->buckets[i].sum = hs->buckets[i].sum;
#  139|   	i--;
#  140|   

Error: GCC_ANALYZER_WARNING (CWE-122): [#def133]
xfsprogs-6.17.0/libfrog/histogram.c:142:17: warning[-Wanalyzer-out-of-bounds]: heap-based buffer overflow
xfsprogs-6.17.0/libfrog/histogram.c:119:9: branch_true: following 'true' branch...
xfsprogs-6.17.0/libfrog/histogram.c:121:15: branch_true: ...to here
xfsprogs-6.17.0/libfrog/histogram.c:122:12: branch_false: following 'false' branch (when 'cdf' is non-NULL)...
xfsprogs-6.17.0/libfrog/histogram.c:124:9: branch_false: ...to here
xfsprogs-6.17.0/libfrog/histogram.c:126:12: branch_false: following 'false' branch...
xfsprogs-6.17.0/libfrog/histogram.c:131:24: branch_false: ...to here
xfsprogs-6.17.0/libfrog/histogram.c:132:12: branch_false: following 'false' branch...
xfsprogs-6.17.0/libfrog/histogram.c:137:34: branch_false: ...to here
xfsprogs-6.17.0/libfrog/histogram.c:141:16: branch_true: following 'true' branch (when 'i != -1')...
xfsprogs-6.17.0/libfrog/histogram.c:142:42: branch_true: ...to here
xfsprogs-6.17.0/libfrog/histogram.c:142:17: danger: write of 8 bytes at offset '(long unsigned int)(int)(*hs.nr_buckets + 4294967294) * 32 + 16' exceeds the buffer
#  140|   
#  141|   	while (i >= 0) {
#  142|-> 		cdf->buckets[i].nr_obs = hs->buckets[i].nr_obs +
#  143|   					cdf->buckets[i + 1].nr_obs;
#  144|   

Error: GCC_ANALYZER_WARNING (CWE-122): [#def134]
xfsprogs-6.17.0/libfrog/histogram.c:143:41: warning[-Wanalyzer-out-of-bounds]: heap-based buffer over-read
xfsprogs-6.17.0/libfrog/histogram.c:119:9: branch_true: following 'true' branch...
xfsprogs-6.17.0/libfrog/histogram.c:121:15: branch_true: ...to here
xfsprogs-6.17.0/libfrog/histogram.c:122:12: branch_false: following 'false' branch (when 'cdf' is non-NULL)...
xfsprogs-6.17.0/libfrog/histogram.c:124:9: branch_false: ...to here
xfsprogs-6.17.0/libfrog/histogram.c:126:12: branch_false: following 'false' branch...
xfsprogs-6.17.0/libfrog/histogram.c:131:24: branch_false: ...to here
xfsprogs-6.17.0/libfrog/histogram.c:132:12: branch_false: following 'false' branch...
xfsprogs-6.17.0/libfrog/histogram.c:137:34: branch_false: ...to here
xfsprogs-6.17.0/libfrog/histogram.c:141:16: branch_true: following 'true' branch (when 'i != -1')...
xfsprogs-6.17.0/libfrog/histogram.c:142:42: branch_true: ...to here
xfsprogs-6.17.0/libfrog/histogram.c:143:41: danger: read of 8 bytes at offset '(long unsigned int)(int)(*hs.nr_buckets + 4294967294) * 32 + 48' exceeds the buffer
#  141|   	while (i >= 0) {
#  142|   		cdf->buckets[i].nr_obs = hs->buckets[i].nr_obs +
#  143|-> 					cdf->buckets[i + 1].nr_obs;
#  144|   
#  145|   		cdf->buckets[i].sum =    hs->buckets[i].sum +

Error: GCC_ANALYZER_WARNING (CWE-122): [#def135]
xfsprogs-6.17.0/libfrog/histogram.c:145:17: warning[-Wanalyzer-out-of-bounds]: heap-based buffer overflow
xfsprogs-6.17.0/libfrog/histogram.c:119:9: branch_true: following 'true' branch...
xfsprogs-6.17.0/libfrog/histogram.c:121:15: branch_true: ...to here
xfsprogs-6.17.0/libfrog/histogram.c:122:12: branch_false: following 'false' branch (when 'cdf' is non-NULL)...
xfsprogs-6.17.0/libfrog/histogram.c:124:9: branch_false: ...to here
xfsprogs-6.17.0/libfrog/histogram.c:126:12: branch_false: following 'false' branch...
xfsprogs-6.17.0/libfrog/histogram.c:131:24: branch_false: ...to here
xfsprogs-6.17.0/libfrog/histogram.c:132:12: branch_false: following 'false' branch...
xfsprogs-6.17.0/libfrog/histogram.c:137:34: branch_false: ...to here
xfsprogs-6.17.0/libfrog/histogram.c:141:16: branch_true: following 'true' branch (when 'i != -1')...
xfsprogs-6.17.0/libfrog/histogram.c:142:42: branch_true: ...to here
xfsprogs-6.17.0/libfrog/histogram.c:145:17: danger: write of 8 bytes at offset '(long unsigned int)(int)(*hs.nr_buckets + 4294967294) * 32 + 24' exceeds the buffer
#  143|   					cdf->buckets[i + 1].nr_obs;
#  144|   
#  145|-> 		cdf->buckets[i].sum =    hs->buckets[i].sum +
#  146|   					cdf->buckets[i + 1].sum;
#  147|   		i--;

Error: GCC_ANALYZER_WARNING (CWE-122): [#def136]
xfsprogs-6.17.0/libfrog/histogram.c:146:41: warning[-Wanalyzer-out-of-bounds]: heap-based buffer over-read
xfsprogs-6.17.0/libfrog/histogram.c:119:9: branch_true: following 'true' branch...
xfsprogs-6.17.0/libfrog/histogram.c:121:15: branch_true: ...to here
xfsprogs-6.17.0/libfrog/histogram.c:122:12: branch_false: following 'false' branch (when 'cdf' is non-NULL)...
xfsprogs-6.17.0/libfrog/histogram.c:124:9: branch_false: ...to here
xfsprogs-6.17.0/libfrog/histogram.c:126:12: branch_false: following 'false' branch...
xfsprogs-6.17.0/libfrog/histogram.c:131:24: branch_false: ...to here
xfsprogs-6.17.0/libfrog/histogram.c:132:12: branch_false: following 'false' branch...
xfsprogs-6.17.0/libfrog/histogram.c:137:34: branch_false: ...to here
xfsprogs-6.17.0/libfrog/histogram.c:141:16: branch_true: following 'true' branch (when 'i != -1')...
xfsprogs-6.17.0/libfrog/histogram.c:142:42: branch_true: ...to here
xfsprogs-6.17.0/libfrog/histogram.c:146:41: danger: read of 8 bytes at offset '(long unsigned int)(int)(*hs.nr_buckets + 4294967294) * 32 + 56' exceeds the buffer
#  144|   
#  145|   		cdf->buckets[i].sum =    hs->buckets[i].sum +
#  146|-> 					cdf->buckets[i + 1].sum;
#  147|   		i--;
#  148|   	}

Error: GCC_ANALYZER_WARNING (CWE-476): [#def137]
xfsprogs-6.17.0/libfrog/histogram.c:216:33: warning[-Wanalyzer-null-dereference]: dereference of NULL '0'
xfsprogs-6.17.0/libfrog/histogram.c:164:1: enter_function: entry to 'hist_print'
xfsprogs-6.17.0/libfrog/histogram.c:174:15: call_function: calling 'hist_cdf' from 'hist_print'
xfsprogs-6.17.0/libfrog/histogram.c:174:15: return_function: returning to 'hist_print' from 'hist_cdf'
xfsprogs-6.17.0/libfrog/histogram.c:175:12: branch_false: following 'false' branch...
xfsprogs-6.17.0/libfrog/histogram.c:175:12: branch_false: ...to here
xfsprogs-6.17.0/libfrog/histogram.c:180:21: branch_false: following 'false' branch...
xfsprogs-6.17.0/libfrog/histogram.c:199:9: branch_false: ...to here
xfsprogs-6.17.0/libfrog/histogram.c:205:21: branch_true: following 'true' branch...
xfsprogs-6.17.0/libfrog/histogram.c:206:21: branch_true: ...to here
xfsprogs-6.17.0/libfrog/histogram.c:206:20: branch_false: following 'false' branch...
xfsprogs-6.17.0/libfrog/histogram.c:216:33: branch_false: ...to here
xfsprogs-6.17.0/libfrog/histogram.c:216:33: release_memory: using NULL here
xfsprogs-6.17.0/libfrog/histogram.c:216:33: danger: dereference of NULL '*<unknown>.buckets + (long unsigned int)i * 32'
#  214|   				hs->buckets[i].sum * 100.0 / hs->tot_sum,
#  215|   				cdf->buckets[i].sum * 100.0 / hs->tot_sum,
#  216|-> 				cdf->buckets[i].nr_obs * 100.0 / hs->tot_obs);
#  217|   	}
#  218|   

Error: GCC_ANALYZER_WARNING (CWE-476): [#def138]
xfsprogs-6.17.0/libfrog/list_sort.c:75:17: warning[-Wanalyzer-null-dereference]: dereference of NULL 'list'
xfsprogs-6.17.0/libfrog/list_sort.c:97:6: enter_function: entry to 'list_sort'
xfsprogs-6.17.0/libfrog/list_sort.c:105:12: branch_false: following 'false' branch...
xfsprogs-6.17.0/libfrog/list_sort.c:108:9: branch_false: ...to here
xfsprogs-6.17.0/libfrog/list_sort.c:113:16: branch_false: following 'false' branch (when 'list' is NULL)...
xfsprogs-6.17.0/libfrog/list_sort.c:113:16: branch_false: ...to here
xfsprogs-6.17.0/libfrog/list_sort.c:131:23: branch_false: following 'false' branch (when 'lev >= max_lev')...
xfsprogs-6.17.0/libfrog/list_sort.c:135:9: branch_false: ...to here
xfsprogs-6.17.0/libfrog/list_sort.c:135:9: release_memory: 'list' is NULL
xfsprogs-6.17.0/libfrog/list_sort.c:135:9: call_function: calling 'merge_and_restore_back_links' from 'list_sort'
#   73|   			(*cmp)(priv, tail->next, tail->next);
#   74|   
#   75|-> 		tail->next->prev = tail;
#   76|   		tail = tail->next;
#   77|   	} while (tail->next);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def139]
xfsprogs-6.17.0/libfrog/workqueue.c:180:25: warning[-Wanalyzer-malloc-leak]: leak of 'wi'
xfsprogs-6.17.0/libfrog/workqueue.c:154:9: branch_false: following 'false' branch...
xfsprogs-6.17.0/libfrog/workqueue.c:156:13: branch_false: ...to here
xfsprogs-6.17.0/libfrog/workqueue.c:156:12: branch_false: following 'false' branch...
xfsprogs-6.17.0/libfrog/workqueue.c:161:14: branch_false: ...to here
xfsprogs-6.17.0/libfrog/workqueue.c:161:14: acquire_memory: allocated here
xfsprogs-6.17.0/libfrog/workqueue.c:162:12: branch_false: following 'false' branch (when 'wi' is non-NULL)...
xfsprogs-6.17.0/libfrog/workqueue.c:165:9: branch_false: ...to here
xfsprogs-6.17.0/libfrog/workqueue.c:174:12: branch_false: following 'false' branch...
xfsprogs-6.17.0/libfrog/workqueue.c:179:21: branch_false: ...to here
xfsprogs-6.17.0/libfrog/workqueue.c:179:20: branch_true: following 'true' branch...
xfsprogs-6.17.0/libfrog/workqueue.c:180:25: throw: if 'pthread_cond_wait' throws an exception...
xfsprogs-6.17.0/libfrog/workqueue.c:180:25: danger: 'wi' leaks here; was allocated at [(5)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/4)
#  178|   		/* throttle on a full queue if configured */
#  179|   		if (wq->max_queued && wq->item_count == wq->max_queued) {
#  180|-> 			pthread_cond_wait(&wq->queue_full, &wq->lock);
#  181|   			/*
#  182|   			 * Queue might be empty or even still full by the time

Error: GCC_ANALYZER_WARNING (CWE-401): [#def140]
xfsprogs-6.17.0/libxcmd/command.c:188:13: warning[-Wanalyzer-malloc-leak]: leak of 'input'
xfsprogs-6.17.0/libxcmd/command.c:209:1: enter_function: entry to 'command_loop'
xfsprogs-6.17.0/libxcmd/command.c:215:12: branch_false: following 'false' branch...
xfsprogs-6.17.0/libxcmd/command.c:215:12: branch_false: ...to here
xfsprogs-6.17.0/libxcmd/command.c:227:21: branch_true: following 'true' branch...
xfsprogs-6.17.0/libxcmd/command.c:228:25: acquire_memory: allocated here
xfsprogs-6.17.0/libxcmd/command.c:229:20: branch_false: following 'false' branch (when 'input' is non-NULL)...
xfsprogs-6.17.0/libxcmd/command.c:235:24: branch_false: ...to here
xfsprogs-6.17.0/libxcmd/command.c:235:24: call_function: calling 'process_input' from 'command_loop'
#  186|   	int		error = 0;
#  187|   
#  188|-> 	v = breakline(input, &c);
#  189|   	if (!c)
#  190|   		goto out;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def141]
xfsprogs-6.17.0/libxcmd/input.c:61:17: warning[-Wanalyzer-malloc-leak]: leak of 'line'
xfsprogs-6.17.0/libxcmd/input.c:51:12: branch_false: following 'false' branch...
xfsprogs-6.17.0/libxcmd/input.c:54:16: branch_false: ...to here
xfsprogs-6.17.0/libxcmd/input.c:54:16: acquire_memory: allocated here
xfsprogs-6.17.0/libxcmd/input.c:55:12: branch_false: following 'false' branch (when 'line' is non-NULL)...
xfsprogs-6.17.0/libxcmd/input.c:58:13: branch_false: ...to here
xfsprogs-6.17.0/libxcmd/input.c:60:12: branch_true: following 'true' branch...
xfsprogs-6.17.0/libxcmd/input.c:61:17: branch_true: ...to here
xfsprogs-6.17.0/libxcmd/input.c:61:17: throw: if 'history' throws an exception...
xfsprogs-6.17.0/libxcmd/input.c:61:17: danger: 'line' leaks here; was allocated at [(3)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/2)
#   59|   		line[count-1] = '\0';
#   60|   	if (*line)
#   61|-> 		history(hist, &hevent, H_ENTER, line);
#   62|   	return line;
#   63|   }

Error: GCC_ANALYZER_WARNING (CWE-476): [#def142]
xfsprogs-6.17.0/libxfs/libxfs_io.h:146:16: warning[-Wanalyzer-null-dereference]: dereference of NULL 'bp'
xfsprogs-6.17.0/libxfs/xfs_btree.c:4644:1: enter_function: entry to 'xfs_btree_visit_block'
xfsprogs-6.17.0/libxfs/xfs_btree.c:4657:17: call_function: calling 'libxfs_btree_get_block' from 'xfs_btree_visit_block'
xfsprogs-6.17.0/libxfs/xfs_btree.c:4657:17: return_function: returning to 'xfs_btree_visit_block' from 'libxfs_btree_get_block'
xfsprogs-6.17.0/libxfs/xfs_btree.c:4661:12: branch_false: following 'false' branch...
xfsprogs-6.17.0/libxfs/xfs_btree.c:4665:9: branch_false: ...to here
xfsprogs-6.17.0/libxfs/xfs_btree.c:4665:9: call_function: calling 'xfs_btree_get_sibling' from 'xfs_btree_visit_block'
xfsprogs-6.17.0/libxfs/xfs_btree.c:4665:9: return_function: returning to 'xfs_btree_visit_block' from 'xfs_btree_get_sibling'
xfsprogs-6.17.0/libxfs/xfs_btree.c:4666:12: branch_false: following 'false' branch...
xfsprogs-6.17.0/libxfs/xfs_btree.c:4675:9: branch_false: ...to here
xfsprogs-6.17.0/libxfs/xfs_btree.c:4675:9: release_memory: 'bp' is NULL
xfsprogs-6.17.0/libxfs/xfs_btree.c:4675:9: call_function: calling 'xfs_btree_buf_to_ptr' from 'xfs_btree_visit_block'
#  144|   static inline xfs_daddr_t xfs_buf_daddr(struct xfs_buf *bp)
#  145|   {
#  146|-> 	return bp->b_maps[0].bm_bn;
#  147|   }
#  148|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def143]
xfsprogs-6.17.0/libxfs/libxfs_io.h:192:16: warning[-Wanalyzer-malloc-leak]: leak of ‘sb’
xfsprogs-6.17.0/repair/scan.c:3290:1: enter_function: entry to ‘scan_ag’
xfsprogs-6.17.0/repair/scan.c:3309:31: acquire_memory: allocated here
xfsprogs-6.17.0/repair/scan.c:3310:12: branch_false: following ‘false’ branch (when ‘sb’ is non-NULL)...
xfsprogs-6.17.0/repair/scan.c:3315:17: branch_false: ...to here
xfsprogs-6.17.0/repair/scan.c:3315:17: call_function: calling ‘salvage_buffer’ from ‘scan_ag’
#  190|   	DEFINE_SINGLE_BUF_MAP(map, blkno, numblks);
#  191|   
#  192|-> 	return libxfs_buf_get_map(target, &map, 1, 0, bpp);
#  193|   }
#  194|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def144]
xfsprogs-6.17.0/libxfs/libxfs_io.h:206:16: warning[-Wanalyzer-malloc-leak]: leak of ‘sb’
xfsprogs-6.17.0/repair/scan.c:3290:1: enter_function: entry to ‘scan_ag’
xfsprogs-6.17.0/repair/scan.c:3309:31: acquire_memory: allocated here
xfsprogs-6.17.0/repair/scan.c:3310:12: branch_false: following ‘false’ branch (when ‘sb’ is non-NULL)...
xfsprogs-6.17.0/repair/scan.c:3315:17: branch_false: ...to here
xfsprogs-6.17.0/repair/scan.c:3315:17: call_function: calling ‘salvage_buffer’ from ‘scan_ag’
#  204|   	DEFINE_SINGLE_BUF_MAP(map, blkno, numblks);
#  205|   
#  206|-> 	return libxfs_buf_read_map(target, &map, 1, flags, bpp, ops);
#  207|   }
#  208|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def145]
xfsprogs-6.17.0/libxfs/libxfs_io.h:206:16: warning[-Wanalyzer-malloc-leak]: leak of ‘value’
xfsprogs-6.17.0/repair/attr_repair.c:1316:1: enter_function: entry to ‘process_attributes’
xfsprogs-6.17.0/repair/attr_repair.c:1329:12: branch_false: following ‘false’ branch (when ‘aformat != 1’)...
xfsprogs-6.17.0/repair/attr_repair.c:1333:20: branch_false: ...to here
xfsprogs-6.17.0/repair/attr_repair.c:1333:19: branch_true: following ‘true’ branch...
xfsprogs-6.17.0/repair/attr_repair.c:1335:31: branch_true: ...to here
xfsprogs-6.17.0/repair/attr_repair.c:1335:31: call_function: calling ‘process_longform_attr’ from ‘process_attributes’
#  204|   	DEFINE_SINGLE_BUF_MAP(map, blkno, numblks);
#  205|   
#  206|-> 	return libxfs_buf_read_map(target, &map, 1, flags, bpp, ops);
#  207|   }
#  208|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def146]
xfsprogs-6.17.0/libxfs/rdwr.c:105:30: warning[-Wanalyzer-malloc-leak]: leak of 'z'
xfsprogs-6.17.0/libxfs/rdwr.c:1169:1: enter_function: entry to 'libxfs_log_clear'
xfsprogs-6.17.0/libxfs/rdwr.c:1189:12: branch_false: following 'false' branch...
xfsprogs-6.17.0/libxfs/rdwr.c:1189:13: branch_false: ...to here
xfsprogs-6.17.0/libxfs/rdwr.c:1190:13: branch_false: following 'false' branch...
xfsprogs-6.17.0/libxfs/rdwr.c:1194:12: branch_true: following 'true' branch (when 'btp' is non-NULL)...
xfsprogs-6.17.0/libxfs/rdwr.c:1195:17: branch_true: ...to here
xfsprogs-6.17.0/libxfs/rdwr.c:1195:17: call_function: calling 'libxfs_device_zero' from 'libxfs_log_clear'
#  103|   	for (offset = 0; offset < end_offset; ) {
#  104|   		bytes = min((ssize_t)(end_offset - offset), zsize);
#  105|-> 		if ((bytes = write(fd, z, bytes)) < 0) {
#  106|   			fprintf(stderr, _("%s: %s write failed: %s\n"),
#  107|   				progname, __FUNCTION__, strerror(errno));

Error: GCC_ANALYZER_WARNING (CWE-775): [#def147]
xfsprogs-6.17.0/libxfs/topology.c:165:9: warning[-Wanalyzer-fd-leak]: leak of file descriptor 'open(device, 0)'
xfsprogs-6.17.0/libxfs/topology.c:157:12: branch_false: following 'false' branch...
xfsprogs-6.17.0/libxfs/topology.c:162:14: acquire_resource: opened here
xfsprogs-6.17.0/libxfs/topology.c:163:12: branch_false: following 'false' branch...
xfsprogs-6.17.0/libxfs/topology.c:165:9: branch_false: ...to here
xfsprogs-6.17.0/libxfs/topology.c:165:9: throw: if 'platform_findsizes' throws an exception...
xfsprogs-6.17.0/libxfs/topology.c:165:9: danger: 'open(device, 0)' leaks here; was opened at [(3)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/2)
#  163|   	if (fd < 0)
#  164|   		goto out;
#  165|-> 	platform_findsizes((char *)device, fd, &size, &bsz);
#  166|   	close(fd);
#  167|   

Error: GCC_ANALYZER_WARNING (CWE-476): [#def148]
xfsprogs-6.17.0/libxfs/xfs_ag_resv.c:142:52: warning[-Wanalyzer-null-dereference]: dereference of NULL '0'
xfsprogs-6.17.0/libxfs/xfs_ag_resv.c:131:1: enter_function: entry to '__xfs_ag_resv_free'
xfsprogs-6.17.0/libxfs/xfs_ag_resv.c:140:16: call_function: inlined call to 'xfs_perag_resv' from '__xfs_ag_resv_free'
xfsprogs-6.17.0/libxfs/xfs_ag_resv.c:141:13: call_function: inlined call to 'pag_agno' from '__xfs_ag_resv_free'
xfsprogs-6.17.0/libxfs/xfs_ag_resv.c:141:12: branch_true: following 'true' branch...
xfsprogs-6.17.0/libxfs/xfs_ag_resv.c:142:17: call_function: inlined call to 'pag_mount' from '__xfs_ag_resv_free'
xfsprogs-6.17.0/libxfs/xfs_ag_resv.c:142:52: danger: dereference of NULL '<unknown>'
#  140|   	resv = xfs_perag_resv(pag, type);
#  141|   	if (pag_agno(pag) == 0)
#  142|-> 		pag_mount(pag)->m_ag_max_usable += resv->ar_asked;
#  143|   	/*
#  144|   	 * RMAPBT blocks come from the AGFL and AGFL blocks are always

Error: GCC_ANALYZER_WARNING (CWE-476): [#def149]
xfsprogs-6.17.0/libxfs/xfs_ag_resv.c:151:17: warning[-Wanalyzer-null-dereference]: dereference of NULL '0'
xfsprogs-6.17.0/libxfs/xfs_ag_resv.c:131:1: enter_function: entry to '__xfs_ag_resv_free'
xfsprogs-6.17.0/libxfs/xfs_ag_resv.c:140:16: call_function: inlined call to 'xfs_perag_resv' from '__xfs_ag_resv_free'
xfsprogs-6.17.0/libxfs/xfs_ag_resv.c:141:13: call_function: inlined call to 'pag_agno' from '__xfs_ag_resv_free'
xfsprogs-6.17.0/libxfs/xfs_ag_resv.c:141:12: branch_false: following 'false' branch...
xfsprogs-6.17.0/libxfs/xfs_ag_resv.c:148:12: branch_false: ...to here
xfsprogs-6.17.0/libxfs/xfs_ag_resv.c:148:12: branch_false: following 'false' branch (when 'type != 3')...
xfsprogs-6.17.0/libxfs/xfs_ag_resv.c:151:17: branch_false: ...to here
xfsprogs-6.17.0/libxfs/xfs_ag_resv.c:151:17: danger: dereference of NULL '<unknown>'
#  149|   		oldresv = resv->ar_orig_reserved;
#  150|   	else
#  151|-> 		oldresv = resv->ar_reserved;
#  152|   	xfs_add_fdblocks(pag_mount(pag), oldresv);
#  153|   	resv->ar_reserved = 0;

Error: GCC_ANALYZER_WARNING (CWE-457): [#def150]
xfsprogs-6.17.0/libxfs/xfs_alloc.c:2945:25: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value 'bno'
xfsprogs-6.17.0/libxfs/xfs_alloc.c:3965:1: enter_function: entry to 'xfs_free_extent_fix_freelist'
xfsprogs-6.17.0/libxfs/xfs_alloc.c:3983:12: branch_false: following 'false' branch...
xfsprogs-6.17.0/libxfs/xfs_alloc.c:3986:17: branch_false: ...to here
xfsprogs-6.17.0/libxfs/xfs_alloc.c:3986:17: call_function: calling 'libxfs_alloc_fix_freelist' from 'xfs_free_extent_fix_freelist'
# 2943|   		 * freeing the block.
# 2944|   		 */
# 2945|-> 		error = xfs_free_extent_later(tp, xfs_agbno_to_fsb(pag, bno),
# 2946|   				1, &targs.oinfo, XFS_AG_RESV_AGFL, 0);
# 2947|   		if (error)

Error: COMPILER_WARNING: [#def151]
xfsprogs-6.17.0/libxfs/xfs_alloc.c: scope_hint: In function '__xfs_free_extent'
xfsprogs-6.17.0/libxfs/xfs_alloc.c:4013:41: warning[-Wunused-but-set-variable=]: variable 'busy_flags' set but not used
# 4013 |         unsigned int                    busy_flags = 0;
#      |                                         ^~~~~~~~~~
# 4011|   	struct xfs_agf			*agf;
# 4012|   	int				error;
# 4013|-> 	unsigned int			busy_flags = 0;
# 4014|   
# 4015|   	ASSERT(len != 0);

Error: GCC_ANALYZER_WARNING (CWE-126): [#def152]
xfsprogs-6.17.0/libxfs/xfs_attr_remote.c:431:34: warning[-Wanalyzer-out-of-bounds]: stack-based buffer over-read
xfsprogs-6.17.0/libxfs/xfs_attr_remote.c:416:16: branch_true: following 'true' branch...
xfsprogs-6.17.0/libxfs/xfs_attr_remote.c:417:17: branch_true: ...to here
xfsprogs-6.17.0/libxfs/xfs_attr_remote.c:421:20: branch_false: following 'false' branch...
xfsprogs-6.17.0/libxfs/xfs_attr_remote.c:421:20: branch_false: ...to here
xfsprogs-6.17.0/libxfs/xfs_attr_remote.c:425:29: branch_true: following 'true' branch...
xfsprogs-6.17.0/libxfs/xfs_attr_remote.c:431:34: branch_true: ...to here
xfsprogs-6.17.0/libxfs/xfs_attr_remote.c:435:28: branch_true: following 'true' branch...
xfsprogs-6.17.0/libxfs/xfs_attr_remote.c:436:33: branch_true: ...to here
xfsprogs-6.17.0/libxfs/xfs_attr_remote.c:442:28: branch_false: following 'false' branch...
xfsprogs-6.17.0/libxfs/xfs_attr_remote.c:444:28: branch_false: ...to here
xfsprogs-6.17.0/libxfs/xfs_attr_remote.c:444:28: branch_false: following 'false' branch...
xfsprogs-6.17.0/libxfs/xfs_attr_remote.c:447:33: branch_false: ...to here
xfsprogs-6.17.0/libxfs/xfs_attr_remote.c:450:28: branch_false: following 'false' branch...
xfsprogs-6.17.0/libxfs/xfs_attr_remote.c:454:35: branch_false: ...to here
xfsprogs-6.17.0/libxfs/xfs_attr_remote.c:425:29: branch_true: following 'true' branch...
xfsprogs-6.17.0/libxfs/xfs_attr_remote.c:431:34: danger: out-of-bounds read from byte 40 till byte 47 but 'map' ends at byte 32
#  429|   			ASSERT((map[i].br_startblock != DELAYSTARTBLOCK) &&
#  430|   			       (map[i].br_startblock != HOLESTARTBLOCK));
#  431|-> 			dblkno = XFS_FSB_TO_DADDR(mp, map[i].br_startblock);
#  432|   			dblkcnt = XFS_FSB_TO_BB(mp, map[i].br_blockcount);
#  433|   			error = xfs_buf_read(mp->m_ddev_targp, dblkno, dblkcnt,

Error: GCC_ANALYZER_WARNING (CWE-126): [#def153]
xfsprogs-6.17.0/libxfs/xfs_attr_remote.c:432:35: warning[-Wanalyzer-out-of-bounds]: stack-based buffer over-read
xfsprogs-6.17.0/libxfs/xfs_attr_remote.c:416:16: branch_true: following 'true' branch...
xfsprogs-6.17.0/libxfs/xfs_attr_remote.c:417:17: branch_true: ...to here
xfsprogs-6.17.0/libxfs/xfs_attr_remote.c:421:20: branch_false: following 'false' branch...
xfsprogs-6.17.0/libxfs/xfs_attr_remote.c:421:20: branch_false: ...to here
xfsprogs-6.17.0/libxfs/xfs_attr_remote.c:425:29: branch_true: following 'true' branch...
xfsprogs-6.17.0/libxfs/xfs_attr_remote.c:431:34: branch_true: ...to here
xfsprogs-6.17.0/libxfs/xfs_attr_remote.c:435:28: branch_true: following 'true' branch...
xfsprogs-6.17.0/libxfs/xfs_attr_remote.c:436:33: branch_true: ...to here
xfsprogs-6.17.0/libxfs/xfs_attr_remote.c:442:28: branch_false: following 'false' branch...
xfsprogs-6.17.0/libxfs/xfs_attr_remote.c:444:28: branch_false: ...to here
xfsprogs-6.17.0/libxfs/xfs_attr_remote.c:444:28: branch_false: following 'false' branch...
xfsprogs-6.17.0/libxfs/xfs_attr_remote.c:447:33: branch_false: ...to here
xfsprogs-6.17.0/libxfs/xfs_attr_remote.c:450:28: branch_false: following 'false' branch...
xfsprogs-6.17.0/libxfs/xfs_attr_remote.c:454:35: branch_false: ...to here
xfsprogs-6.17.0/libxfs/xfs_attr_remote.c:425:29: branch_true: following 'true' branch...
xfsprogs-6.17.0/libxfs/xfs_attr_remote.c:432:35: danger: out-of-bounds read from byte 48 till byte 55 but 'map' ends at byte 32
#  430|   			       (map[i].br_startblock != HOLESTARTBLOCK));
#  431|   			dblkno = XFS_FSB_TO_DADDR(mp, map[i].br_startblock);
#  432|-> 			dblkcnt = XFS_FSB_TO_BB(mp, map[i].br_blockcount);
#  433|   			error = xfs_buf_read(mp->m_ddev_targp, dblkno, dblkcnt,
#  434|   					0, &bp, &xfs_attr3_rmt_buf_ops);

Error: GCC_ANALYZER_WARNING (CWE-126): [#def154]
xfsprogs-6.17.0/libxfs/xfs_attr_remote.c:454:35: warning[-Wanalyzer-out-of-bounds]: stack-based buffer over-read
xfsprogs-6.17.0/libxfs/xfs_attr_remote.c:395:1: enter_function: entry to 'libxfs_attr_rmtval_get'
xfsprogs-6.17.0/libxfs/xfs_attr_remote.c:416:16: branch_true: following 'true' branch...
xfsprogs-6.17.0/libxfs/xfs_attr_remote.c:417:17: branch_true: ...to here
xfsprogs-6.17.0/libxfs/xfs_attr_remote.c:421:20: branch_false: following 'false' branch...
xfsprogs-6.17.0/libxfs/xfs_attr_remote.c:421:20: branch_false: ...to here
xfsprogs-6.17.0/libxfs/xfs_attr_remote.c:425:29: branch_true: following 'true' branch...
xfsprogs-6.17.0/libxfs/xfs_attr_remote.c:431:34: branch_true: ...to here
xfsprogs-6.17.0/libxfs/xfs_attr_remote.c:435:28: branch_true: following 'true' branch...
xfsprogs-6.17.0/libxfs/xfs_attr_remote.c:436:33: branch_true: ...to here
xfsprogs-6.17.0/libxfs/xfs_attr_remote.c:442:28: branch_false: following 'false' branch...
xfsprogs-6.17.0/libxfs/xfs_attr_remote.c:444:28: branch_false: ...to here
xfsprogs-6.17.0/libxfs/xfs_attr_remote.c:444:28: branch_false: following 'false' branch...
xfsprogs-6.17.0/libxfs/xfs_attr_remote.c:447:33: branch_false: ...to here
xfsprogs-6.17.0/libxfs/xfs_attr_remote.c:450:28: branch_false: following 'false' branch...
xfsprogs-6.17.0/libxfs/xfs_attr_remote.c:454:35: branch_false: ...to here
xfsprogs-6.17.0/libxfs/xfs_attr_remote.c:425:29: branch_true: following 'true' branch...
xfsprogs-6.17.0/libxfs/xfs_attr_remote.c:435:28: branch_true: following 'true' branch...
xfsprogs-6.17.0/libxfs/xfs_attr_remote.c:436:33: branch_true: ...to here
xfsprogs-6.17.0/libxfs/xfs_attr_remote.c:442:28: branch_false: following 'false' branch...
xfsprogs-6.17.0/libxfs/xfs_attr_remote.c:444:28: branch_false: ...to here
xfsprogs-6.17.0/libxfs/xfs_attr_remote.c:444:28: branch_false: following 'false' branch...
xfsprogs-6.17.0/libxfs/xfs_attr_remote.c:447:33: branch_false: ...to here
xfsprogs-6.17.0/libxfs/xfs_attr_remote.c:447:33: call_function: calling 'xfs_attr_rmtval_copyout' from 'libxfs_attr_rmtval_get'
xfsprogs-6.17.0/libxfs/xfs_attr_remote.c:447:33: return_function: returning to 'libxfs_attr_rmtval_get' from 'xfs_attr_rmtval_copyout'
xfsprogs-6.17.0/libxfs/xfs_attr_remote.c:450:28: branch_false: following 'false' branch...
xfsprogs-6.17.0/libxfs/xfs_attr_remote.c:454:35: branch_false: ...to here
xfsprogs-6.17.0/libxfs/xfs_attr_remote.c:454:35: danger: out-of-bounds read from byte 48 till byte 55 but 'map' ends at byte 32
#  452|   
#  453|   			/* roll attribute extent map forwards */
#  454|-> 			lblkno += map[i].br_blockcount;
#  455|   			blkcnt -= map[i].br_blockcount;
#  456|   		}

Error: GCC_ANALYZER_WARNING (CWE-476): [#def155]
xfsprogs-6.17.0/libxfs/xfs_bmap.c:563:34: warning[-Wanalyzer-null-dereference]: dereference of NULL '0'
xfsprogs-6.17.0/libxfs/xfs_bmap.c:5528:1: enter_function: entry to 'xfs_bmse_merge'
xfsprogs-6.17.0/libxfs/xfs_bmap.c:5539:48: call_function: calling 'xfs_ifork_ptr' from 'xfs_bmse_merge'
xfsprogs-6.17.0/libxfs/xfs_bmap.c:5539:48: return_function: returning to 'xfs_bmse_merge' from 'xfs_ifork_ptr'
xfsprogs-6.17.0/libxfs/xfs_bmap.c:5559:12: branch_false: following 'false' branch (when 'cur' is non-NULL)...
xfsprogs-6.17.0/libxfs/xfs_bmap.c:5565:17: call_function: inlined call to 'xfs_bmbt_lookup_eq' from 'xfs_bmse_merge'
xfsprogs-6.17.0/libxfs/xfs_bmap.c:5566:12: branch_false: following 'false' branch...
xfsprogs-6.17.0/libxfs/xfs_bmap.c:5568:13: branch_false: ...to here
xfsprogs-6.17.0/libxfs/xfs_bmap.c:5568:13: branch_false: following 'false' branch...
xfsprogs-6.17.0/libxfs/xfs_bmap.c:5573:17: branch_false: ...to here
xfsprogs-6.17.0/libxfs/xfs_bmap.c:5574:12: branch_false: following 'false' branch...
xfsprogs-6.17.0/libxfs/xfs_bmap.c:5576:13: branch_false: ...to here
xfsprogs-6.17.0/libxfs/xfs_bmap.c:5576:13: branch_false: following 'false' branch...
xfsprogs-6.17.0/libxfs/xfs_bmap.c:5582:17: call_function: inlined call to 'xfs_bmbt_lookup_eq' from 'xfs_bmse_merge'
xfsprogs-6.17.0/libxfs/xfs_bmap.c:5583:12: branch_false: following 'false' branch...
xfsprogs-6.17.0/libxfs/xfs_bmap.c:5585:13: branch_false: ...to here
xfsprogs-6.17.0/libxfs/xfs_bmap.c:5585:13: branch_false: following 'false' branch...
xfsprogs-6.17.0/libxfs/xfs_bmap.c:5590:17: branch_false: ...to here
xfsprogs-6.17.0/libxfs/xfs_bmap.c:5591:12: branch_false: following 'false' branch...
xfsprogs-6.17.0/libxfs/xfs_bmap.c:5595:17: branch_false: ...to here
xfsprogs-6.17.0/libxfs/xfs_bmap.c:5595:17: call_function: calling 'xfs_bmap_btree_to_extents' from 'xfs_bmse_merge'
#  561|   	struct xfs_ifork	*ifp = xfs_ifork_ptr(ip, whichfork);
#  562|   	struct xfs_mount	*mp = ip->i_mount;
#  563|-> 	struct xfs_btree_block	*rblock = ifp->if_broot;
#  564|   	struct xfs_btree_block	*cblock;/* child btree block */
#  565|   	xfs_fsblock_t		cbno;	/* child block number */

Error: COMPILER_WARNING: [#def156]
xfsprogs-6.17.0/libxfs/xfs_bmap.c: scope_hint: In function 'xfs_bmapi_convert_one_delalloc'
xfsprogs-6.17.0/libxfs/xfs_bmap.c:4369:33: warning[-Wunused-but-set-variable=]: variable 'flags' set but not used
# 4369 |         uint16_t                flags = 0;
#      |                                 ^~~~~
# 4367|   	xfs_fileoff_t		offset_fsb = XFS_B_TO_FSBT(mp, offset);
# 4368|   	struct xfs_bmalloca	bma = { NULL };
# 4369|-> 	uint16_t		flags = 0;
# 4370|   	struct xfs_trans	*tp;
# 4371|   	int			error;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def157]
xfsprogs-6.17.0/libxfs/xfs_bmap.c:5557:9: warning[-Wanalyzer-null-dereference]: dereference of NULL '0'
# 5555|   	 * inode.
# 5556|   	 */
# 5557|-> 	ifp->if_nextents--;
# 5558|   	*logflags |= XFS_ILOG_CORE;
# 5559|   	if (!cur) {

Error: GCC_ANALYZER_WARNING (CWE-476): [#def158]
xfsprogs-6.17.0/libxfs/xfs_bmap_btree.c:549:44: warning[-Wanalyzer-null-dereference]: dereference of NULL '0'
#  547|   	struct xfs_btree_block	*broot;
#  548|   	unsigned int		new_size;
#  549|-> 	unsigned int		old_size = ifp->if_broot_bytes;
#  550|   
#  551|   	/*

Error: GCC_ANALYZER_WARNING (CWE-476): [#def159]
xfsprogs-6.17.0/libxfs/xfs_bmap_btree.c:683:35: warning[-Wanalyzer-null-dereference]: dereference of NULL '0'
xfsprogs-6.17.0/libxfs/xfs_bmap_btree.c:680:12: branch_true: following 'true' branch (when 'whichfork != -1')...
xfsprogs-6.17.0/libxfs/xfs_bmap_btree.c:681:48: branch_true: ...to here
xfsprogs-6.17.0/libxfs/xfs_bmap_btree.c:683:35: danger: dereference of NULL 'xfs_ifork_ptr(ip,  whichfork)'
#  681|   		struct xfs_ifork	*ifp = xfs_ifork_ptr(ip, whichfork);
#  682|   
#  683|-> 		cur->bc_nlevels = be16_to_cpu(ifp->if_broot->bb_level) + 1;
#  684|   		cur->bc_ino.forksize = xfs_inode_fork_size(ip, whichfork);
#  685|   	}

Error: GCC_ANALYZER_WARNING (CWE-688): [#def160]
xfsprogs-6.17.0/libxfs/xfs_bmap_btree.c:726:9: warning[-Wanalyzer-null-argument]: use of NULL where non-null expected
#  724|   	ifp = xfs_ifork_ptr(cur->bc_ino.ip, whichfork);
#  725|   	xfs_idestroy_fork(ifp);
#  726|-> 	memcpy(ifp, ifake->if_fork, sizeof(struct xfs_ifork));
#  727|   
#  728|   	switch (ifp->if_format) {

Error: GCC_ANALYZER_WARNING (CWE-476): [#def161]
xfsprogs-6.17.0/libxfs/xfs_btree.c:834:16: warning[-Wanalyzer-null-dereference]: dereference of NULL '0'
xfsprogs-6.17.0/libxfs/xfs_btree.c:842:1: enter_function: entry to 'libxfs_btree_get_block'
xfsprogs-6.17.0/libxfs/xfs_btree.c:849:24: call_function: inlined call to 'xfs_btree_get_iroot' from 'libxfs_btree_get_block'
xfsprogs-6.17.0/libxfs/xfs_btree.c:849:24: call_function: inlined call to 'xfs_btree_get_iroot' from 'libxfs_btree_get_block'
#  832|   	struct xfs_ifork	*ifp = xfs_btree_ifork_ptr(cur);
#  833|   
#  834|-> 	return (struct xfs_btree_block *)ifp->if_broot;
#  835|   }
#  836|   

Error: GCC_ANALYZER_WARNING (CWE-476): [#def162]
xfsprogs-6.17.0/libxfs/xfs_btree.h:433:16: warning[-Wanalyzer-null-dereference]: dereference of NULL 'block'
xfsprogs-6.17.0/libxfs/xfs_btree.c:5562:1: enter_function: entry to 'libxfs_btree_goto_left_edge'
xfsprogs-6.17.0/libxfs/xfs_btree.c:5569:17: call_function: calling 'libxfs_btree_lookup' from 'libxfs_btree_goto_left_edge'
#  431|   static inline int xfs_btree_get_numrecs(const struct xfs_btree_block *block)
#  432|   {
#  433|-> 	return be16_to_cpu(block->bb_numrecs);
#  434|   }
#  435|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def163]
xfsprogs-6.17.0/libxfs/xfs_cksum.h:20:15: warning[-Wanalyzer-malloc-leak]: leak of ‘list’
xfsprogs-6.17.0/repair/sb.c:708:1: enter_function: entry to ‘verify_set_primary_sb’
xfsprogs-6.17.0/repair/sb.c:740:9: call_function: calling ‘get_sb_geometry’ from ‘verify_set_primary_sb’
xfsprogs-6.17.0/repair/sb.c:740:9: return_function: returning to ‘verify_set_primary_sb’ from ‘get_sb_geometry’
xfsprogs-6.17.0/repair/sb.c:741:16: call_function: calling ‘add_geo’ from ‘verify_set_primary_sb’
xfsprogs-6.17.0/repair/sb.c:741:16: return_function: returning to ‘verify_set_primary_sb’ from ‘add_geo’
xfsprogs-6.17.0/repair/sb.c:747:24: branch_true: following ‘true’ branch...
xfsprogs-6.17.0/repair/sb.c:748:23: branch_true: ...to here
xfsprogs-6.17.0/repair/sb.c:750:26: call_function: calling ‘get_sb’ from ‘verify_set_primary_sb’
#   18|   
#   19|   	/* Calculate CRC up to the checksum. */
#   20|-> 	crc = crc32c(XFS_CRC_SEED, buffer, cksum_offset);
#   21|   
#   22|   	/* Skip checksum field */

Error: GCC_ANALYZER_WARNING (CWE-457): [#def164]
xfsprogs-6.17.0/libxfs/xfs_da_btree.c:2150:14: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value 'blk'
xfsprogs-6.17.0/libxfs/xfs_da_btree.c:1124:1: enter_function: entry to 'xfs_da3_join'
xfsprogs-6.17.0/libxfs/xfs_da_btree.c:1144:18: branch_true: following 'true' branch...
xfsprogs-6.17.0/libxfs/xfs_da_btree.c:1152:25: branch_true: ...to here
xfsprogs-6.17.0/libxfs/xfs_da_btree.c:1176:33: call_function: calling 'xfs_da3_node_toosmall' from 'xfs_da3_join'
# 2148|   	 * same depth we were at originally.
# 2149|   	 */
# 2150|-> 	for (blk++, level++; level < path->active; blk++, level++) {
# 2151|   		/*
# 2152|   		 * Read the next child block into a local buffer.

Error: GCC_ANALYZER_WARNING (CWE-476): [#def165]
xfsprogs-6.17.0/libxfs/xfs_dir2_block.c:1242:32: warning[-Wanalyzer-null-dereference]: dereference of NULL 'sfep'
xfsprogs-6.17.0/libxfs/xfs_dir2_block.c:1127:12: branch_false: following 'false' branch...
xfsprogs-6.17.0/libxfs/xfs_dir2_block.c:1132:17: branch_false: ...to here
xfsprogs-6.17.0/libxfs/xfs_dir2_block.c:1133:12: branch_false: following 'false' branch...
xfsprogs-6.17.0/libxfs/xfs_dir2_block.c:1135:9: branch_false: ...to here
xfsprogs-6.17.0/libxfs/xfs_dir2_block.c:1151:12: branch_false: following 'false' branch...
xfsprogs-6.17.0/libxfs/xfs_dir2_block.c:1157:15: branch_false: ...to here
xfsprogs-6.17.0/libxfs/xfs_dir2_block.c:1168:12: branch_false: following 'false' branch...
xfsprogs-6.17.0/libxfs/xfs_dir2_block.c:1174:17: branch_false: ...to here
xfsprogs-6.17.0/libxfs/xfs_dir2_block.c:1205:12: branch_true: following 'true' branch...
xfsprogs-6.17.0/libxfs/xfs_dir2_block.c:1205:12: branch_true: ...to here
xfsprogs-6.17.0/libxfs/xfs_dir2_block.c:1214:16: branch_true: following 'true' branch...
xfsprogs-6.17.0/libxfs/xfs_dir2_block.c:1218:20: branch_true: ...to here
xfsprogs-6.17.0/libxfs/xfs_dir2_block.c:1218:20: branch_true: following 'true' branch (when 'sfep' is NULL)...
xfsprogs-6.17.0/libxfs/xfs_dir2_block.c:1225:21: branch_true: ...to here
xfsprogs-6.17.0/libxfs/xfs_dir2_block.c:1242:32: danger: dereference of NULL 'sfep'
# 1240|   		dep = bp->b_addr + newoffset;
# 1241|   		dep->inumber = cpu_to_be64(xfs_dir2_sf_get_ino(mp, sfp, sfep));
# 1242|-> 		dep->namelen = sfep->namelen;
# 1243|   		xfs_dir2_data_put_ftype(mp, dep,
# 1244|   				xfs_dir2_sf_get_ftype(mp, sfep));

Error: GCC_ANALYZER_WARNING (CWE-476): [#def166]
xfsprogs-6.17.0/libxfs/xfs_dir2_leaf.c:1341:57: warning[-Wanalyzer-null-dereference]: dereference of NULL 'dbp'
xfsprogs-6.17.0/libxfs/xfs_dir2_leaf.c:1272:34: release_memory: 'dbp' is NULL
xfsprogs-6.17.0/libxfs/xfs_dir2_leaf.c:1292:12: branch_false: following 'false' branch...
xfsprogs-6.17.0/libxfs/xfs_dir2_leaf.c:1295:9: branch_false: ...to here
xfsprogs-6.17.0/libxfs/xfs_dir2_leaf.c:1309:14: branch_true: following 'true' branch...
xfsprogs-6.17.0/libxfs/xfs_dir2_leaf.c:1310:25: branch_true: ...to here
xfsprogs-6.17.0/libxfs/xfs_dir2_leaf.c:1309:14: branch_true: following 'true' branch...
xfsprogs-6.17.0/libxfs/xfs_dir2_leaf.c:1315:21: branch_true: ...to here
xfsprogs-6.17.0/libxfs/xfs_dir2_leaf.c:1326:20: branch_false: following 'false' branch...
xfsprogs-6.17.0/libxfs/xfs_dir2_leaf.c:1341:60: branch_false: ...to here
xfsprogs-6.17.0/libxfs/xfs_dir2_leaf.c:1341:60: release_memory: 'dbp' is NULL
xfsprogs-6.17.0/libxfs/xfs_dir2_leaf.c:1341:57: danger: dereference of NULL 'dbp'
# 1339|   		 * Point to the data entry.
# 1340|   		 */
# 1341|-> 		dep = (xfs_dir2_data_entry_t *)((char *)dbp->b_addr +
# 1342|   			xfs_dir2_dataptr_to_off(args->geo,
# 1343|   						be32_to_cpu(lep->address)));

Error: GCC_ANALYZER_WARNING (CWE-476): [#def167]
xfsprogs-6.17.0/libxfs/xfs_dir2_node.c:880:57: warning[-Wanalyzer-null-dereference]: dereference of NULL 'curbp'
xfsprogs-6.17.0/libxfs/xfs_dir2_node.c:939:1: enter_function: entry to 'xfs_dir2_leafn_lookup_int'
xfsprogs-6.17.0/libxfs/xfs_dir2_node.c:945:12: branch_false: following 'false' branch...
xfsprogs-6.17.0/libxfs/xfs_dir2_node.c:948:16: branch_false: ...to here
xfsprogs-6.17.0/libxfs/xfs_dir2_node.c:948:16: call_function: calling 'xfs_dir2_leafn_lookup_for_entry' from 'xfs_dir2_leafn_lookup_int'
#  878|   		 * Point to the data entry.
#  879|   		 */
#  880|-> 		dep = (xfs_dir2_data_entry_t *)((char *)curbp->b_addr +
#  881|   			xfs_dir2_dataptr_to_off(args->geo,
#  882|   						be32_to_cpu(lep->address)));

Error: GCC_ANALYZER_WARNING (CWE-476): [#def168]
xfsprogs-6.17.0/libxfs/xfs_exchmaps.c:878:13: warning[-Wanalyzer-null-dereference]: dereference of NULL '0'
xfsprogs-6.17.0/libxfs/xfs_exchmaps.c:859:1: enter_function: entry to 'xmi_ensure_delta_nextents'
xfsprogs-6.17.0/libxfs/xfs_exchmaps.c:866:40: call_function: calling 'xfs_ifork_ptr' from 'xmi_ensure_delta_nextents'
xfsprogs-6.17.0/libxfs/xfs_exchmaps.c:866:40: return_function: returning to 'xmi_ensure_delta_nextents' from 'xfs_ifork_ptr'
xfsprogs-6.17.0/libxfs/xfs_exchmaps.c:870:12: branch_false: following 'false' branch (when 'delta >= 0')...
xfsprogs-6.17.0/libxfs/xfs_exchmaps.c:878:13: branch_false: ...to here
xfsprogs-6.17.0/libxfs/xfs_exchmaps.c:878:13: danger: dereference of NULL 'xfs_ifork_ptr(ip,  <unknown>)'
#  876|   	 * coded into the overflow check.
#  877|   	 */
#  878|-> 	if (check_add_overflow(ifp->if_nextents, (uint64_t)delta,
#  879|   				&new_nextents))
#  880|   		return -EFBIG;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def169]
xfsprogs-6.17.0/libxfs/xfs_inode_fork.c:62:17: warning[-Wanalyzer-null-dereference]: dereference of NULL '0'
xfsprogs-6.17.0/libxfs/xfs_inode_fork.c:54:12: branch_true: following 'true' branch (when 'size != 0')...
xfsprogs-6.17.0/libxfs/xfs_inode_fork.c:55:34: branch_true: ...to here
xfsprogs-6.17.0/libxfs/xfs_inode_fork.c:59:20: branch_false: following 'false' branch...
xfsprogs-6.17.0/libxfs/xfs_inode_fork.c:62:17: branch_false: ...to here
xfsprogs-6.17.0/libxfs/xfs_inode_fork.c:62:17: danger: dereference of NULL 'xfs_ifork_ptr(ip,  whichfork)'
#   60|   			new_data[size] = '\0';
#   61|   
#   62|-> 		ifp->if_data = new_data;
#   63|   	} else {
#   64|   		ifp->if_data = NULL;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def170]
xfsprogs-6.17.0/libxfs/xfs_inode_fork.c:64:17: warning[-Wanalyzer-null-dereference]: dereference of NULL '0'
xfsprogs-6.17.0/libxfs/xfs_inode_fork.c:54:12: branch_false: following 'false' branch (when 'size == 0')...
xfsprogs-6.17.0/libxfs/xfs_inode_fork.c:64:17: branch_false: ...to here
xfsprogs-6.17.0/libxfs/xfs_inode_fork.c:64:17: danger: dereference of NULL 'xfs_ifork_ptr(ip,  whichfork)'
#   62|   		ifp->if_data = new_data;
#   63|   	} else {
#   64|-> 		ifp->if_data = NULL;
#   65|   	}
#   66|   

Error: GCC_ANALYZER_WARNING (CWE-476): [#def171]
xfsprogs-6.17.0/libxfs/xfs_inode_fork.c:135:9: warning[-Wanalyzer-null-dereference]: dereference of NULL '0'
xfsprogs-6.17.0/libxfs/xfs_inode_fork.c:125:12: branch_false: following 'false' branch...
xfsprogs-6.17.0/libxfs/xfs_inode_fork.c:135:9: danger: dereference of NULL 'xfs_ifork_ptr(ip,  whichfork)'
#  133|   	}
#  134|   
#  135|-> 	ifp->if_bytes = 0;
#  136|   	ifp->if_data = NULL;
#  137|   	ifp->if_height = 0;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def172]
xfsprogs-6.17.0/libxfs/xfs_inode_fork.c:199:13: warning[-Wanalyzer-null-dereference]: dereference of NULL '0'
#  197|   	 * blocks.
#  198|   	 */
#  199|-> 	if (unlikely(ifp->if_nextents <= XFS_IFORK_MAXEXT(ip, whichfork) ||
#  200|   		     nrecs == 0 ||
#  201|   		     xfs_bmdr_space_calc(nrecs) >

Error: GCC_ANALYZER_WARNING (CWE-476): [#def173]
xfsprogs-6.17.0/libxfs/xfs_inode_fork.c:457:44: warning[-Wanalyzer-null-dereference]: dereference of NULL '0'
#  455|   {
#  456|   	struct xfs_ifork	*ifp = xfs_ifork_ptr(ip, whichfork);
#  457|-> 	int64_t			new_size = ifp->if_bytes + byte_diff;
#  458|   
#  459|   	ASSERT(new_size >= 0);

Error: GCC_ANALYZER_WARNING (CWE-476): [#def174]
xfsprogs-6.17.0/libxfs/xfs_inode_fork.c:753:19: warning[-Wanalyzer-null-dereference]: dereference of NULL '0'
xfsprogs-6.17.0/libxfs/xfs_inode_fork.c:749:12: branch_false: following 'false' branch (when 'whichfork != 2')...
xfsprogs-6.17.0/libxfs/xfs_inode_fork.c:753:19: branch_false: ...to here
xfsprogs-6.17.0/libxfs/xfs_inode_fork.c:753:19: danger: dereference of NULL 'xfs_ifork_ptr(ip,  whichfork)'
#  751|   
#  752|   	/* no point in upgrading if if_nextents overflows */
#  753|-> 	nr_exts = ifp->if_nextents + nr_to_add;
#  754|   	if (nr_exts < ifp->if_nextents)
#  755|   		return -EFBIG;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def175]
xfsprogs-6.17.0/libxfs/xfs_inode_fork.h:84:16: warning[-Wanalyzer-null-dereference]: dereference of NULL '0'
xfsprogs-6.17.0/libxfs/xfs_bmap.c:5472:1: enter_function: entry to 'libxfs_bunmapi'
xfsprogs-6.17.0/libxfs/xfs_bmap.c:5483:17: call_function: calling '__xfs_bunmapi' from 'libxfs_bunmapi'
#   82|   static inline bool xfs_ifork_has_extents(struct xfs_ifork *ifp)
#   83|   {
#   84|-> 	return ifp->if_format == XFS_DINODE_FMT_EXTENTS ||
#   85|   		ifp->if_format == XFS_DINODE_FMT_BTREE;
#   86|   }

Error: COMPILER_WARNING: [#def176]
xfsprogs-6.17.0/libxfs/xfs_log_rlimit.c: scope_hint: In function 'libxfs_log_get_max_trans_res'
xfsprogs-6.17.0/libxfs/xfs_log_rlimit.c:162:33: warning[-Wunused-but-set-variable=]: variable 'i' set but not used
#  162 |         unsigned int            i;
#      |                                 ^
#  160|   	struct xfs_trans_res	*resp;
#  161|   	struct xfs_trans_res	*end_resp;
#  162|-> 	unsigned int		i;
#  163|   	int			log_space = 0;
#  164|   	int			attr_space;

Error: GCC_ANALYZER_WARNING (CWE-457): [#def177]
xfsprogs-6.17.0/libxfs/xfs_rmap.c:361:9: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value '*irec.rm_flags'
xfsprogs-6.17.0/libxfs/xfs_rmap.c:2549:1: enter_function: entry to 'xfs_rmap_query_range_helper'
xfsprogs-6.17.0/libxfs/xfs_rmap.c:2558:14: call_function: calling 'xfs_rmap_btrec_to_irec' from 'xfs_rmap_query_range_helper'
xfsprogs-6.17.0/libxfs/xfs_rmap.c:2558:14: return_function: returning to 'xfs_rmap_query_range_helper' from 'xfs_rmap_btrec_to_irec'
xfsprogs-6.17.0/libxfs/xfs_rmap.c:2559:12: branch_false: following 'false' branch...
xfsprogs-6.17.0/libxfs/xfs_rmap.c:2562:24: branch_false: ...to here
xfsprogs-6.17.0/libxfs/xfs_rmap.c:2562:24: call_function: calling 'xfs_rmap_complain_bad_rec' from 'xfs_rmap_query_range_helper'
#  359|    "Reverse Mapping BTree record corruption in AG %d detected at %pS!",
#  360|   			cur->bc_group->xg_gno, fa);
#  361|-> 	xfs_warn(mp,
#  362|   		"Owner 0x%llx, flags 0x%x, start block 0x%x block count 0x%x",
#  363|   		irec->rm_owner, irec->rm_flags, irec->rm_startblock,

Error: GCC_ANALYZER_WARNING (CWE-457): [#def178]
xfsprogs-6.17.0/logprint/log_misc.c:1419:17: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘len’
xfsprogs-6.17.0/logprint/log_misc.c:1337:6: enter_function: entry to ‘xfs_log_print’
xfsprogs-6.17.0/logprint/log_misc.c:1360:8: branch_false: following ‘false’ branch...
xfsprogs-6.17.0/logprint/log_misc.c:1364:8: branch_false: ...to here
xfsprogs-6.17.0/logprint/log_misc.c:1364:8: branch_true: following ‘true’ branch (when ‘print_block_start == -1’)...
xfsprogs-6.17.0/logprint/log_misc.c:1365:9: branch_true: ...to here
xfsprogs-6.17.0/logprint/log_misc.c:1368:5: call_function: calling ‘xlog_print_lseek’ from ‘xfs_log_print’
xfsprogs-6.17.0/logprint/log_misc.c:1368:5: return_function: returning to ‘xfs_log_print’ from ‘xlog_print_lseek’
xfsprogs-6.17.0/logprint/log_misc.c:1372:12: branch_false: following ‘false’ branch...
xfsprogs-6.17.0/logprint/log_misc.c:1377:13: branch_false: ...to here
xfsprogs-6.17.0/logprint/log_misc.c:1386:12: branch_false: following ‘false’ branch...
xfsprogs-6.17.0/logprint/log_misc.c:1396:13: branch_false: ...to here
xfsprogs-6.17.0/logprint/log_misc.c:1396:12: branch_false: following ‘false’ branch...
xfsprogs-6.17.0/logprint/log_misc.c:1396:13: branch_false: ...to here
xfsprogs-6.17.0/logprint/log_misc.c:1396:13: branch_false: following ‘false’ branch...
xfsprogs-6.17.0/logprint/log_misc.c:1418:13: branch_false: ...to here
xfsprogs-6.17.0/logprint/log_misc.c:1418:12: branch_true: following ‘true’ branch...
xfsprogs-6.17.0/logprint/log_misc.c:1419:17: branch_true: ...to here
xfsprogs-6.17.0/logprint/log_misc.c:1419:17: danger: use of uninitialized value ‘len’ here
# 1417|   
# 1418|   	if (be32_to_cpu(hdr->h_version) == 2) {
# 1419|-> 	    if (xlog_print_extended_headers(fd, len, &blkno, hdr, &num_hdrs, &xhdrs) != 0)
# 1420|   		break;
# 1421|   	}

Error: GCC_ANALYZER_WARNING (CWE-457): [#def179]
xfsprogs-6.17.0/logprint/log_misc.c:1423:17: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘len’
xfsprogs-6.17.0/logprint/log_misc.c:1337:6: enter_function: entry to ‘xfs_log_print’
xfsprogs-6.17.0/logprint/log_misc.c:1360:8: branch_false: following ‘false’ branch...
xfsprogs-6.17.0/logprint/log_misc.c:1364:8: branch_false: ...to here
xfsprogs-6.17.0/logprint/log_misc.c:1364:8: branch_true: following ‘true’ branch (when ‘print_block_start == -1’)...
xfsprogs-6.17.0/logprint/log_misc.c:1365:9: branch_true: ...to here
xfsprogs-6.17.0/logprint/log_misc.c:1368:5: call_function: calling ‘xlog_print_lseek’ from ‘xfs_log_print’
xfsprogs-6.17.0/logprint/log_misc.c:1368:5: return_function: returning to ‘xfs_log_print’ from ‘xlog_print_lseek’
xfsprogs-6.17.0/logprint/log_misc.c:1372:12: branch_false: following ‘false’ branch...
xfsprogs-6.17.0/logprint/log_misc.c:1377:13: branch_false: ...to here
xfsprogs-6.17.0/logprint/log_misc.c:1386:12: branch_false: following ‘false’ branch...
xfsprogs-6.17.0/logprint/log_misc.c:1396:13: branch_false: ...to here
xfsprogs-6.17.0/logprint/log_misc.c:1396:12: branch_false: following ‘false’ branch...
xfsprogs-6.17.0/logprint/log_misc.c:1396:13: branch_false: ...to here
xfsprogs-6.17.0/logprint/log_misc.c:1396:13: branch_false: following ‘false’ branch...
xfsprogs-6.17.0/logprint/log_misc.c:1418:13: branch_false: ...to here
xfsprogs-6.17.0/logprint/log_misc.c:1418:12: branch_false: following ‘false’ branch...
xfsprogs-6.17.0/logprint/log_misc.c:1423:17: branch_false: ...to here
xfsprogs-6.17.0/logprint/log_misc.c:1423:17: danger: use of uninitialized value ‘len’ here
# 1421|   	}
# 1422|   
# 1423|-> 	error =	xlog_print_record(log, fd, num_ops, len, &read_type, &partial_buf,
# 1424|   				  hdr, xhdrs, first_hdr_found);
# 1425|   	first_hdr_found++;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def180]
xfsprogs-6.17.0/logprint/log_redo.c:854:17: warning[-Wanalyzer-malloc-leak]: leak of ‘src_f’
xfsprogs-6.17.0/logprint/log_redo.c:809:12: branch_false: following ‘false’ branch (when ‘src_len == 40’)...
xfsprogs-6.17.0/logprint/log_redo.c:819:17: branch_false: ...to here
xfsprogs-6.17.0/logprint/log_redo.c:819:17: acquire_memory: allocated here
xfsprogs-6.17.0/logprint/log_redo.c:820:12: branch_false: following ‘false’ branch (when ‘src_f’ is non-NULL)...
xfsprogs-6.17.0/logprint/log_redo.c:825:9: branch_false: ...to here
xfsprogs-6.17.0/logprint/log_redo.c:828:12: branch_false: following ‘false’ branch...
xfsprogs-6.17.0/logprint/log_redo.c:834:17: branch_false: ...to here
xfsprogs-6.17.0/logprint/log_redo.c:850:12: branch_true: following ‘true’ branch (when ‘name_len != 0’)...
xfsprogs-6.17.0/logprint/log_redo.c:851:24: branch_true: ...to here
xfsprogs-6.17.0/logprint/log_redo.c:854:17: throw: if ‘xlog_print_op_header’ throws an exception...
xfsprogs-6.17.0/logprint/log_redo.c:854:17: danger: ‘src_f’ leaks here; was allocated at [(3)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/2)
#  852|   		(*i)++;
#  853|   		head = (xlog_op_header_t *)*ptr;
#  854|-> 		xlog_print_op_header(head, *i, ptr);
#  855|   		name_ptr = *ptr;
#  856|   		error = xlog_print_trans_attri_name(ptr,

Error: GCC_ANALYZER_WARNING (CWE-401): [#def181]
xfsprogs-6.17.0/logprint/log_redo.c:866:17: warning[-Wanalyzer-malloc-leak]: leak of ‘src_f’
xfsprogs-6.17.0/logprint/log_redo.c:809:12: branch_false: following ‘false’ branch (when ‘src_len == 40’)...
xfsprogs-6.17.0/logprint/log_redo.c:819:17: branch_false: ...to here
xfsprogs-6.17.0/logprint/log_redo.c:819:17: acquire_memory: allocated here
xfsprogs-6.17.0/logprint/log_redo.c:820:12: branch_false: following ‘false’ branch (when ‘src_f’ is non-NULL)...
xfsprogs-6.17.0/logprint/log_redo.c:825:9: branch_false: ...to here
xfsprogs-6.17.0/logprint/log_redo.c:828:12: branch_true: following ‘true’ branch...
xfsprogs-6.17.0/logprint/log_redo.c:829:33: branch_true: ...to here
xfsprogs-6.17.0/logprint/log_redo.c:850:12: branch_false: following ‘false’ branch (when ‘name_len == 0’)...
xfsprogs-6.17.0/logprint/log_redo.c:862:12: branch_false: ...to here
xfsprogs-6.17.0/logprint/log_redo.c:862:12: branch_true: following ‘true’ branch (when ‘new_name_len != 0’)...
xfsprogs-6.17.0/logprint/log_redo.c:863:24: branch_true: ...to here
xfsprogs-6.17.0/logprint/log_redo.c:866:17: throw: if ‘xlog_print_op_header’ throws an exception...
xfsprogs-6.17.0/logprint/log_redo.c:866:17: danger: ‘src_f’ leaks here; was allocated at [(3)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/2)
#  864|   		(*i)++;
#  865|   		head = (xlog_op_header_t *)*ptr;
#  866|-> 		xlog_print_op_header(head, *i, ptr);
#  867|   		new_name_ptr = *ptr;
#  868|   		error = xlog_print_trans_attri_name(ptr,

Error: GCC_ANALYZER_WARNING (CWE-401): [#def182]
xfsprogs-6.17.0/logprint/log_redo.c:878:17: warning[-Wanalyzer-malloc-leak]: leak of ‘src_f’
xfsprogs-6.17.0/logprint/log_redo.c:809:12: branch_false: following ‘false’ branch (when ‘src_len == 40’)...
xfsprogs-6.17.0/logprint/log_redo.c:819:17: branch_false: ...to here
xfsprogs-6.17.0/logprint/log_redo.c:819:17: acquire_memory: allocated here
xfsprogs-6.17.0/logprint/log_redo.c:820:12: branch_false: following ‘false’ branch (when ‘src_f’ is non-NULL)...
xfsprogs-6.17.0/logprint/log_redo.c:825:9: branch_false: ...to here
xfsprogs-6.17.0/logprint/log_redo.c:828:12: branch_false: following ‘false’ branch...
xfsprogs-6.17.0/logprint/log_redo.c:834:17: branch_false: ...to here
xfsprogs-6.17.0/logprint/log_redo.c:850:12: branch_true: following ‘true’ branch (when ‘name_len != 0’)...
xfsprogs-6.17.0/logprint/log_redo.c:851:24: branch_true: ...to here
xfsprogs-6.17.0/logprint/log_redo.c:862:12: branch_false: following ‘false’ branch (when ‘new_name_len == 0’)...
xfsprogs-6.17.0/logprint/log_redo.c:874:12: branch_false: ...to here
xfsprogs-6.17.0/logprint/log_redo.c:874:12: branch_true: following ‘true’ branch (when ‘value_len != 0’)...
xfsprogs-6.17.0/logprint/log_redo.c:875:24: branch_true: ...to here
xfsprogs-6.17.0/logprint/log_redo.c:878:17: throw: if ‘xlog_print_op_header’ throws an exception...
xfsprogs-6.17.0/logprint/log_redo.c:878:17: danger: ‘src_f’ leaks here; was allocated at [(3)](sarif:/runs/0/results/2/codeFlows/0/threadFlows/0/locations/2)
#  876|   		(*i)++;
#  877|   		head = (xlog_op_header_t *)*ptr;
#  878|-> 		xlog_print_op_header(head, *i, ptr);
#  879|   		value_ptr = *ptr;
#  880|   		error = xlog_print_trans_attri_value(ptr,

Error: GCC_ANALYZER_WARNING (CWE-401): [#def183]
xfsprogs-6.17.0/logprint/log_redo.c:890:17: warning[-Wanalyzer-malloc-leak]: leak of ‘src_f’
xfsprogs-6.17.0/logprint/log_redo.c:809:12: branch_false: following ‘false’ branch (when ‘src_len == 40’)...
xfsprogs-6.17.0/logprint/log_redo.c:819:17: branch_false: ...to here
xfsprogs-6.17.0/logprint/log_redo.c:819:17: acquire_memory: allocated here
xfsprogs-6.17.0/logprint/log_redo.c:820:12: branch_false: following ‘false’ branch (when ‘src_f’ is non-NULL)...
xfsprogs-6.17.0/logprint/log_redo.c:825:9: branch_false: ...to here
xfsprogs-6.17.0/logprint/log_redo.c:828:12: branch_true: following ‘true’ branch...
xfsprogs-6.17.0/logprint/log_redo.c:829:33: branch_true: ...to here
xfsprogs-6.17.0/logprint/log_redo.c:850:12: branch_true: following ‘true’ branch (when ‘name_len != 0’)...
xfsprogs-6.17.0/logprint/log_redo.c:851:24: branch_true: ...to here
xfsprogs-6.17.0/logprint/log_redo.c:862:12: branch_false: following ‘false’ branch (when ‘new_name_len == 0’)...
xfsprogs-6.17.0/logprint/log_redo.c:874:12: branch_false: ...to here
xfsprogs-6.17.0/logprint/log_redo.c:874:12: branch_true: following ‘true’ branch (when ‘value_len != 0’)...
xfsprogs-6.17.0/logprint/log_redo.c:875:24: branch_true: ...to here
xfsprogs-6.17.0/logprint/log_redo.c:886:12: branch_true: following ‘true’ branch (when ‘new_value_len != 0’)...
xfsprogs-6.17.0/logprint/log_redo.c:887:24: branch_true: ...to here
xfsprogs-6.17.0/logprint/log_redo.c:890:17: throw: if ‘xlog_print_op_header’ throws an exception...
xfsprogs-6.17.0/logprint/log_redo.c:890:17: danger: ‘src_f’ leaks here; was allocated at [(3)](sarif:/runs/0/results/3/codeFlows/0/threadFlows/0/locations/2)
#  888|   		(*i)++;
#  889|   		head = (xlog_op_header_t *)*ptr;
#  890|-> 		xlog_print_op_header(head, *i, ptr);
#  891|   		new_value_ptr = *ptr;
#  892|   		error = xlog_print_trans_attri_value(ptr,

Error: GCC_ANALYZER_WARNING (CWE-401): [#def184]
xfsprogs-6.17.0/logprint/log_redo.c:917:9: warning[-Wanalyzer-malloc-leak]: leak of ‘src_f’
xfsprogs-6.17.0/logprint/log_redo.c:790:1: enter_function: entry to ‘xlog_print_trans_attri’
xfsprogs-6.17.0/logprint/log_redo.c:809:12: branch_false: following ‘false’ branch (when ‘src_len == 40’)...
xfsprogs-6.17.0/logprint/log_redo.c:819:17: branch_false: ...to here
xfsprogs-6.17.0/logprint/log_redo.c:819:17: acquire_memory: allocated here
xfsprogs-6.17.0/logprint/log_redo.c:820:12: branch_false: following ‘false’ branch (when ‘src_f’ is non-NULL)...
xfsprogs-6.17.0/logprint/log_redo.c:825:9: branch_false: ...to here
xfsprogs-6.17.0/logprint/log_redo.c:828:12: branch_false: following ‘false’ branch...
xfsprogs-6.17.0/logprint/log_redo.c:834:17: branch_false: ...to here
xfsprogs-6.17.0/logprint/log_redo.c:850:12: branch_true: following ‘true’ branch (when ‘name_len != 0’)...
xfsprogs-6.17.0/logprint/log_redo.c:851:24: branch_true: ...to here
xfsprogs-6.17.0/logprint/log_redo.c:856:25: call_function: calling ‘xlog_print_trans_attri_name’ from ‘xlog_print_trans_attri’
#  915|   {
#  916|   	printf(_("ATTRI:  %s len:%u\n"), tag, src_len);
#  917|-> 	print_or_dump(*ptr, src_len);
#  918|   
#  919|   	*ptr += src_len;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def185]
xfsprogs-6.17.0/logprint/log_redo.c:934:9: warning[-Wanalyzer-malloc-leak]: leak of ‘src_f’
xfsprogs-6.17.0/logprint/log_redo.c:790:1: enter_function: entry to ‘xlog_print_trans_attri’
xfsprogs-6.17.0/logprint/log_redo.c:809:12: branch_false: following ‘false’ branch (when ‘src_len == 40’)...
xfsprogs-6.17.0/logprint/log_redo.c:819:17: branch_false: ...to here
xfsprogs-6.17.0/logprint/log_redo.c:819:17: acquire_memory: allocated here
xfsprogs-6.17.0/logprint/log_redo.c:820:12: branch_false: following ‘false’ branch (when ‘src_f’ is non-NULL)...
xfsprogs-6.17.0/logprint/log_redo.c:825:9: branch_false: ...to here
xfsprogs-6.17.0/logprint/log_redo.c:828:12: branch_false: following ‘false’ branch...
xfsprogs-6.17.0/logprint/log_redo.c:834:17: branch_false: ...to here
xfsprogs-6.17.0/logprint/log_redo.c:850:12: branch_true: following ‘true’ branch (when ‘name_len != 0’)...
xfsprogs-6.17.0/logprint/log_redo.c:851:24: branch_true: ...to here
xfsprogs-6.17.0/logprint/log_redo.c:862:12: branch_false: following ‘false’ branch (when ‘new_name_len == 0’)...
xfsprogs-6.17.0/logprint/log_redo.c:874:12: branch_false: ...to here
xfsprogs-6.17.0/logprint/log_redo.c:874:12: branch_true: following ‘true’ branch (when ‘value_len != 0’)...
xfsprogs-6.17.0/logprint/log_redo.c:875:24: branch_true: ...to here
xfsprogs-6.17.0/logprint/log_redo.c:880:25: call_function: calling ‘xlog_print_trans_attri_value’ from ‘xlog_print_trans_attri’
#  932|   
#  933|   	printf(_("ATTRI:  %s len:%u\n"), tag, value_len);
#  934|-> 	print_or_dump(*ptr, len);
#  935|   
#  936|   	*ptr += src_len;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def186]
xfsprogs-6.17.0/logprint/log_redo.c:999:17: warning[-Wanalyzer-malloc-leak]: leak of ‘f’
xfsprogs-6.17.0/logprint/log_redo.c:942:1: enter_function: entry to ‘xlog_recover_print_attri’
xfsprogs-6.17.0/logprint/log_redo.c:966:50: acquire_memory: allocated here
xfsprogs-6.17.0/logprint/log_redo.c:966:12: branch_false: following ‘false’ branch (when ‘f’ is non-NULL)...
xfsprogs-6.17.0/logprint/log_redo.c:971:13: branch_false: ...to here
xfsprogs-6.17.0/logprint/log_redo.c:971:12: branch_false: following ‘false’ branch...
xfsprogs-6.17.0/logprint/log_redo.c:974:13: call_function: inlined call to ‘xfs_attr_log_item_op’ from ‘xlog_recover_print_attri’
xfsprogs-6.17.0/logprint/log_redo.c:996:12: branch_true: following ‘true’ branch (when ‘name_len != 0’)...
xfsprogs-6.17.0/logprint/log_redo.c:998:24: branch_true: ...to here
xfsprogs-6.17.0/logprint/log_redo.c:999:17: throw: if ‘print_or_dump’ throws an exception...
xfsprogs-6.17.0/logprint/log_redo.c:999:17: danger: ‘f’ leaks here; was allocated at [(2)](sarif:/runs/0/results/6/codeFlows/0/threadFlows/0/locations/1)
#  997|   		region++;
#  998|   		printf(_("ATTRI:  name len:%u\n"), name_len);
#  999|-> 		print_or_dump((char *)item->ri_buf[region].iov_base,
# 1000|   			       name_len);
# 1001|   		name_ptr = item->ri_buf[region].iov_base;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def187]
xfsprogs-6.17.0/logprint/log_redo.c:1007:17: warning[-Wanalyzer-malloc-leak]: leak of ‘f’
xfsprogs-6.17.0/logprint/log_redo.c:942:1: enter_function: entry to ‘xlog_recover_print_attri’
xfsprogs-6.17.0/logprint/log_redo.c:966:50: acquire_memory: allocated here
xfsprogs-6.17.0/logprint/log_redo.c:966:12: branch_false: following ‘false’ branch (when ‘f’ is non-NULL)...
xfsprogs-6.17.0/logprint/log_redo.c:971:13: branch_false: ...to here
xfsprogs-6.17.0/logprint/log_redo.c:971:12: branch_false: following ‘false’ branch...
xfsprogs-6.17.0/logprint/log_redo.c:974:13: call_function: inlined call to ‘xfs_attr_log_item_op’ from ‘xlog_recover_print_attri’
xfsprogs-6.17.0/logprint/log_redo.c:996:12: branch_false: following ‘false’ branch (when ‘name_len == 0’)...
xfsprogs-6.17.0/logprint/log_redo.c:1004:12: branch_false: ...to here
xfsprogs-6.17.0/logprint/log_redo.c:1004:12: branch_true: following ‘true’ branch (when ‘new_name_len != 0’)...
xfsprogs-6.17.0/logprint/log_redo.c:1005:17: branch_true: ...to here
xfsprogs-6.17.0/logprint/log_redo.c:1007:17: throw: if ‘print_or_dump’ throws an exception...
xfsprogs-6.17.0/logprint/log_redo.c:1007:17: danger: ‘f’ leaks here; was allocated at [(2)](sarif:/runs/0/results/7/codeFlows/0/threadFlows/0/locations/1)
# 1005|   		region++;
# 1006|   		printf(_("ATTRI:  newname len:%u\n"), new_name_len);
# 1007|-> 		print_or_dump((char *)item->ri_buf[region].iov_base,
# 1008|   			       new_name_len);
# 1009|   		new_name_ptr = item->ri_buf[region].iov_base;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def188]
xfsprogs-6.17.0/logprint/log_redo.c:1017:17: warning[-Wanalyzer-malloc-leak]: leak of ‘f’
xfsprogs-6.17.0/logprint/log_redo.c:942:1: enter_function: entry to ‘xlog_recover_print_attri’
xfsprogs-6.17.0/logprint/log_redo.c:966:50: acquire_memory: allocated here
xfsprogs-6.17.0/logprint/log_redo.c:966:12: branch_false: following ‘false’ branch (when ‘f’ is non-NULL)...
xfsprogs-6.17.0/logprint/log_redo.c:971:13: branch_false: ...to here
xfsprogs-6.17.0/logprint/log_redo.c:971:12: branch_false: following ‘false’ branch...
xfsprogs-6.17.0/logprint/log_redo.c:974:13: call_function: inlined call to ‘xfs_attr_log_item_op’ from ‘xlog_recover_print_attri’
xfsprogs-6.17.0/logprint/log_redo.c:996:12: branch_false: following ‘false’ branch (when ‘name_len == 0’)...
xfsprogs-6.17.0/logprint/log_redo.c:1004:12: branch_false: ...to here
xfsprogs-6.17.0/logprint/log_redo.c:1004:12: branch_false: following ‘false’ branch (when ‘new_name_len == 0’)...
xfsprogs-6.17.0/logprint/log_redo.c:1012:12: branch_false: ...to here
xfsprogs-6.17.0/logprint/log_redo.c:1012:12: branch_true: following ‘true’ branch (when ‘value_len != 0’)...
xfsprogs-6.17.0/logprint/log_redo.c:1013:31: branch_true: ...to here
xfsprogs-6.17.0/logprint/log_redo.c:1017:17: throw: if ‘print_or_dump’ throws an exception...
xfsprogs-6.17.0/logprint/log_redo.c:1017:17: danger: ‘f’ leaks here; was allocated at [(2)](sarif:/runs/0/results/8/codeFlows/0/threadFlows/0/locations/1)
# 1015|   		region++;
# 1016|   		printf(_("ATTRI:  value len:%u\n"), value_len);
# 1017|-> 		print_or_dump((char *)item->ri_buf[region].iov_base, len);
# 1018|   		value_ptr = item->ri_buf[region].iov_base;
# 1019|   	}

Error: GCC_ANALYZER_WARNING (CWE-401): [#def189]
xfsprogs-6.17.0/logprint/log_redo.c:1026:17: warning[-Wanalyzer-malloc-leak]: leak of ‘f’
xfsprogs-6.17.0/logprint/log_redo.c:942:1: enter_function: entry to ‘xlog_recover_print_attri’
xfsprogs-6.17.0/logprint/log_redo.c:966:50: acquire_memory: allocated here
xfsprogs-6.17.0/logprint/log_redo.c:966:12: branch_false: following ‘false’ branch (when ‘f’ is non-NULL)...
xfsprogs-6.17.0/logprint/log_redo.c:971:13: branch_false: ...to here
xfsprogs-6.17.0/logprint/log_redo.c:971:12: branch_false: following ‘false’ branch...
xfsprogs-6.17.0/logprint/log_redo.c:974:13: call_function: inlined call to ‘xfs_attr_log_item_op’ from ‘xlog_recover_print_attri’
xfsprogs-6.17.0/logprint/log_redo.c:996:12: branch_false: following ‘false’ branch (when ‘name_len == 0’)...
xfsprogs-6.17.0/logprint/log_redo.c:1004:12: branch_false: ...to here
xfsprogs-6.17.0/logprint/log_redo.c:1004:12: branch_false: following ‘false’ branch (when ‘new_name_len == 0’)...
xfsprogs-6.17.0/logprint/log_redo.c:1012:12: branch_false: ...to here
xfsprogs-6.17.0/logprint/log_redo.c:1012:12: branch_true: following ‘true’ branch (when ‘value_len != 0’)...
xfsprogs-6.17.0/logprint/log_redo.c:1013:31: branch_true: ...to here
xfsprogs-6.17.0/logprint/log_redo.c:1021:12: branch_true: following ‘true’ branch (when ‘new_value_len != 0’)...
xfsprogs-6.17.0/logprint/log_redo.c:1022:31: branch_true: ...to here
xfsprogs-6.17.0/logprint/log_redo.c:1026:17: throw: if ‘print_or_dump’ throws an exception...
xfsprogs-6.17.0/logprint/log_redo.c:1026:17: danger: ‘f’ leaks here; was allocated at [(2)](sarif:/runs/0/results/9/codeFlows/0/threadFlows/0/locations/1)
# 1024|   		region++;
# 1025|   		printf(_("ATTRI:  newvalue len:%u\n"), new_value_len);
# 1026|-> 		print_or_dump((char *)item->ri_buf[region].iov_base, len);
# 1027|   		new_value_ptr = item->ri_buf[region].iov_base;
# 1028|   	}

Error: GCC_ANALYZER_WARNING (CWE-775): [#def190]
xfsprogs-6.17.0/logprint/logprint.c:114:17: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘open(x.log.name, 0)’
xfsprogs-6.17.0/logprint/logprint.c:67:12: branch_false: following ‘false’ branch...
xfsprogs-6.17.0/logprint/logprint.c:72:9: branch_false: ...to here
xfsprogs-6.17.0/logprint/logprint.c:73:12: branch_false: following ‘false’ branch...
xfsprogs-6.17.0/logprint/logprint.c:77:9: branch_false: ...to here
xfsprogs-6.17.0/logprint/logprint.c:79:12: branch_false: following ‘false’ branch...
xfsprogs-6.17.0/logprint/logprint.c:80:34: branch_false: ...to here
xfsprogs-6.17.0/logprint/logprint.c:108:12: branch_true: following ‘true’ branch...
xfsprogs-6.17.0/logprint/logprint.c:109:27: acquire_resource: opened here
xfsprogs-6.17.0/logprint/logprint.c:109:20: branch_false: following ‘false’ branch...
xfsprogs-6.17.0/logprint/logprint.c:114:17: branch_false: ...to here
xfsprogs-6.17.0/logprint/logprint.c:114:17: danger: ‘open(x.log.name, 0)’ leaks here; was opened at [(9)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/8)
#  112|   			exit(1);
#  113|   		}
#  114|-> 		close(fd);
#  115|   	} else {                            /* Internal log */
#  116|   		x.log.dev = x.data.dev;

Error: GCC_ANALYZER_WARNING (CWE-617): [#def191]
xfsprogs-6.17.0/mdrestore/xfs_mdrestore.c:53:9: warning[-Wanalyzer-tainted-assertion]: use of attacked-controlled value in condition for assertion
xfsprogs-6.17.0/mdrestore/xfs_mdrestore.c:418:1: enter_function: entry to ‘restore_v2’
xfsprogs-6.17.0/mdrestore/xfs_mdrestore.c:434:12: branch_false: following ‘false’ branch (when ‘block_buffer’ is non-NULL)...
xfsprogs-6.17.0/mdrestore/xfs_mdrestore.c:437:13: branch_false: ...to here
xfsprogs-6.17.0/mdrestore/xfs_mdrestore.c:437:12: branch_false: following ‘false’ branch...
xfsprogs-6.17.0/mdrestore/xfs_mdrestore.c:440:13: branch_false: ...to here
xfsprogs-6.17.0/mdrestore/xfs_mdrestore.c:443:17: call_function: calling ‘fatal’ from ‘restore_v2’
#   51|   	fprintf(stderr, "%s: ", progname);
#   52|   	vfprintf(stderr, msg, args);
#   53|-> 	exit(1);
#   54|   }
#   55|   

Error: GCC_ANALYZER_WARNING (CWE-688): [#def192]
xfsprogs-6.17.0/mdrestore/xfs_mdrestore.c:133:13: warning[-Wanalyzer-null-argument]: use of NULL ‘path’ where non-null expected
xfsprogs-6.17.0/mdrestore/xfs_mdrestore.c:536:1: enter_function: entry to ‘main’
xfsprogs-6.17.0/mdrestore/xfs_mdrestore.c:581:12: branch_false: following ‘false’ branch...
xfsprogs-6.17.0/mdrestore/xfs_mdrestore.c:585:14: branch_false: ...to here
xfsprogs-6.17.0/mdrestore/xfs_mdrestore.c:594:12: branch_true: following ‘true’ branch (when the strings are equal)...
xfsprogs-6.17.0/mdrestore/xfs_mdrestore.c:595:17: branch_true: ...to here
xfsprogs-6.17.0/mdrestore/xfs_mdrestore.c:596:20: branch_false: following ‘false’ branch...
xfsprogs-6.17.0/mdrestore/xfs_mdrestore.c:604:13: branch_false: ...to here
xfsprogs-6.17.0/mdrestore/xfs_mdrestore.c:604:12: branch_false: following ‘false’ branch...
xfsprogs-6.17.0/mdrestore/xfs_mdrestore.c:607:17: branch_false: ...to here
xfsprogs-6.17.0/mdrestore/xfs_mdrestore.c:609:20: branch_false: following ‘false’ branch (when ‘logdev_path’ is NULL)...
xfsprogs-6.17.0/mdrestore/xfs_mdrestore.c:611:17: branch_false: ...to here
xfsprogs-6.17.0/mdrestore/xfs_mdrestore.c:623:9: call_function: calling ‘read_header_v1’ from ‘main’
xfsprogs-6.17.0/mdrestore/xfs_mdrestore.c:623:9: return_function: returning to ‘main’ from ‘read_header_v1’
xfsprogs-6.17.0/mdrestore/xfs_mdrestore.c:635:9: call_function: calling ‘open_device’ from ‘main’
xfsprogs-6.17.0/mdrestore/xfs_mdrestore.c:635:9: return_function: returning to ‘main’ from ‘open_device’
xfsprogs-6.17.0/mdrestore/xfs_mdrestore.c:642:12: branch_true: following ‘true’ branch...
xfsprogs-6.17.0/mdrestore/xfs_mdrestore.c:643:17: branch_true: ...to here
xfsprogs-6.17.0/mdrestore/xfs_mdrestore.c:643:17: call_function: calling ‘open_device’ from ‘main’
#  131|   	dev->is_file = false;
#  132|   
#  133|-> 	if (stat(path, &statbuf) < 0)  {
#  134|   		/* ok, assume it's a file and create it */
#  135|   		open_flags |= O_CREAT;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def193]
xfsprogs-6.17.0/mdrestore/xfs_mdrestore.c:277:9: warning[-Wanalyzer-malloc-leak]: leak of ‘metablock’
xfsprogs-6.17.0/mdrestore/xfs_mdrestore.c:256:40: acquire_memory: allocated here
xfsprogs-6.17.0/mdrestore/xfs_mdrestore.c:257:12: branch_false: following ‘false’ branch (when ‘metablock’ is non-NULL)...
xfsprogs-6.17.0/mdrestore/xfs_mdrestore.c:260:20: branch_false: ...to here
xfsprogs-6.17.0/mdrestore/xfs_mdrestore.c:261:12: branch_false: following ‘false’ branch...
xfsprogs-6.17.0/mdrestore/xfs_mdrestore.c:264:9: branch_false: ...to here
xfsprogs-6.17.0/mdrestore/xfs_mdrestore.c:267:12: branch_false: following ‘false’ branch...
xfsprogs-6.17.0/mdrestore/xfs_mdrestore.c:271:13: branch_false: ...to here
xfsprogs-6.17.0/mdrestore/xfs_mdrestore.c:271:12: branch_false: following ‘false’ branch...
xfsprogs-6.17.0/mdrestore/xfs_mdrestore.c:274:45: branch_false: ...to here
xfsprogs-6.17.0/mdrestore/xfs_mdrestore.c:274:12: branch_false: following ‘false’ branch...
xfsprogs-6.17.0/mdrestore/xfs_mdrestore.c:277:9: branch_false: ...to here
xfsprogs-6.17.0/mdrestore/xfs_mdrestore.c:277:9: throw: if ‘libxfs_sb_from_disk’ throws an exception...
xfsprogs-6.17.0/mdrestore/xfs_mdrestore.c:277:9: danger: ‘metablock’ leaks here; was allocated at [(1)](sarif:/runs/0/results/2/codeFlows/0/threadFlows/0/locations/0)
#  275|   		fatal("error reading from metadump file\n");
#  276|   
#  277|-> 	libxfs_sb_from_disk(&sb, (struct xfs_dsb *)block_buffer);
#  278|   
#  279|   	if (sb.sb_magicnum != XFS_SB_MAGIC)

Error: GCC_ANALYZER_WARNING (CWE-401): [#def194]
xfsprogs-6.17.0/mdrestore/xfs_mdrestore.c:450:9: warning[-Wanalyzer-malloc-leak]: leak of ‘block_buffer’
xfsprogs-6.17.0/mdrestore/xfs_mdrestore.c:433:24: acquire_memory: allocated here
xfsprogs-6.17.0/mdrestore/xfs_mdrestore.c:434:12: branch_false: following ‘false’ branch (when ‘block_buffer’ is non-NULL)...
xfsprogs-6.17.0/mdrestore/xfs_mdrestore.c:437:13: branch_false: ...to here
xfsprogs-6.17.0/mdrestore/xfs_mdrestore.c:437:12: branch_false: following ‘false’ branch...
xfsprogs-6.17.0/mdrestore/xfs_mdrestore.c:440:13: branch_false: ...to here
xfsprogs-6.17.0/mdrestore/xfs_mdrestore.c:440:12: branch_false: following ‘false’ branch...
xfsprogs-6.17.0/mdrestore/xfs_mdrestore.c:447:12: branch_false: following ‘false’ branch...
xfsprogs-6.17.0/mdrestore/xfs_mdrestore.c:450:9: branch_false: ...to here
xfsprogs-6.17.0/mdrestore/xfs_mdrestore.c:450:9: throw: if ‘libxfs_sb_from_disk’ throws an exception...
xfsprogs-6.17.0/mdrestore/xfs_mdrestore.c:450:9: danger: ‘block_buffer’ leaks here; was allocated at [(1)](sarif:/runs/0/results/3/codeFlows/0/threadFlows/0/locations/0)
#  448|   		fatal("error reading from metadump file\n");
#  449|   
#  450|-> 	libxfs_sb_from_disk(&sb, (struct xfs_dsb *)block_buffer);
#  451|   
#  452|   	if (sb.sb_magicnum != XFS_SB_MAGIC)

Error: GCC_ANALYZER_WARNING (CWE-457): [#def195]
xfsprogs-6.17.0/mkfs/proto.c:1487:9: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘ip’
xfsprogs-6.17.0/mkfs/proto.c:1784:1: enter_function: entry to ‘walk_dir’
xfsprogs-6.17.0/mkfs/proto.c:1798:12: branch_false: following ‘false’ branch...
xfsprogs-6.17.0/mkfs/proto.c:1798:12: branch_false: ...to here
xfsprogs-6.17.0/mkfs/proto.c:1803:16: branch_true: following ‘true’ branch...
xfsprogs-6.17.0/mkfs/proto.c:1804:28: branch_true: ...to here
xfsprogs-6.17.0/mkfs/proto.c:1808:17: call_function: calling ‘handle_direntry’ from ‘walk_dir’
# 1485|   	libxfs_trans_ijoin(tp, pip, 0);
# 1486|   
# 1487|-> 	newdirent(mp, tp, pip, &xname, ip, ppargs);
# 1488|   
# 1489|   	libxfs_bumplink(tp, pip);

Error: GCC_ANALYZER_WARNING (CWE-457): [#def196]
xfsprogs-6.17.0/mkfs/proto.c:1581:9: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘ip’
xfsprogs-6.17.0/mkfs/proto.c:1784:1: enter_function: entry to ‘walk_dir’
xfsprogs-6.17.0/mkfs/proto.c:1798:12: branch_false: following ‘false’ branch...
xfsprogs-6.17.0/mkfs/proto.c:1798:12: branch_false: ...to here
xfsprogs-6.17.0/mkfs/proto.c:1803:16: branch_true: following ‘true’ branch...
xfsprogs-6.17.0/mkfs/proto.c:1804:28: branch_true: ...to here
xfsprogs-6.17.0/mkfs/proto.c:1808:17: call_function: calling ‘handle_direntry’ from ‘walk_dir’
# 1579|   
# 1580|   	libxfs_trans_ijoin(tp, pip, 0);
# 1581|-> 	newdirent(mp, tp, pip, &xname, ip, ppargs);
# 1582|   
# 1583|   	/*

Error: GCC_ANALYZER_WARNING (CWE-775): [#def197]
xfsprogs-6.17.0/mkfs/proto.c:1653:29: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘open(path_buf, 2228224)’
xfsprogs-6.17.0/mkfs/proto.c:1642:18: acquire_resource: opened here
xfsprogs-6.17.0/mkfs/proto.c:1643:12: branch_false: following ‘false’ branch...
xfsprogs-6.17.0/mkfs/proto.c:1653:29: branch_false: ...to here
xfsprogs-6.17.0/mkfs/proto.c:1653:14: throw: if ‘openat’ throws an exception...
xfsprogs-6.17.0/mkfs/proto.c:1653:29: danger: ‘open(path_buf, 2228224)’ leaks here; was opened at [(1)](sarif:/runs/0/results/4/codeFlows/0/threadFlows/0/locations/0)
# 1651|   	 * we handle this special case.
# 1652|   	 */
# 1653|-> 	fd = openat(pathfd, entry->d_name, O_NOFOLLOW | O_PATH);
# 1654|   	if(fd < 0) {
# 1655|   		fprintf(stderr, _("%s: cannot open %s: %s\n"), progname,

Error: GCC_ANALYZER_WARNING (CWE-401): [#def198]
xfsprogs-6.17.0/mkfs/proto.c:1803:25: warning[-Wanalyzer-malloc-leak]: leak of ‘opendir(path_buf)’
xfsprogs-6.17.0/mkfs/proto.c:1798:20: acquire_memory: allocated here
xfsprogs-6.17.0/mkfs/proto.c:1798:12: branch_false: following ‘false’ branch...
xfsprogs-6.17.0/mkfs/proto.c:1798:12: branch_false: ...to here
xfsprogs-6.17.0/mkfs/proto.c:1803:25: throw: if ‘readdir’ throws an exception...
xfsprogs-6.17.0/mkfs/proto.c:1803:25: danger: ‘opendir(path_buf)’ leaks here; was allocated at [(1)](sarif:/runs/0/results/5/codeFlows/0/threadFlows/0/locations/0)
# 1801|   		exit(1);
# 1802|   	}
# 1803|-> 	while ((entry = readdir(dir)) != NULL) {
# 1804|   		if (strcmp(entry->d_name, ".") == 0 ||
# 1805|   		    strcmp(entry->d_name, "..") == 0)

Error: GCC_ANALYZER_WARNING (CWE-775): [#def199]
xfsprogs-6.17.0/mkfs/proto.c:1852:27: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘open(&path_buf, 393216)’
xfsprogs-6.17.0/mkfs/proto.c:1814:1: enter_function: entry to ‘populate_from_dir’
xfsprogs-6.17.0/mkfs/proto.c:1833:12: branch_false: following ‘false’ branch...
xfsprogs-6.17.0/mkfs/proto.c:1836:13: branch_false: ...to here
xfsprogs-6.17.0/mkfs/proto.c:1836:12: branch_false: following ‘false’ branch...
xfsprogs-6.17.0/mkfs/proto.c:1841:14: branch_false: ...to here
xfsprogs-6.17.0/mkfs/proto.c:1841:14: acquire_resource: opened here
xfsprogs-6.17.0/mkfs/proto.c:1842:12: branch_false: following ‘false’ branch...
xfsprogs-6.17.0/mkfs/proto.c:1852:27: branch_false: ...to here
xfsprogs-6.17.0/mkfs/proto.c:1857:14: call_function: calling ‘getres’ from ‘populate_from_dir’
# 1850|   	 */
# 1851|   	struct cred creds = {
# 1852|-> 		.cr_uid = file_stat.st_uid,
# 1853|   		.cr_gid = file_stat.st_gid,
# 1854|   	};

Error: GCC_ANALYZER_WARNING (CWE-401): [#def200]
xfsprogs-6.17.0/mkfs/xfs_mkfs.c:1518:15: warning[-Wanalyzer-malloc-leak]: leak of ‘buf’
xfsprogs-6.17.0/mkfs/xfs_mkfs.c:5465:1: enter_function: entry to ‘prepare_devices’
xfsprogs-6.17.0/mkfs/xfs_mkfs.c:5482:12: branch_true: following ‘true’ branch (when ‘clear_stale != 0’)...
xfsprogs-6.17.0/mkfs/xfs_mkfs.c:5483:17: branch_true: ...to here
xfsprogs-6.17.0/mkfs/xfs_mkfs.c:5483:17: call_function: calling ‘zero_old_xfs_structures’ from ‘prepare_devices’
# 1516|   	 * case.
# 1517|   	 */
# 1518|-> 	off = pread(xi->data.fd, buf, new_sb->sb_sectsize, 0);
# 1519|   	if (off != new_sb->sb_sectsize) {
# 1520|   		if (!xi->data.isfile)

Error: GCC_ANALYZER_WARNING (CWE-401): [#def201]
xfsprogs-6.17.0/mkfs/xfs_mkfs.c:5738:17: warning[-Wanalyzer-malloc-leak]: leak of ‘xi.data.name’
xfsprogs-6.17.0/mkfs/xfs_mkfs.c:5912:1: enter_function: entry to ‘main’
xfsprogs-6.17.0/mkfs/xfs_mkfs.c:6058:12: branch_false: following ‘false’ branch...
xfsprogs-6.17.0/mkfs/xfs_mkfs.c:6061:19: branch_false: ...to here
xfsprogs-6.17.0/mkfs/xfs_mkfs.c:6061:19: branch_true: following ‘true’ branch...
xfsprogs-6.17.0/mkfs/xfs_mkfs.c:6062:43: branch_true: ...to here
xfsprogs-6.17.0/mkfs/xfs_mkfs.c:6062:32: call_function: calling ‘getstr’ from ‘main’
xfsprogs-6.17.0/mkfs/xfs_mkfs.c:6062:32: return_function: returning to ‘main’ from ‘getstr’
xfsprogs-6.17.0/mkfs/xfs_mkfs.c:6071:9: call_function: calling ‘cfgfile_parse’ from ‘main’
# 5736|   		return;
# 5737|   
# 5738|-> 	error = ini_parse(cli->cfgfile, cfgfile_parse_ini, cli);
# 5739|   	if (error) {
# 5740|   		if (error > 0) {

Error: GCC_ANALYZER_WARNING (CWE-126): [#def202]
xfsprogs-6.17.0/quota/edit.c:342:25: warning[-Wanalyzer-out-of-bounds]: stack-based buffer over-read
xfsprogs-6.17.0/quota/edit.c:336:16: branch_true: following ‘true’ branch...
xfsprogs-6.17.0/quota/edit.c:337:21: branch_true: ...to here
xfsprogs-6.17.0/quota/edit.c:337:20: branch_true: following ‘true’ branch...
xfsprogs-6.17.0/quota/edit.c:342:25: branch_true: ...to here
xfsprogs-6.17.0/quota/edit.c:342:25: danger: out-of-bounds read from byte 512 till byte 515 but ‘buffer’ ends at byte 512
#  340|   			 * newline, and move on to the next line.
#  341|   			 */
#  342|-> 			strncpy(dev, buffer + 5, sizeof(dev) - 1);
#  343|   			dev[strlen(dev) - 1] = '\0';
#  344|   			continue;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def203]
xfsprogs-6.17.0/repair/agbtree.c:416:37: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’
xfsprogs-6.17.0/repair/agbtree.c:395:1: enter_function: entry to ‘get_inobt_records’
xfsprogs-6.17.0/repair/agbtree.c:406:16: branch_true: following ‘true’ branch (when ‘loaded < nr_wanted’)...
xfsprogs-6.17.0/repair/agbtree.c:413:42: branch_true: ...to here
xfsprogs-6.17.0/repair/agbtree.c:413:42: call_function: calling ‘get_ino_rec’ from ‘get_inobt_records’
xfsprogs-6.17.0/repair/agbtree.c:413:42: return_function: returning to ‘get_inobt_records’ from ‘get_ino_rec’
xfsprogs-6.17.0/repair/agbtree.c:413:17: release_memory: using NULL here
xfsprogs-6.17.0/repair/agbtree.c:416:37: danger: dereference of NULL ‘get_ino_rec(cur, *(struct bt_rebuild *)priv.<U 3c0>.<U 320>.ino_rec)’
#  414|   
#  415|   		/* Transform the incore record into an on-disk record. */
#  416|-> 		irec->ir_startino = ino_rec->ino_startnum;
#  417|   		irec->ir_free = ino_rec->ir_free;
#  418|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def204]
xfsprogs-6.17.0/repair/attr_repair.c:62:20: warning[-Wanalyzer-malloc-leak]: leak of ‘calloc(1, (long unsigned int)(*mp.m_sb.sb_blocksize >> 3))’
xfsprogs-6.17.0/repair/attr_repair.c:1316:1: enter_function: entry to ‘process_attributes’
xfsprogs-6.17.0/repair/attr_repair.c:1329:12: branch_false: following ‘false’ branch (when ‘aformat != 1’)...
xfsprogs-6.17.0/repair/attr_repair.c:1333:20: branch_false: ...to here
xfsprogs-6.17.0/repair/attr_repair.c:1333:19: branch_true: following ‘true’ branch...
xfsprogs-6.17.0/repair/attr_repair.c:1335:31: branch_true: ...to here
xfsprogs-6.17.0/repair/attr_repair.c:1335:31: call_function: calling ‘process_longform_attr’ from ‘process_attributes’
#   60|   	}
#   61|   
#   62|-> 	if (stop > mp->m_sb.sb_blocksize)  {
#   63|   		do_warn(
#   64|   	_("byte range end [%d %d) in da block larger than blocksize %d\n"),

Error: GCC_ANALYZER_WARNING (CWE-476): [#def205]
xfsprogs-6.17.0/repair/attr_repair.c:70:21: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘map’
xfsprogs-6.17.0/repair/attr_repair.c:1316:1: enter_function: entry to ‘process_attributes’
xfsprogs-6.17.0/repair/attr_repair.c:1329:12: branch_false: following ‘false’ branch (when ‘aformat != 1’)...
xfsprogs-6.17.0/repair/attr_repair.c:1333:20: branch_false: ...to here
xfsprogs-6.17.0/repair/attr_repair.c:1333:19: branch_true: following ‘true’ branch...
xfsprogs-6.17.0/repair/attr_repair.c:1335:31: branch_true: ...to here
xfsprogs-6.17.0/repair/attr_repair.c:1335:31: call_function: calling ‘process_longform_attr’ from ‘process_attributes’
#   68|   
#   69|   	for (i = start; i < stop; i ++)  {
#   70|-> 		if (map[i / NBBY] & (mask << i % NBBY))  {
#   71|   			do_warn(_("multiply claimed byte %d in da block\n"), i);
#   72|   			return(1);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def206]
xfsprogs-6.17.0/repair/attr_repair.c:439:23: warning[-Wanalyzer-malloc-leak]: leak of ‘value’
xfsprogs-6.17.0/repair/attr_repair.c:1316:1: enter_function: entry to ‘process_attributes’
xfsprogs-6.17.0/repair/attr_repair.c:1329:12: branch_false: following ‘false’ branch (when ‘aformat != 1’)...
xfsprogs-6.17.0/repair/attr_repair.c:1333:20: branch_false: ...to here
xfsprogs-6.17.0/repair/attr_repair.c:1333:19: branch_true: following ‘true’ branch...
xfsprogs-6.17.0/repair/attr_repair.c:1335:31: branch_true: ...to here
xfsprogs-6.17.0/repair/attr_repair.c:1335:31: call_function: calling ‘process_longform_attr’ from ‘process_attributes’
#  437|   	/* Note that valuelen is not a multiple of blocksize */
#  438|   	while (amountdone < valuelen) {
#  439|-> 		bno = blkmap_get(blkmap, blocknum + i);
#  440|   		if (bno == NULLFSBLOCK) {
#  441|   			do_warn(

Error: GCC_ANALYZER_WARNING (CWE-401): [#def207]
xfsprogs-6.17.0/repair/attr_repair.c:471:17: warning[-Wanalyzer-malloc-leak]: leak of ‘value’
xfsprogs-6.17.0/repair/attr_repair.c:1316:1: enter_function: entry to ‘process_attributes’
xfsprogs-6.17.0/repair/attr_repair.c:1329:12: branch_false: following ‘false’ branch (when ‘aformat != 1’)...
xfsprogs-6.17.0/repair/attr_repair.c:1333:20: branch_false: ...to here
xfsprogs-6.17.0/repair/attr_repair.c:1333:19: branch_true: following ‘true’ branch...
xfsprogs-6.17.0/repair/attr_repair.c:1335:31: branch_true: ...to here
xfsprogs-6.17.0/repair/attr_repair.c:1335:31: call_function: calling ‘process_longform_attr’ from ‘process_attributes’
#  469|   		value += length;
#  470|   		i++;
#  471|-> 		libxfs_buf_relse(bp);
#  472|   	}
#  473|   	return (clearit);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def208]
xfsprogs-6.17.0/repair/attr_repair.c:1282:17: warning[-Wanalyzer-malloc-leak]: leak of ‘valuep’
xfsprogs-6.17.0/repair/attr_repair.c:1316:1: enter_function: entry to ‘process_attributes’
xfsprogs-6.17.0/repair/attr_repair.c:1329:12: branch_true: following ‘true’ branch (when ‘aformat == 1’)...
xfsprogs-6.17.0/repair/attr_repair.c:1330:17: branch_true: ...to here
xfsprogs-6.17.0/repair/attr_repair.c:1330:17: branch_true: following ‘true’ branch...
xfsprogs-6.17.0/repair/attr_repair.c:1332:23: branch_true: ...to here
xfsprogs-6.17.0/repair/attr_repair.c:1332:23: call_function: calling ‘process_shortform_attr’ from ‘process_attributes’
# 1280|   	count = be32_to_cpu(dacl->acl_cnt);
# 1281|   	if (count > XFS_ACL_MAX_ENTRIES(mp)) {
# 1282|-> 		do_warn(_("Too many ACL entries, count %d\n"), count);
# 1283|   		*aclp = NULL;
# 1284|   		return EINVAL;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def209]
xfsprogs-6.17.0/repair/attr_repair.c:1291:17: warning[-Wanalyzer-malloc-leak]: leak of ‘valuep’
xfsprogs-6.17.0/repair/attr_repair.c:1316:1: enter_function: entry to ‘process_attributes’
xfsprogs-6.17.0/repair/attr_repair.c:1329:12: branch_true: following ‘true’ branch (when ‘aformat == 1’)...
xfsprogs-6.17.0/repair/attr_repair.c:1330:17: branch_true: ...to here
xfsprogs-6.17.0/repair/attr_repair.c:1330:17: branch_true: following ‘true’ branch...
xfsprogs-6.17.0/repair/attr_repair.c:1332:23: branch_true: ...to here
xfsprogs-6.17.0/repair/attr_repair.c:1332:23: call_function: calling ‘process_shortform_attr’ from ‘process_attributes’
# 1289|   		     count * sizeof(struct xfs_icacl_entry));
# 1290|   	if (!acl) {
# 1291|-> 		do_warn(_("cannot malloc enough for ACL attribute\n"));
# 1292|   		do_warn(_("SKIPPING this ACL\n"));
# 1293|   		*aclp = NULL;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def210]
xfsprogs-6.17.0/repair/attr_repair.c:1292:17: warning[-Wanalyzer-malloc-leak]: leak of ‘valuep’
xfsprogs-6.17.0/repair/attr_repair.c:1316:1: enter_function: entry to ‘process_attributes’
xfsprogs-6.17.0/repair/attr_repair.c:1329:12: branch_true: following ‘true’ branch (when ‘aformat == 1’)...
xfsprogs-6.17.0/repair/attr_repair.c:1330:17: branch_true: ...to here
xfsprogs-6.17.0/repair/attr_repair.c:1330:17: branch_true: following ‘true’ branch...
xfsprogs-6.17.0/repair/attr_repair.c:1332:23: branch_true: ...to here
xfsprogs-6.17.0/repair/attr_repair.c:1332:23: call_function: calling ‘process_shortform_attr’ from ‘process_attributes’
# 1290|   	if (!acl) {
# 1291|   		do_warn(_("cannot malloc enough for ACL attribute\n"));
# 1292|-> 		do_warn(_("SKIPPING this ACL\n"));
# 1293|   		*aclp = NULL;
# 1294|   		return ENOMEM;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def211]
xfsprogs-6.17.0/repair/da_util.c:67:9: warning[-Wanalyzer-malloc-leak]: leak of ‘map’
xfsprogs-6.17.0/repair/da_util.c:53:12: branch_true: following ‘true’ branch (when ‘nex > 4’)...
xfsprogs-6.17.0/repair/da_util.c:54:23: branch_true: ...to here
xfsprogs-6.17.0/repair/da_util.c:54:23: acquire_memory: allocated here
xfsprogs-6.17.0/repair/da_util.c:55:20: branch_false: following ‘false’ branch (when ‘map’ is non-NULL)...
xfsprogs-6.17.0/repair/da_util.c:63:9: branch_false: ...to here
xfsprogs-6.17.0/repair/da_util.c:63:21: branch_true: following ‘true’ branch (when ‘i < nex’)...
xfsprogs-6.17.0/repair/da_util.c:64:32: branch_true: ...to here
xfsprogs-6.17.0/repair/da_util.c:63:21: branch_true: following ‘true’ branch (when ‘i < nex’)...
xfsprogs-6.17.0/repair/da_util.c:64:32: branch_true: ...to here
xfsprogs-6.17.0/repair/da_util.c:67:9: throw: if ‘libxfs_buf_read_map’ throws an exception...
xfsprogs-6.17.0/repair/da_util.c:67:9: danger: ‘map’ leaks here; was allocated at [(3)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/2)
#   65|   		map[i].bm_len = XFS_FSB_TO_BB(mp, bmp[i].blockcount);
#   66|   	}
#   67|-> 	libxfs_buf_read_map(mp->m_dev, map, nex, LIBXFS_READBUF_SALVAGE,
#   68|   			&bp, ops);
#   69|   	if (map != map_array)

Error: GCC_ANALYZER_WARNING (CWE-401): [#def212]
xfsprogs-6.17.0/repair/dir2.c:100:15: warning[-Wanalyzer-malloc-leak]: leak of ‘oldsfp’
xfsprogs-6.17.0/repair/dir2.c:1480:1: enter_function: entry to ‘process_dir2’
xfsprogs-6.17.0/repair/dir2.c:1507:12: branch_true: following ‘true’ branch...
xfsprogs-6.17.0/repair/dir2.c:1508:25: branch_true: ...to here
xfsprogs-6.17.0/repair/dir2.c:1507:13: branch_true: following ‘true’ branch...
xfsprogs-6.17.0/repair/dir2.c:1509:23: branch_true: ...to here
xfsprogs-6.17.0/repair/dir2.c:1510:23: call_function: calling ‘process_sf_dir2’ from ‘process_dir2’
#   98|   	newsfp->count = oldsfp->count;
#   99|   	newsfp->i8count = 0;
#  100|-> 	ino = libxfs_dir2_sf_get_parent_ino(oldsfp);
#  101|   	libxfs_dir2_sf_put_parent_ino(newsfp, ino);
#  102|   	oldsfep = xfs_dir2_sf_firstentry(oldsfp);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def213]
xfsprogs-6.17.0/repair/incore.c:364:17: warning[-Wanalyzer-malloc-leak]: leak of ‘bmap’
xfsprogs-6.17.0/repair/incore.c:359:16: acquire_memory: allocated here
xfsprogs-6.17.0/repair/incore.c:360:12: branch_false: following ‘false’ branch (when ‘bmap’ is non-NULL)...
xfsprogs-6.17.0/repair/incore.c:360:12: branch_false: ...to here
xfsprogs-6.17.0/repair/incore.c:363:21: branch_true: following ‘true’ branch (when ‘i < nr_groups’)...
xfsprogs-6.17.0/repair/incore.c:364:33: branch_true: ...to here
xfsprogs-6.17.0/repair/incore.c:364:17: throw: if ‘btree_init’ throws an exception...
xfsprogs-6.17.0/repair/incore.c:364:17: danger: ‘bmap’ leaks here; was allocated at [(1)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/0)
#  362|   
#  363|   	for (i = 0; i < nr_groups; i++)  {
#  364|-> 		btree_init(&bmap[i].root);
#  365|   		pthread_mutex_init(&bmap[i].lock, NULL);
#  366|   	}

Error: GCC_ANALYZER_WARNING (CWE-401): [#def214]
xfsprogs-6.17.0/repair/incore_ext.c:219:39: warning[-Wanalyzer-malloc-leak]: leak of ‘mk_extent_tree_nodes(startblock,  blockcount, 2)’
xfsprogs-6.17.0/repair/incore_ext.c:209:1: enter_function: entry to ‘add_bno_extent’
xfsprogs-6.17.0/repair/incore_ext.c:214:9: branch_true: following ‘true’ branch...
xfsprogs-6.17.0/repair/incore_ext.c:215:9: branch_true: ...to here
xfsprogs-6.17.0/repair/incore_ext.c:215:9: branch_true: following ‘true’ branch...
xfsprogs-6.17.0/repair/incore_ext.c:217:15: branch_true: ...to here
xfsprogs-6.17.0/repair/incore_ext.c:217:15: call_function: calling ‘mk_extent_tree_nodes’ from ‘add_bno_extent’
xfsprogs-6.17.0/repair/incore_ext.c:217:15: return_function: returning to ‘add_bno_extent’ from ‘mk_extent_tree_nodes’
xfsprogs-6.17.0/repair/incore_ext.c:219:39: danger: ‘mk_extent_tree_nodes(startblock,  blockcount, 2)’ leaks here; was allocated at [(8)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/7)
#  217|   	ext = mk_extent_tree_nodes(startblock, blockcount, XR_E_FREE);
#  218|   
#  219|-> 	if (avl_insert(extent_bno_ptrs[agno], (avlnode_t *) ext) == NULL)  {
#  220|   		do_error(_("duplicate bno extent range\n"));
#  221|   	}

Error: GCC_ANALYZER_WARNING (CWE-401): [#def215]
xfsprogs-6.17.0/repair/incore_ext.c:276:9: warning[-Wanalyzer-malloc-leak]: leak of ‘mk_extent_tree_nodes(startblock,  blockcount, 2)’
xfsprogs-6.17.0/repair/incore_ext.c:263:1: enter_function: entry to ‘add_bcnt_extent’
xfsprogs-6.17.0/repair/incore_ext.c:271:9: branch_true: following ‘true’ branch...
xfsprogs-6.17.0/repair/incore_ext.c:272:9: branch_true: ...to here
xfsprogs-6.17.0/repair/incore_ext.c:272:9: branch_true: following ‘true’ branch...
xfsprogs-6.17.0/repair/incore_ext.c:274:15: branch_true: ...to here
xfsprogs-6.17.0/repair/incore_ext.c:274:15: call_function: calling ‘mk_extent_tree_nodes’ from ‘add_bcnt_extent’
xfsprogs-6.17.0/repair/incore_ext.c:274:15: return_function: returning to ‘add_bcnt_extent’ from ‘mk_extent_tree_nodes’
xfsprogs-6.17.0/repair/incore_ext.c:276:9: branch_true: following ‘true’ branch...
xfsprogs-6.17.0/repair/incore_ext.c:282:47: branch_true: ...to here
xfsprogs-6.17.0/repair/incore_ext.c:282:47: throw: if ‘avl_find’ throws an exception...
xfsprogs-6.17.0/repair/incore_ext.c:276:9: danger: ‘mk_extent_tree_nodes(startblock,  blockcount, 2)’ leaks here; was allocated at [(8)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/7)
#  274|   	ext = mk_extent_tree_nodes(startblock, blockcount, XR_E_FREE);
#  275|   
#  276|-> 	ASSERT(ext->next == NULL);
#  277|   
#  278|   #ifdef XR_BCNT_TRACE

Error: GCC_ANALYZER_WARNING (CWE-401): [#def216]
xfsprogs-6.17.0/repair/incore_ext.c:624:21: warning[-Wanalyzer-malloc-leak]: leak of ‘mk_rt_extent_tree_nodes(startrtx,  rtxlen, 6)’
xfsprogs-6.17.0/repair/incore_ext.c:604:1: enter_function: entry to ‘add_rt_dup_extent’
xfsprogs-6.17.0/repair/incore_ext.c:619:12: branch_true: following ‘true’ branch...
xfsprogs-6.17.0/repair/incore_ext.c:622:23: call_function: calling ‘mk_rt_extent_tree_nodes’ from ‘add_rt_dup_extent’
xfsprogs-6.17.0/repair/incore_ext.c:622:23: return_function: returning to ‘add_rt_dup_extent’ from ‘mk_rt_extent_tree_nodes’
xfsprogs-6.17.0/repair/incore_ext.c:624:21: danger: ‘mk_rt_extent_tree_nodes(startrtx,  rtxlen, 6)’ leaks here; was allocated at [(6)](sarif:/runs/0/results/3/codeFlows/0/threadFlows/0/locations/5)
#  622|   		ext = mk_rt_extent_tree_nodes(startrtx, rtxlen, XR_E_MULT);
#  623|   
#  624|-> 		if (avl64_insert(rt_ext_tree_ptr,
#  625|   				(avl64node_t *) ext) == NULL)  {
#  626|   			do_error(_("duplicate extent range\n"));

Error: GCC_ANALYZER_WARNING (CWE-401): [#def217]
xfsprogs-6.17.0/repair/incore_ext.c:679:13: warning[-Wanalyzer-malloc-leak]: leak of ‘mk_rt_extent_tree_nodes(new_startrtx,  new_rtxlen, 6)’
xfsprogs-6.17.0/repair/incore_ext.c:604:1: enter_function: entry to ‘add_rt_dup_extent’
xfsprogs-6.17.0/repair/incore_ext.c:633:9: branch_true: following ‘true’ branch...
xfsprogs-6.17.0/repair/incore_ext.c:677:15: call_function: calling ‘mk_rt_extent_tree_nodes’ from ‘add_rt_dup_extent’
xfsprogs-6.17.0/repair/incore_ext.c:677:15: return_function: returning to ‘add_rt_dup_extent’ from ‘mk_rt_extent_tree_nodes’
xfsprogs-6.17.0/repair/incore_ext.c:679:13: danger: ‘mk_rt_extent_tree_nodes(new_startrtx,  new_rtxlen, 6)’ leaks here; was allocated at [(6)](sarif:/runs/0/results/4/codeFlows/0/threadFlows/0/locations/5)
#  677|   	ext = mk_rt_extent_tree_nodes(new_startrtx, new_rtxlen, XR_E_MULT);
#  678|   
#  679|-> 	if (avl64_insert(rt_ext_tree_ptr, (avl64node_t *) ext) == NULL)  {
#  680|   		do_error(_("duplicate extent range\n"));
#  681|   	}

Error: GCC_ANALYZER_WARNING (CWE-401): [#def218]
xfsprogs-6.17.0/repair/incore_ino.c:35:17: warning[-Wanalyzer-malloc-leak]: leak of ‘irec’
xfsprogs-6.17.0/repair/incore_ino.c:241:1: enter_function: entry to ‘alloc_ino_node’
xfsprogs-6.17.0/repair/incore_ino.c:247:16: acquire_memory: allocated here
xfsprogs-6.17.0/repair/incore_ino.c:248:12: branch_false: following ‘false’ branch (when ‘irec’ is non-NULL)...
xfsprogs-6.17.0/repair/incore_ino.c:251:9: branch_false: ...to here
xfsprogs-6.17.0/repair/incore_ino.c:265:33: call_function: calling ‘alloc_nlink_array’ from ‘alloc_ino_node’
#   33|   	ptr = calloc(XFS_INODES_PER_CHUNK, nlink_size);
#   34|   	if (!ptr)
#   35|-> 		do_error(_("could not allocate nlink array\n"));
#   36|   	return ptr;
#   37|   }

Error: GCC_ANALYZER_WARNING (CWE-401): [#def219]
xfsprogs-6.17.0/repair/incore_ino.c:223:17: warning[-Wanalyzer-malloc-leak]: leak of ‘<unknown>’
xfsprogs-6.17.0/repair/incore_ino.c:241:1: enter_function: entry to ‘alloc_ino_node’
xfsprogs-6.17.0/repair/incore_ino.c:248:12: branch_false: following ‘false’ branch (when ‘irec’ is non-NULL)...
xfsprogs-6.17.0/repair/incore_ino.c:251:9: branch_false: ...to here
xfsprogs-6.17.0/repair/incore_ino.c:265:33: call_function: calling ‘alloc_nlink_array’ from ‘alloc_ino_node’
xfsprogs-6.17.0/repair/incore_ino.c:265:33: return_function: returning to ‘alloc_ino_node’ from ‘alloc_nlink_array’
xfsprogs-6.17.0/repair/incore_ino.c:266:24: call_function: calling ‘alloc_ftypes_array’ from ‘alloc_ino_node’
#  221|   	ptr = calloc(XFS_INODES_PER_CHUNK, sizeof(*ptr));
#  222|   	if (!ptr)
#  223|-> 		do_error(_("could not allocate ftypes array\n"));
#  224|   	return ptr;
#  225|   }

Error: GCC_ANALYZER_WARNING (CWE-401): [#def220]
xfsprogs-6.17.0/repair/incore_ino.c:223:17: warning[-Wanalyzer-malloc-leak]: leak of ‘irec’
xfsprogs-6.17.0/repair/incore_ino.c:241:1: enter_function: entry to ‘alloc_ino_node’
xfsprogs-6.17.0/repair/incore_ino.c:247:16: acquire_memory: allocated here
xfsprogs-6.17.0/repair/incore_ino.c:248:12: branch_false: following ‘false’ branch (when ‘irec’ is non-NULL)...
xfsprogs-6.17.0/repair/incore_ino.c:251:9: branch_false: ...to here
xfsprogs-6.17.0/repair/incore_ino.c:265:33: call_function: calling ‘alloc_nlink_array’ from ‘alloc_ino_node’
xfsprogs-6.17.0/repair/incore_ino.c:265:33: return_function: returning to ‘alloc_ino_node’ from ‘alloc_nlink_array’
xfsprogs-6.17.0/repair/incore_ino.c:266:24: call_function: calling ‘alloc_ftypes_array’ from ‘alloc_ino_node’
#  221|   	ptr = calloc(XFS_INODES_PER_CHUNK, sizeof(*ptr));
#  222|   	if (!ptr)
#  223|-> 		do_error(_("could not allocate ftypes array\n"));
#  224|   	return ptr;
#  225|   }

Error: GCC_ANALYZER_WARNING (CWE-401): [#def221]
xfsprogs-6.17.0/repair/phase1.c:26:22: warning[-Wanalyzer-malloc-leak]: leak of ‘alloc_ag_buf(524288)’
xfsprogs-6.17.0/repair/phase1.c:40:1: enter_function: entry to ‘phase1’
xfsprogs-6.17.0/repair/phase1.c:60:17: call_function: calling ‘alloc_ag_buf’ from ‘phase1’
xfsprogs-6.17.0/repair/phase1.c:60:17: return_function: returning to ‘phase1’ from ‘alloc_ag_buf’
xfsprogs-6.17.0/repair/phase1.c:63:16: throw: if ‘get_sb’ throws an exception...
xfsprogs-6.17.0/repair/phase1.c:26:22: danger: ‘alloc_ag_buf(524288)’ leaks here; was allocated at [(4)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/3)
#   24|   	char	*bp;
#   25|   
#   26|-> 	bp = (char *)memalign(libxfs_device_alignment(), size);
#   27|   	if (!bp)
#   28|   		do_error(_("could not allocate ag header buffer (%d bytes)\n"),

Error: GCC_ANALYZER_WARNING (CWE-401): [#def222]
xfsprogs-6.17.0/repair/phase3.c:167:17: warning[-Wanalyzer-malloc-leak]: leak of ‘counts’
xfsprogs-6.17.0/repair/phase3.c:153:18: acquire_memory: allocated here
xfsprogs-6.17.0/repair/phase3.c:154:12: branch_false: following ‘false’ branch (when ‘counts’ is non-NULL)...
xfsprogs-6.17.0/repair/phase3.c:154:12: branch_false: ...to here
xfsprogs-6.17.0/repair/phase3.c:167:17: throw: if ‘create_work_queue’ throws an exception...
xfsprogs-6.17.0/repair/phase3.c:167:17: danger: ‘counts’ leaks here; was allocated at [(1)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/0)
#  165|   		memset(counts, 0, mp->m_sb.sb_agcount * sizeof(*counts));
#  166|   
#  167|-> 		create_work_queue(&wq, mp, scan_threads);
#  168|   
#  169|   		for (i = 0; i < mp->m_sb.sb_agcount; i++)

Error: GCC_ANALYZER_WARNING (CWE-401): [#def223]
xfsprogs-6.17.0/repair/phase3.c:170:25: warning[-Wanalyzer-malloc-leak]: leak of ‘counts’
xfsprogs-6.17.0/repair/phase3.c:153:18: acquire_memory: allocated here
xfsprogs-6.17.0/repair/phase3.c:154:12: branch_false: following ‘false’ branch (when ‘counts’ is non-NULL)...
xfsprogs-6.17.0/repair/phase3.c:154:12: branch_false: ...to here
xfsprogs-6.17.0/repair/phase3.c:169:29: branch_true: following ‘true’ branch...
xfsprogs-6.17.0/repair/phase3.c:170:74: branch_true: ...to here
xfsprogs-6.17.0/repair/phase3.c:170:25: throw: if ‘queue_work’ throws an exception...
xfsprogs-6.17.0/repair/phase3.c:170:25: danger: ‘counts’ leaks here; was allocated at [(1)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/0)
#  168|   
#  169|   		for (i = 0; i < mp->m_sb.sb_agcount; i++)
#  170|-> 			queue_work(&wq, do_uncertain_aginodes, i, &counts[i]);
#  171|   
#  172|   		destroy_work_queue(&wq);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def224]
xfsprogs-6.17.0/repair/phase3.c:172:17: warning[-Wanalyzer-malloc-leak]: leak of ‘counts’
xfsprogs-6.17.0/repair/phase3.c:153:18: acquire_memory: allocated here
xfsprogs-6.17.0/repair/phase3.c:154:12: branch_false: following ‘false’ branch (when ‘counts’ is non-NULL)...
xfsprogs-6.17.0/repair/phase3.c:154:12: branch_false: ...to here
xfsprogs-6.17.0/repair/phase3.c:169:29: branch_false: following ‘false’ branch...
xfsprogs-6.17.0/repair/phase3.c:172:17: branch_false: ...to here
xfsprogs-6.17.0/repair/phase3.c:172:17: throw: if ‘destroy_work_queue’ throws an exception...
xfsprogs-6.17.0/repair/phase3.c:172:17: danger: ‘counts’ leaks here; was allocated at [(1)](sarif:/runs/0/results/2/codeFlows/0/threadFlows/0/locations/0)
#  170|   			queue_work(&wq, do_uncertain_aginodes, i, &counts[i]);
#  171|   
#  172|-> 		destroy_work_queue(&wq);
#  173|   
#  174|   		/* tally up the counts */

Error: GCC_ANALYZER_WARNING (CWE-401): [#def225]
xfsprogs-6.17.0/repair/phase6.c:137:18: warning[-Wanalyzer-malloc-leak]: leak of ‘freetab’
xfsprogs-6.17.0/repair/phase6.c:3286:1: enter_function: entry to ‘do_dir_inode’
xfsprogs-6.17.0/repair/phase6.c:3294:21: branch_true: following ‘true’ branch (when ‘i != 64’)...
xfsprogs-6.17.0/repair/phase6.c:3295:21: call_function: inlined call to ‘inode_isadir’ from ‘do_dir_inode’
xfsprogs-6.17.0/repair/phase6.c:3295:20: branch_true: following ‘true’ branch...
xfsprogs-6.17.0/repair/phase6.c:3296:43: branch_true: ...to here
xfsprogs-6.17.0/repair/phase6.c:3296:25: call_function: calling ‘process_dir_inode’ from ‘do_dir_inode’
#  135|   	int error2;
#  136|   
#  137|-> 	error = -libxfs_da_read_buf(NULL, ip, bno, 0, bpp, XFS_DATA_FORK, ops);
#  138|   
#  139|   	if (error != EFSBADCRC && error != EFSCORRUPTED)

Error: GCC_ANALYZER_WARNING (CWE-401): [#def226]
xfsprogs-6.17.0/repair/phase6.c:142:19: warning[-Wanalyzer-malloc-leak]: leak of ‘freetab’
xfsprogs-6.17.0/repair/phase6.c:3286:1: enter_function: entry to ‘do_dir_inode’
xfsprogs-6.17.0/repair/phase6.c:3294:21: branch_true: following ‘true’ branch (when ‘i != 64’)...
xfsprogs-6.17.0/repair/phase6.c:3295:21: call_function: inlined call to ‘inode_isadir’ from ‘do_dir_inode’
xfsprogs-6.17.0/repair/phase6.c:3295:20: branch_true: following ‘true’ branch...
xfsprogs-6.17.0/repair/phase6.c:3296:43: branch_true: ...to here
xfsprogs-6.17.0/repair/phase6.c:3296:25: call_function: calling ‘process_dir_inode’ from ‘do_dir_inode’
#  140|   		return error;
#  141|   
#  142|-> 	error2 = -libxfs_da_read_buf(NULL, ip, bno, 0, bpp, XFS_DATA_FORK,
#  143|   			NULL);
#  144|   	if (error2)

Error: GCC_ANALYZER_WARNING (CWE-401): [#def227]
xfsprogs-6.17.0/repair/phase6.c:321:17: warning[-Wanalyzer-malloc-leak]: leak of ‘dir_hash_init(*ip.i_disk_size)’
xfsprogs-6.17.0/repair/phase6.c:3348:1: enter_function: entry to ‘update_missing_dotdot_entries’
xfsprogs-6.17.0/repair/phase6.c:3358:16: branch_true: following ‘true’ branch...
xfsprogs-6.17.0/repair/phase6.c:3359:23: branch_true: ...to here
xfsprogs-6.17.0/repair/phase6.c:3362:17: call_function: calling ‘process_dir_inode’ from ‘update_missing_dotdot_entries’
#  319|   	int			hsize;
#  320|   
#  321|-> 	hsize = size / 64;
#  322|   	if (hsize < 16)
#  323|   		hsize = 16;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def228]
xfsprogs-6.17.0/repair/phase6.c:432:18: warning[-Wanalyzer-malloc-leak]: leak of ‘freetab’
xfsprogs-6.17.0/repair/phase6.c:3286:1: enter_function: entry to ‘do_dir_inode’
xfsprogs-6.17.0/repair/phase6.c:3294:21: branch_true: following ‘true’ branch (when ‘i != 64’)...
xfsprogs-6.17.0/repair/phase6.c:3295:21: call_function: inlined call to ‘inode_isadir’ from ‘do_dir_inode’
xfsprogs-6.17.0/repair/phase6.c:3295:20: branch_true: following ‘true’ branch...
xfsprogs-6.17.0/repair/phase6.c:3296:43: branch_true: ...to here
xfsprogs-6.17.0/repair/phase6.c:3296:25: call_function: calling ‘process_dir_inode’ from ‘do_dir_inode’
#  430|   
#  431|           /* Read extent map. */
#  432|-> 	error = -libxfs_iread_extents(NULL, ip, XFS_DATA_FORK);
#  433|   	if (error)
#  434|   		return error;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def229]
xfsprogs-6.17.0/repair/phase6.c:437:14: warning[-Wanalyzer-malloc-leak]: leak of ‘freetab’
xfsprogs-6.17.0/repair/phase6.c:3286:1: enter_function: entry to ‘do_dir_inode’
xfsprogs-6.17.0/repair/phase6.c:3294:21: branch_true: following ‘true’ branch (when ‘i != 64’)...
xfsprogs-6.17.0/repair/phase6.c:3295:21: call_function: inlined call to ‘inode_isadir’ from ‘do_dir_inode’
xfsprogs-6.17.0/repair/phase6.c:3295:20: branch_true: following ‘true’ branch...
xfsprogs-6.17.0/repair/phase6.c:3296:43: branch_true: ...to here
xfsprogs-6.17.0/repair/phase6.c:3296:25: call_function: calling ‘process_dir_inode’ from ‘do_dir_inode’
#  435|   
#  436|   	bno = *bnop + 1;
#  437|-> 	if (!libxfs_iext_lookup_extent(ip, &ip->i_df, bno, &icur, &got))
#  438|   		*bnop = NULLFILEOFF;
#  439|   	else

Error: GCC_ANALYZER_WARNING (CWE-401): [#def230]
xfsprogs-6.17.0/repair/phase6.c:449:17: warning[-Wanalyzer-malloc-leak]: leak of ‘freetab’
xfsprogs-6.17.0/repair/phase6.c:3348:1: enter_function: entry to ‘update_missing_dotdot_entries’
xfsprogs-6.17.0/repair/phase6.c:3358:16: branch_true: following ‘true’ branch...
xfsprogs-6.17.0/repair/phase6.c:3359:23: branch_true: ...to here
xfsprogs-6.17.0/repair/phase6.c:3362:17: call_function: calling ‘process_dir_inode’ from ‘update_missing_dotdot_entries’
#  447|   {
#  448|   	if (err == ENOSPC) {
#  449|-> 		do_error(_("ran out of disk space!\n"));
#  450|   	} else
#  451|   		do_error(_("xfs_trans_reserve returned %d\n"), err);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def231]
xfsprogs-6.17.0/repair/phase6.c:451:17: warning[-Wanalyzer-malloc-leak]: leak of ‘freetab’
xfsprogs-6.17.0/repair/phase6.c:3348:1: enter_function: entry to ‘update_missing_dotdot_entries’
xfsprogs-6.17.0/repair/phase6.c:3358:16: branch_true: following ‘true’ branch...
xfsprogs-6.17.0/repair/phase6.c:3359:23: branch_true: ...to here
xfsprogs-6.17.0/repair/phase6.c:3362:17: call_function: calling ‘process_dir_inode’ from ‘update_missing_dotdot_entries’
#  449|   		do_error(_("ran out of disk space!\n"));
#  450|   	} else
#  451|-> 		do_error(_("xfs_trans_reserve returned %d\n"), err);
#  452|   }
#  453|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def232]
xfsprogs-6.17.0/repair/phase6.c:1298:9: warning[-Wanalyzer-malloc-leak]: leak of ‘freetab’
xfsprogs-6.17.0/repair/phase6.c:3348:1: enter_function: entry to ‘update_missing_dotdot_entries’
xfsprogs-6.17.0/repair/phase6.c:3358:16: branch_true: following ‘true’ branch...
xfsprogs-6.17.0/repair/phase6.c:3359:23: branch_true: ...to here
xfsprogs-6.17.0/repair/phase6.c:3362:17: call_function: calling ‘process_dir_inode’ from ‘update_missing_dotdot_entries’
# 1296|   	 */
# 1297|   
# 1298|-> 	do_warn(_("rebuilding directory inode %" PRIu64 "\n"), ino);
# 1299|   
# 1300|   	/*

Error: GCC_ANALYZER_WARNING (CWE-401): [#def233]
xfsprogs-6.17.0/repair/phase6.c:1306:21: warning[-Wanalyzer-malloc-leak]: leak of ‘freetab’
xfsprogs-6.17.0/repair/phase6.c:3348:1: enter_function: entry to ‘update_missing_dotdot_entries’
xfsprogs-6.17.0/repair/phase6.c:3358:16: branch_true: following ‘true’ branch...
xfsprogs-6.17.0/repair/phase6.c:3359:23: branch_true: ...to here
xfsprogs-6.17.0/repair/phase6.c:3362:17: call_function: calling ‘process_dir_inode’ from ‘update_missing_dotdot_entries’
# 1304|   	 * for the libxfs_dir_init() call).
# 1305|   	 */
# 1306|-> 	pip.i_ino = get_inode_parent(irec, ino_offset);
# 1307|   	if (pip.i_ino == NULLFSINO ||
# 1308|   	    libxfs_dir_ino_validate(mp, pip.i_ino))

Error: GCC_ANALYZER_WARNING (CWE-401): [#def234]
xfsprogs-6.17.0/repair/phase6.c:1308:13: warning[-Wanalyzer-malloc-leak]: leak of ‘freetab’
xfsprogs-6.17.0/repair/phase6.c:3348:1: enter_function: entry to ‘update_missing_dotdot_entries’
xfsprogs-6.17.0/repair/phase6.c:3358:16: branch_true: following ‘true’ branch...
xfsprogs-6.17.0/repair/phase6.c:3359:23: branch_true: ...to here
xfsprogs-6.17.0/repair/phase6.c:3362:17: call_function: calling ‘process_dir_inode’ from ‘update_missing_dotdot_entries’
# 1306|   	pip.i_ino = get_inode_parent(irec, ino_offset);
# 1307|   	if (pip.i_ino == NULLFSINO ||
# 1308|-> 	    libxfs_dir_ino_validate(mp, pip.i_ino))
# 1309|   		pip.i_ino = mp->m_sb.sb_rootino;
# 1310|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def235]
xfsprogs-6.17.0/repair/phase6.c:1311:16: warning[-Wanalyzer-malloc-leak]: leak of ‘freetab’
xfsprogs-6.17.0/repair/phase6.c:3348:1: enter_function: entry to ‘update_missing_dotdot_entries’
xfsprogs-6.17.0/repair/phase6.c:3358:16: branch_true: following ‘true’ branch...
xfsprogs-6.17.0/repair/phase6.c:3359:23: branch_true: ...to here
xfsprogs-6.17.0/repair/phase6.c:3362:17: call_function: calling ‘process_dir_inode’ from ‘update_missing_dotdot_entries’
# 1309|   		pip.i_ino = mp->m_sb.sb_rootino;
# 1310|   
# 1311|-> 	nres = libxfs_remove_space_res(mp, 0);
# 1312|   	error = -libxfs_trans_alloc(mp, &M_RES(mp)->tr_remove, nres, 0, 0, &tp);
# 1313|   	if (error)

Error: GCC_ANALYZER_WARNING (CWE-401): [#def236]
xfsprogs-6.17.0/repair/phase6.c:1312:18: warning[-Wanalyzer-malloc-leak]: leak of ‘freetab’
xfsprogs-6.17.0/repair/phase6.c:3348:1: enter_function: entry to ‘update_missing_dotdot_entries’
xfsprogs-6.17.0/repair/phase6.c:3358:16: branch_true: following ‘true’ branch...
xfsprogs-6.17.0/repair/phase6.c:3359:23: branch_true: ...to here
xfsprogs-6.17.0/repair/phase6.c:3362:17: call_function: calling ‘process_dir_inode’ from ‘update_missing_dotdot_entries’
# 1310|   
# 1311|   	nres = libxfs_remove_space_res(mp, 0);
# 1312|-> 	error = -libxfs_trans_alloc(mp, &M_RES(mp)->tr_remove, nres, 0, 0, &tp);
# 1313|   	if (error)
# 1314|   		res_failed(error);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def237]
xfsprogs-6.17.0/repair/phase6.c:1315:9: warning[-Wanalyzer-malloc-leak]: leak of ‘freetab’
xfsprogs-6.17.0/repair/phase6.c:3348:1: enter_function: entry to ‘update_missing_dotdot_entries’
xfsprogs-6.17.0/repair/phase6.c:3358:16: branch_true: following ‘true’ branch...
xfsprogs-6.17.0/repair/phase6.c:3359:23: branch_true: ...to here
xfsprogs-6.17.0/repair/phase6.c:3362:17: call_function: calling ‘process_dir_inode’ from ‘update_missing_dotdot_entries’
# 1313|   	if (error)
# 1314|   		res_failed(error);
# 1315|-> 	libxfs_trans_ijoin(tp, ip, 0);
# 1316|   
# 1317|   	error = dir_binval(tp, ip, XFS_DATA_FORK);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def238]
xfsprogs-6.17.0/repair/phase6.c:1625:21: warning[-Wanalyzer-malloc-leak]: leak of ‘freetab’
xfsprogs-6.17.0/repair/phase6.c:3286:1: enter_function: entry to ‘do_dir_inode’
xfsprogs-6.17.0/repair/phase6.c:3294:21: branch_true: following ‘true’ branch (when ‘i != 64’)...
xfsprogs-6.17.0/repair/phase6.c:3295:21: call_function: inlined call to ‘inode_isadir’ from ‘do_dir_inode’
xfsprogs-6.17.0/repair/phase6.c:3295:20: branch_true: following ‘true’ branch...
xfsprogs-6.17.0/repair/phase6.c:3296:43: branch_true: ...to here
xfsprogs-6.17.0/repair/phase6.c:3296:25: call_function: calling ‘process_dir_inode’ from ‘do_dir_inode’
# 1623|   		if (ptr + libxfs_dir2_data_entsize(mp, dep->namelen) > endptr)
# 1624|   			break;
# 1625|-> 		if (be16_to_cpu(*libxfs_dir2_data_entry_tag_p(mp, dep)) !=
# 1626|   						(char *)dep - (char *)d)
# 1627|   			break;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def239]
xfsprogs-6.17.0/repair/phase6.c:2087:17: warning[-Wanalyzer-malloc-leak]: leak of ‘freetab’
xfsprogs-6.17.0/repair/phase6.c:3286:1: enter_function: entry to ‘do_dir_inode’
xfsprogs-6.17.0/repair/phase6.c:3294:21: branch_true: following ‘true’ branch (when ‘i != 64’)...
xfsprogs-6.17.0/repair/phase6.c:3295:21: call_function: inlined call to ‘inode_isadir’ from ‘do_dir_inode’
xfsprogs-6.17.0/repair/phase6.c:3295:20: branch_true: following ‘true’ branch...
xfsprogs-6.17.0/repair/phase6.c:3296:43: branch_true: ...to here
xfsprogs-6.17.0/repair/phase6.c:3296:25: call_function: calling ‘process_dir_inode’ from ‘do_dir_inode’
# 2085|   	error = dir_read_buf(ip, da_bno, &bp, &xfs_dir3_leaf1_buf_ops, &fixit);
# 2086|   	if (error == EFSBADCRC || error == EFSCORRUPTED || fixit) {
# 2087|-> 		do_warn(
# 2088|   	_("leaf block %u for directory inode %" PRIu64 " bad CRC\n"),
# 2089|   			da_bno, ip->i_ino);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def240]
xfsprogs-6.17.0/repair/phase6.c:2092:17: warning[-Wanalyzer-malloc-leak]: leak of ‘freetab’
xfsprogs-6.17.0/repair/phase6.c:3286:1: enter_function: entry to ‘do_dir_inode’
xfsprogs-6.17.0/repair/phase6.c:3294:21: branch_true: following ‘true’ branch (when ‘i != 64’)...
xfsprogs-6.17.0/repair/phase6.c:3295:21: call_function: inlined call to ‘inode_isadir’ from ‘do_dir_inode’
xfsprogs-6.17.0/repair/phase6.c:3295:20: branch_true: following ‘true’ branch...
xfsprogs-6.17.0/repair/phase6.c:3296:43: branch_true: ...to here
xfsprogs-6.17.0/repair/phase6.c:3296:25: call_function: calling ‘process_dir_inode’ from ‘do_dir_inode’
# 2090|   		return 1;
# 2091|   	} else if (error) {
# 2092|-> 		do_error(
# 2093|   	_("can't read block %u for directory inode %" PRIu64 ", error %d\n"),
# 2094|   			da_bno, ip->i_ino, error);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def241]
xfsprogs-6.17.0/repair/phase6.c:2099:9: warning[-Wanalyzer-malloc-leak]: leak of ‘freetab’
xfsprogs-6.17.0/repair/phase6.c:3286:1: enter_function: entry to ‘do_dir_inode’
xfsprogs-6.17.0/repair/phase6.c:3294:21: branch_true: following ‘true’ branch (when ‘i != 64’)...
xfsprogs-6.17.0/repair/phase6.c:3295:21: call_function: inlined call to ‘inode_isadir’ from ‘do_dir_inode’
xfsprogs-6.17.0/repair/phase6.c:3295:20: branch_true: following ‘true’ branch...
xfsprogs-6.17.0/repair/phase6.c:3296:43: branch_true: ...to here
xfsprogs-6.17.0/repair/phase6.c:3296:25: call_function: calling ‘process_dir_inode’ from ‘do_dir_inode’
# 2097|   
# 2098|   	leaf = bp->b_addr;
# 2099|-> 	libxfs_dir2_leaf_hdr_from_disk(mp, &leafhdr, leaf);
# 2100|   	ents = leafhdr.ents;
# 2101|   	ltp = xfs_dir2_leaf_tail_p(mp->m_dir_geo, leaf);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def242]
xfsprogs-6.17.0/repair/phase6.c:2180:22: warning[-Wanalyzer-malloc-leak]: leak of ‘freetab’
xfsprogs-6.17.0/repair/phase6.c:3348:1: enter_function: entry to ‘update_missing_dotdot_entries’
xfsprogs-6.17.0/repair/phase6.c:3358:16: branch_true: following ‘true’ branch...
xfsprogs-6.17.0/repair/phase6.c:3359:23: branch_true: ...to here
xfsprogs-6.17.0/repair/phase6.c:3362:17: call_function: calling ‘process_dir_inode’ from ‘update_missing_dotdot_entries’
# 2178|   
# 2179|   		if (next_da_bno != NULLFILEOFF &&
# 2180|-> 		    !libxfs_verify_dablk(mp, next_da_bno)) {
# 2181|   			do_warn(_("invalid dir leaf block 0x%llx\n"),
# 2182|   					(unsigned long long)next_da_bno);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def243]
xfsprogs-6.17.0/repair/phase6.c:2202:17: warning[-Wanalyzer-malloc-leak]: leak of ‘freetab’
xfsprogs-6.17.0/repair/phase6.c:3348:1: enter_function: entry to ‘update_missing_dotdot_entries’
xfsprogs-6.17.0/repair/phase6.c:3358:16: branch_true: following ‘true’ branch...
xfsprogs-6.17.0/repair/phase6.c:3359:23: branch_true: ...to here
xfsprogs-6.17.0/repair/phase6.c:3362:17: call_function: calling ‘process_dir_inode’ from ‘update_missing_dotdot_entries’
# 2200|   		}
# 2201|   		leaf = bp->b_addr;
# 2202|-> 		libxfs_dir2_leaf_hdr_from_disk(mp, &leafhdr, leaf);
# 2203|   		ents = leafhdr.ents;
# 2204|   		if (!(leafhdr.magic == XFS_DIR2_LEAFN_MAGIC ||

Error: GCC_ANALYZER_WARNING (CWE-401): [#def244]
xfsprogs-6.17.0/repair/phase6.c:2380:15: warning[-Wanalyzer-malloc-leak]: leak of ‘freetab’
xfsprogs-6.17.0/repair/phase6.c:3286:1: enter_function: entry to ‘do_dir_inode’
xfsprogs-6.17.0/repair/phase6.c:3294:21: branch_true: following ‘true’ branch (when ‘i != 64’)...
xfsprogs-6.17.0/repair/phase6.c:3295:21: call_function: inlined call to ‘inode_isadir’ from ‘do_dir_inode’
xfsprogs-6.17.0/repair/phase6.c:3295:20: branch_true: following ‘true’ branch...
xfsprogs-6.17.0/repair/phase6.c:3296:43: branch_true: ...to here
xfsprogs-6.17.0/repair/phase6.c:3296:25: call_function: calling ‘process_dir_inode’ from ‘do_dir_inode’
# 2378|   	args.geo = mp->m_dir_geo;
# 2379|   	args.owner = ip->i_ino;
# 2380|-> 	fmt = libxfs_dir2_format(&args, &error);
# 2381|   
# 2382|   	/* check directory "data" blocks (ie. name/inode pairs) */

Error: GCC_ANALYZER_WARNING (CWE-401): [#def245]
xfsprogs-6.17.0/repair/phase6.c:2403:22: warning[-Wanalyzer-malloc-leak]: leak of ‘freetab’
xfsprogs-6.17.0/repair/phase6.c:3286:1: enter_function: entry to ‘do_dir_inode’
xfsprogs-6.17.0/repair/phase6.c:3294:21: branch_true: following ‘true’ branch (when ‘i != 64’)...
xfsprogs-6.17.0/repair/phase6.c:3295:21: call_function: inlined call to ‘inode_isadir’ from ‘do_dir_inode’
xfsprogs-6.17.0/repair/phase6.c:3295:20: branch_true: following ‘true’ branch...
xfsprogs-6.17.0/repair/phase6.c:3296:43: branch_true: ...to here
xfsprogs-6.17.0/repair/phase6.c:3296:25: call_function: calling ‘process_dir_inode’ from ‘do_dir_inode’
# 2401|   
# 2402|   		if (next_da_bno != NULLFILEOFF &&
# 2403|-> 		    !libxfs_verify_dablk(mp, next_da_bno)) {
# 2404|   			do_warn(_("invalid dir data block 0x%llx\n"),
# 2405|   					(unsigned long long)next_da_bno);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def246]
xfsprogs-6.17.0/repair/phase6.c:2404:25: warning[-Wanalyzer-malloc-leak]: leak of ‘freetab’
xfsprogs-6.17.0/repair/phase6.c:3286:1: enter_function: entry to ‘do_dir_inode’
xfsprogs-6.17.0/repair/phase6.c:3294:21: branch_true: following ‘true’ branch (when ‘i != 64’)...
xfsprogs-6.17.0/repair/phase6.c:3295:21: call_function: inlined call to ‘inode_isadir’ from ‘do_dir_inode’
xfsprogs-6.17.0/repair/phase6.c:3295:20: branch_true: following ‘true’ branch...
xfsprogs-6.17.0/repair/phase6.c:3296:43: branch_true: ...to here
xfsprogs-6.17.0/repair/phase6.c:3296:25: call_function: calling ‘process_dir_inode’ from ‘do_dir_inode’
# 2402|   		if (next_da_bno != NULLFILEOFF &&
# 2403|   		    !libxfs_verify_dablk(mp, next_da_bno)) {
# 2404|-> 			do_warn(_("invalid dir data block 0x%llx\n"),
# 2405|   					(unsigned long long)next_da_bno);
# 2406|   			fixit++;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def247]
xfsprogs-6.17.0/repair/phase6.c:2417:25: warning[-Wanalyzer-malloc-leak]: leak of ‘freetab’
xfsprogs-6.17.0/repair/phase6.c:3286:1: enter_function: entry to ‘do_dir_inode’
xfsprogs-6.17.0/repair/phase6.c:3294:21: branch_true: following ‘true’ branch (when ‘i != 64’)...
xfsprogs-6.17.0/repair/phase6.c:3295:21: call_function: inlined call to ‘inode_isadir’ from ‘do_dir_inode’
xfsprogs-6.17.0/repair/phase6.c:3295:20: branch_true: following ‘true’ branch...
xfsprogs-6.17.0/repair/phase6.c:3296:43: branch_true: ...to here
xfsprogs-6.17.0/repair/phase6.c:3296:25: call_function: calling ‘process_dir_inode’ from ‘do_dir_inode’
# 2415|   		error = dir_read_buf(ip, da_bno, &bp, ops, &fixit);
# 2416|   		if (error) {
# 2417|-> 			do_warn(
# 2418|   	_("can't read data block %u for directory inode %" PRIu64 " error %d\n"),
# 2419|   				da_bno, ino, error);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def248]
xfsprogs-6.17.0/repair/phase6.c:2459:41: warning[-Wanalyzer-malloc-leak]: leak of ‘freetab’
xfsprogs-6.17.0/repair/phase6.c:3286:1: enter_function: entry to ‘do_dir_inode’
xfsprogs-6.17.0/repair/phase6.c:3294:21: branch_true: following ‘true’ branch (when ‘i != 64’)...
xfsprogs-6.17.0/repair/phase6.c:3295:21: call_function: inlined call to ‘inode_isadir’ from ‘do_dir_inode’
xfsprogs-6.17.0/repair/phase6.c:3295:20: branch_true: following ‘true’ branch...
xfsprogs-6.17.0/repair/phase6.c:3296:43: branch_true: ...to here
xfsprogs-6.17.0/repair/phase6.c:3296:25: call_function: calling ‘process_dir_inode’ from ‘do_dir_inode’
# 2457|   		bp = NULL;
# 2458|   	}
# 2459|-> 	fixit |= (*num_illegal != 0) || dir2_is_badino(ino) || *need_dot;
# 2460|   
# 2461|   	if (!dotdot_update) {

Error: GCC_ANALYZER_WARNING (CWE-476): [#def249]
xfsprogs-6.17.0/repair/phase6.c:2468:25: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘bp’
xfsprogs-6.17.0/repair/phase6.c:3286:1: enter_function: entry to ‘do_dir_inode’
xfsprogs-6.17.0/repair/phase6.c:3294:21: branch_true: following ‘true’ branch (when ‘i != 64’)...
xfsprogs-6.17.0/repair/phase6.c:3295:21: call_function: inlined call to ‘inode_isadir’ from ‘do_dir_inode’
xfsprogs-6.17.0/repair/phase6.c:3295:20: branch_true: following ‘true’ branch...
xfsprogs-6.17.0/repair/phase6.c:3296:43: branch_true: ...to here
xfsprogs-6.17.0/repair/phase6.c:3296:25: call_function: calling ‘process_dir_inode’ from ‘do_dir_inode’
# 2466|   			xfs_dir2_leaf_entry_t	*blp;
# 2467|   
# 2468|-> 			block = bp->b_addr;
# 2469|   			btp = xfs_dir2_block_tail_p(mp->m_dir_geo, block);
# 2470|   			blp = xfs_dir2_block_leaf_p(btp);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def250]
xfsprogs-6.17.0/repair/phase6.c:2486:17: warning[-Wanalyzer-malloc-leak]: leak of ‘freetab’
xfsprogs-6.17.0/repair/phase6.c:3348:1: enter_function: entry to ‘update_missing_dotdot_entries’
xfsprogs-6.17.0/repair/phase6.c:3358:16: branch_true: following ‘true’ branch...
xfsprogs-6.17.0/repair/phase6.c:3359:23: branch_true: ...to here
xfsprogs-6.17.0/repair/phase6.c:3362:17: call_function: calling ‘process_dir_inode’ from ‘update_missing_dotdot_entries’
# 2484|   out_fix:
# 2485|   	if (bp)
# 2486|-> 		libxfs_buf_relse(bp);
# 2487|   
# 2488|   	if (!no_modify && (fixit || dotdot_update)) {

Error: GCC_ANALYZER_WARNING (CWE-401): [#def251]
xfsprogs-6.17.0/repair/phase6.c:2494:25: warning[-Wanalyzer-malloc-leak]: leak of ‘freetab’
xfsprogs-6.17.0/repair/phase6.c:3348:1: enter_function: entry to ‘update_missing_dotdot_entries’
xfsprogs-6.17.0/repair/phase6.c:3358:16: branch_true: following ‘true’ branch...
xfsprogs-6.17.0/repair/phase6.c:3359:23: branch_true: ...to here
xfsprogs-6.17.0/repair/phase6.c:3362:17: call_function: calling ‘process_dir_inode’ from ‘update_missing_dotdot_entries’
# 2492|   	} else {
# 2493|   		if (fixit || dotdot_update)
# 2494|-> 			do_warn(
# 2495|   	_("would rebuild directory inode %" PRIu64 "\n"), ino);
# 2496|   	}

Error: GCC_ANALYZER_WARNING (CWE-457): [#def252]
xfsprogs-6.17.0/repair/phase6.c:3532:17: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘ip’
xfsprogs-6.17.0/repair/phase6.c:3491:12: branch_true: following ‘true’ branch...
xfsprogs-6.17.0/repair/phase6.c:3494:13: branch_true: ...to here
xfsprogs-6.17.0/repair/phase6.c:3494:12: branch_false: following ‘false’ branch...
xfsprogs-6.17.0/repair/phase6.c:3500:14: branch_false: ...to here
xfsprogs-6.17.0/repair/phase6.c:3500:12: branch_true: following ‘true’ branch...
xfsprogs-6.17.0/repair/phase6.c:3515:13: branch_true: ...to here
xfsprogs-6.17.0/repair/phase6.c:3515:12: branch_false: following ‘false’ branch...
xfsprogs-6.17.0/repair/phase6.c:3529:42: branch_false: ...to here
xfsprogs-6.17.0/repair/phase6.c:3532:17: danger: use of uninitialized value ‘ip’ here
# 3530|   
# 3531|   		/* Erase parent pointers before we create the new link */
# 3532|-> 		try_erase_parent_ptrs(ip);
# 3533|   
# 3534|   		error = -libxfs_dqinode_metadir_link(dp, type, ip);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def253]
xfsprogs-6.17.0/repair/pptr.c:463:26: warning[-Wanalyzer-malloc-leak]: leak of ‘buf’
xfsprogs-6.17.0/repair/pptr.c:1205:1: enter_function: entry to ‘check_file_parent_ptrs’
xfsprogs-6.17.0/repair/pptr.c:1213:12: branch_false: following ‘false’ branch...
xfsprogs-6.17.0/repair/pptr.c:1217:9: branch_false: ...to here
xfsprogs-6.17.0/repair/pptr.c:1224:12: branch_false: following ‘false’ branch...
xfsprogs-6.17.0/repair/pptr.c:1235:13: branch_false: ...to here
xfsprogs-6.17.0/repair/pptr.c:1235:12: branch_true: following ‘true’ branch...
xfsprogs-6.17.0/repair/pptr.c:1236:17: call_function: calling ‘remove_garbage_xattrs’ from ‘check_file_parent_ptrs’
#  461|   		args.value = buf + ga->attrnamelen;
#  462|   
#  463|-> 		error = -xfblob_load(fscan->garbage_xattr_names,
#  464|   				ga->attrname_cookie, buf, ga->attrnamelen);
#  465|   		if (error)

Error: GCC_ANALYZER_WARNING (CWE-401): [#def254]
xfsprogs-6.17.0/repair/progress.c:196:17: warning[-Wanalyzer-malloc-leak]: leak of ‘msgbuf’
xfsprogs-6.17.0/repair/progress.c:178:12: branch_false: following ‘false’ branch...
xfsprogs-6.17.0/repair/progress.c:181:31: branch_false: ...to here
xfsprogs-6.17.0/repair/progress.c:181:31: acquire_memory: allocated here
xfsprogs-6.17.0/repair/progress.c:181:12: branch_false: following ‘false’ branch (when ‘msgbuf’ is non-NULL)...
xfsprogs-6.17.0/repair/progress.c:184:9: branch_false: ...to here
xfsprogs-6.17.0/repair/progress.c:195:12: branch_true: following ‘true’ branch...
xfsprogs-6.17.0/repair/progress.c:196:26: branch_true: ...to here
xfsprogs-6.17.0/repair/progress.c:196:17: throw: if ‘do_error’ throws an exception...
xfsprogs-6.17.0/repair/progress.c:196:17: danger: ‘msgbuf’ leaks here; was allocated at [(3)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/2)
#  194|   
#  195|   	if (timer_create (CLOCK_REALTIME, NULL, &timerid))
#  196|-> 		do_error(_("progress_rpt: cannot create timer\n"));
#  197|   
#  198|   	if (timer_settime (timerid, 0, &timespec, NULL))

Error: GCC_ANALYZER_WARNING (CWE-401): [#def255]
xfsprogs-6.17.0/repair/progress.c:199:17: warning[-Wanalyzer-malloc-leak]: leak of ‘msgbuf’
xfsprogs-6.17.0/repair/progress.c:178:12: branch_false: following ‘false’ branch...
xfsprogs-6.17.0/repair/progress.c:181:31: branch_false: ...to here
xfsprogs-6.17.0/repair/progress.c:181:31: acquire_memory: allocated here
xfsprogs-6.17.0/repair/progress.c:181:12: branch_false: following ‘false’ branch (when ‘msgbuf’ is non-NULL)...
xfsprogs-6.17.0/repair/progress.c:184:9: branch_false: ...to here
xfsprogs-6.17.0/repair/progress.c:195:12: branch_false: following ‘false’ branch...
xfsprogs-6.17.0/repair/progress.c:198:13: branch_false: ...to here
xfsprogs-6.17.0/repair/progress.c:198:12: branch_true: following ‘true’ branch...
xfsprogs-6.17.0/repair/progress.c:199:26: branch_true: ...to here
xfsprogs-6.17.0/repair/progress.c:199:17: throw: if ‘do_error’ throws an exception...
xfsprogs-6.17.0/repair/progress.c:199:17: danger: ‘msgbuf’ leaks here; was allocated at [(3)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/2)
#  197|   
#  198|   	if (timer_settime (timerid, 0, &timespec, NULL))
#  199|-> 		do_error(_("progress_rpt: cannot set timer\n"));
#  200|   
#  201|   	/*

Error: GCC_ANALYZER_WARNING (CWE-401): [#def256]
xfsprogs-6.17.0/repair/progress.c:209:9: warning[-Wanalyzer-malloc-leak]: leak of ‘msgbuf’
xfsprogs-6.17.0/repair/progress.c:178:12: branch_false: following ‘false’ branch...
xfsprogs-6.17.0/repair/progress.c:181:31: branch_false: ...to here
xfsprogs-6.17.0/repair/progress.c:181:31: acquire_memory: allocated here
xfsprogs-6.17.0/repair/progress.c:181:12: branch_false: following ‘false’ branch (when ‘msgbuf’ is non-NULL)...
xfsprogs-6.17.0/repair/progress.c:184:9: branch_false: ...to here
xfsprogs-6.17.0/repair/progress.c:195:12: branch_false: following ‘false’ branch...
xfsprogs-6.17.0/repair/progress.c:198:13: branch_false: ...to here
xfsprogs-6.17.0/repair/progress.c:198:12: branch_false: following ‘false’ branch...
xfsprogs-6.17.0/repair/progress.c:206:9: branch_false: ...to here
xfsprogs-6.17.0/repair/progress.c:209:9: throw: if ‘sigwait’ throws an exception...
xfsprogs-6.17.0/repair/progress.c:209:9: danger: ‘msgbuf’ leaks here; was allocated at [(3)](sarif:/runs/0/results/2/codeFlows/0/threadFlows/0/locations/2)
#  207|   	sigaddset (&sigs_to_catch, SIGALRM);
#  208|   	sigaddset (&sigs_to_catch, SIGHUP);
#  209|-> 	sigwait (&sigs_to_catch, &caught);
#  210|   
#  211|   	while (caught != SIGHUP) {

Error: GCC_ANALYZER_WARNING (CWE-401): [#def257]
xfsprogs-6.17.0/repair/progress.c:223:25: warning[-Wanalyzer-malloc-leak]: leak of ‘msgbuf’
xfsprogs-6.17.0/repair/progress.c:178:12: branch_false: following ‘false’ branch...
xfsprogs-6.17.0/repair/progress.c:181:31: branch_false: ...to here
xfsprogs-6.17.0/repair/progress.c:181:31: acquire_memory: allocated here
xfsprogs-6.17.0/repair/progress.c:181:12: branch_false: following ‘false’ branch (when ‘msgbuf’ is non-NULL)...
xfsprogs-6.17.0/repair/progress.c:184:9: branch_false: ...to here
xfsprogs-6.17.0/repair/progress.c:195:12: branch_false: following ‘false’ branch...
xfsprogs-6.17.0/repair/progress.c:198:13: branch_false: ...to here
xfsprogs-6.17.0/repair/progress.c:198:12: branch_false: following ‘false’ branch...
xfsprogs-6.17.0/repair/progress.c:206:9: branch_false: ...to here
xfsprogs-6.17.0/repair/progress.c:211:16: branch_true: following ‘true’ branch...
xfsprogs-6.17.0/repair/progress.c:222:21: branch_true: ...to here
xfsprogs-6.17.0/repair/progress.c:222:20: branch_true: following ‘true’ branch...
xfsprogs-6.17.0/repair/progress.c:223:34: branch_true: ...to here
xfsprogs-6.17.0/repair/progress.c:223:25: throw: if ‘do_error’ throws an exception...
xfsprogs-6.17.0/repair/progress.c:223:25: danger: ‘msgbuf’ leaks here; was allocated at [(3)](sarif:/runs/0/results/3/codeFlows/0/threadFlows/0/locations/2)
#  221|   
#  222|   		if (pthread_mutex_lock(&msgp->mutex)) {
#  223|-> 			do_error(_("progress_rpt: cannot lock progress mutex\n"));
#  224|   		}
#  225|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def258]
xfsprogs-6.17.0/repair/progress.c:260:17: warning[-Wanalyzer-malloc-leak]: leak of ‘msgbuf’
xfsprogs-6.17.0/repair/progress.c:178:12: branch_false: following ‘false’ branch...
xfsprogs-6.17.0/repair/progress.c:181:31: branch_false: ...to here
xfsprogs-6.17.0/repair/progress.c:181:31: acquire_memory: allocated here
xfsprogs-6.17.0/repair/progress.c:181:12: branch_false: following ‘false’ branch (when ‘msgbuf’ is non-NULL)...
xfsprogs-6.17.0/repair/progress.c:184:9: branch_false: ...to here
xfsprogs-6.17.0/repair/progress.c:195:12: branch_false: following ‘false’ branch...
xfsprogs-6.17.0/repair/progress.c:198:13: branch_false: ...to here
xfsprogs-6.17.0/repair/progress.c:198:12: branch_false: following ‘false’ branch...
xfsprogs-6.17.0/repair/progress.c:206:9: branch_false: ...to here
xfsprogs-6.17.0/repair/progress.c:211:16: branch_true: following ‘true’ branch...
xfsprogs-6.17.0/repair/progress.c:222:21: branch_true: ...to here
xfsprogs-6.17.0/repair/progress.c:222:20: branch_false: following ‘false’ branch...
xfsprogs-6.17.0/repair/progress.c:226:21: branch_false: ...to here
xfsprogs-6.17.0/repair/progress.c:226:20: branch_false: following ‘false’ branch...
xfsprogs-6.17.0/repair/progress.c:229:23: branch_false: ...to here
xfsprogs-6.17.0/repair/progress.c:238:29: branch_false: following ‘false’ branch...
xfsprogs-6.17.0/repair/progress.c:243:24: branch_false: ...to here
xfsprogs-6.17.0/repair/progress.c:260:17: throw: if ‘do_log’ throws an exception...
xfsprogs-6.17.0/repair/progress.c:260:17: danger: ‘msgbuf’ leaks here; was allocated at [(3)](sarif:/runs/0/results/4/codeFlows/0/threadFlows/0/locations/2)
#  258|   		}
#  259|   
#  260|-> 		do_log(_("%s"), msgbuf);
#  261|   		elapsed = now - phase_times[current_phase].start;
#  262|   		if ((msgp->format->format == FMT1) && sum && elapsed &&

Error: GCC_ANALYZER_WARNING (CWE-401): [#def259]
xfsprogs-6.17.0/repair/progress.c:288:17: warning[-Wanalyzer-malloc-leak]: leak of ‘msgbuf’
xfsprogs-6.17.0/repair/progress.c:178:12: branch_false: following ‘false’ branch...
xfsprogs-6.17.0/repair/progress.c:181:31: branch_false: ...to here
xfsprogs-6.17.0/repair/progress.c:181:31: acquire_memory: allocated here
xfsprogs-6.17.0/repair/progress.c:181:12: branch_false: following ‘false’ branch (when ‘msgbuf’ is non-NULL)...
xfsprogs-6.17.0/repair/progress.c:184:9: branch_false: ...to here
xfsprogs-6.17.0/repair/progress.c:195:12: branch_false: following ‘false’ branch...
xfsprogs-6.17.0/repair/progress.c:198:13: branch_false: ...to here
xfsprogs-6.17.0/repair/progress.c:198:12: branch_false: following ‘false’ branch...
xfsprogs-6.17.0/repair/progress.c:206:9: branch_false: ...to here
xfsprogs-6.17.0/repair/progress.c:287:12: branch_true: following ‘true’ branch...
xfsprogs-6.17.0/repair/progress.c:288:25: branch_true: ...to here
xfsprogs-6.17.0/repair/progress.c:288:17: throw: if ‘do_warn’ throws an exception...
xfsprogs-6.17.0/repair/progress.c:288:17: danger: ‘msgbuf’ leaks here; was allocated at [(3)](sarif:/runs/0/results/5/codeFlows/0/threadFlows/0/locations/2)
#  286|   
#  287|   	if (timer_delete (timerid))
#  288|-> 		do_warn(_("cannot delete timer\n"));
#  289|   
#  290|   	free (msgbuf);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def260]
xfsprogs-6.17.0/repair/rcbag.c:50:25: warning[-Wanalyzer-malloc-leak]: leak of ‘bag’
xfsprogs-6.17.0/repair/rcbag.c:42:15: acquire_memory: allocated here
xfsprogs-6.17.0/repair/rcbag.c:43:12: branch_false: following ‘false’ branch (when ‘bag’ is non-NULL)...
xfsprogs-6.17.0/repair/rcbag.c:47:9: branch_false: ...to here
xfsprogs-6.17.0/repair/rcbag.c:50:25: throw: if ‘rcbagbt_calc_size’ throws an exception...
xfsprogs-6.17.0/repair/rcbag.c:50:25: danger: ‘bag’ leaks here; was allocated at [(1)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/0)
#   48|   
#   49|   	/* Need to save space for the head block */
#   50|-> 	maxbytes = (1 + rcbagbt_calc_size(max_rmaps)) * getpagesize();
#   51|   	descr = kasprintf(GFP_KERNEL, "xfs_repair (%s): refcount bag",
#   52|   			mp->m_fsname);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def261]
xfsprogs-6.17.0/repair/rcbag.c:51:17: warning[-Wanalyzer-malloc-leak]: leak of ‘bag’
xfsprogs-6.17.0/repair/rcbag.c:42:15: acquire_memory: allocated here
xfsprogs-6.17.0/repair/rcbag.c:43:12: branch_false: following ‘false’ branch (when ‘bag’ is non-NULL)...
xfsprogs-6.17.0/repair/rcbag.c:47:9: branch_false: ...to here
xfsprogs-6.17.0/repair/rcbag.c:51:17: throw: if ‘kasprintf’ throws an exception...
xfsprogs-6.17.0/repair/rcbag.c:51:17: danger: ‘bag’ leaks here; was allocated at [(1)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/0)
#   49|   	/* Need to save space for the head block */
#   50|   	maxbytes = (1 + rcbagbt_calc_size(max_rmaps)) * getpagesize();
#   51|-> 	descr = kasprintf(GFP_KERNEL, "xfs_repair (%s): refcount bag",
#   52|   			mp->m_fsname);
#   53|   	error = -xmbuf_alloc(mp, descr, maxbytes, &bag->btp);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def262]
xfsprogs-6.17.0/repair/rcbag.c:53:18: warning[-Wanalyzer-malloc-leak]: leak of ‘bag’
xfsprogs-6.17.0/repair/rcbag.c:42:15: acquire_memory: allocated here
xfsprogs-6.17.0/repair/rcbag.c:43:12: branch_false: following ‘false’ branch (when ‘bag’ is non-NULL)...
xfsprogs-6.17.0/repair/rcbag.c:47:9: branch_false: ...to here
xfsprogs-6.17.0/repair/rcbag.c:53:18: throw: if ‘xmbuf_alloc’ throws an exception...
xfsprogs-6.17.0/repair/rcbag.c:53:18: danger: ‘bag’ leaks here; was allocated at [(1)](sarif:/runs/0/results/2/codeFlows/0/threadFlows/0/locations/0)
#   51|   	descr = kasprintf(GFP_KERNEL, "xfs_repair (%s): refcount bag",
#   52|   			mp->m_fsname);
#   53|-> 	error = -xmbuf_alloc(mp, descr, maxbytes, &bag->btp);
#   54|   	kfree(descr);
#   55|   	if (error)

Error: GCC_ANALYZER_WARNING (CWE-457): [#def263]
xfsprogs-6.17.0/repair/rt.c:507:37: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘error’
xfsprogs-6.17.0/repair/rt.c:489:1: enter_function: entry to ‘discover_rtgroup_inodes’
xfsprogs-6.17.0/repair/rt.c:504:23: call_function: calling ‘xfs_rtgroup_next’ from ‘discover_rtgroup_inodes’
xfsprogs-6.17.0/repair/rt.c:504:23: return_function: returning to ‘discover_rtgroup_inodes’ from ‘xfs_rtgroup_next’
xfsprogs-6.17.0/repair/rt.c:504:16: branch_true: following ‘true’ branch...
xfsprogs-6.17.0/repair/rt.c:504:16: branch_true: ...to here
xfsprogs-6.17.0/repair/rt.c:505:29: branch_true: following ‘true’ branch (when ‘i != 4’)...
xfsprogs-6.17.0/repair/rt.c:506:32: branch_true: ...to here
xfsprogs-6.17.0/repair/rt.c:507:37: danger: use of uninitialized value ‘error’ here
#  505|   		for (i = 0; i < XFS_RTGI_MAX; i++) {
#  506|   			err2 = mark_rtginode(tp, rtg, i);
#  507|-> 			if (err2 && !error)
#  508|   				error = err2;
#  509|   		}

Error: GCC_ANALYZER_WARNING (CWE-457): [#def264]
xfsprogs-6.17.0/repair/rt.c:514:13: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘error’
xfsprogs-6.17.0/repair/rt.c:489:1: enter_function: entry to ‘discover_rtgroup_inodes’
xfsprogs-6.17.0/repair/rt.c:504:23: call_function: calling ‘xfs_rtgroup_next’ from ‘discover_rtgroup_inodes’
xfsprogs-6.17.0/repair/rt.c:504:23: return_function: returning to ‘discover_rtgroup_inodes’ from ‘xfs_rtgroup_next’
xfsprogs-6.17.0/repair/rt.c:504:16: branch_false: following ‘false’ branch...
xfsprogs-6.17.0/repair/rt.c:512:1: branch_false: ...to here
xfsprogs-6.17.0/repair/rt.c:514:12: branch_true: following ‘true’ branch...
xfsprogs-6.17.0/repair/rt.c:514:13: branch_true: ...to here
xfsprogs-6.17.0/repair/rt.c:514:13: danger: use of uninitialized value ‘error’ here
#  512|   out_cancel:
#  513|   	libxfs_trans_cancel(tp);
#  514|-> 	if (xfs_has_rtgroups(mp) && error) {
#  515|   		/*
#  516|   		 * Old xfs_repair didn't complain if rtbitmaps didn't load

Error: GCC_ANALYZER_WARNING (CWE-401): [#def265]
xfsprogs-6.17.0/repair/sb.c:137:17: warning[-Wanalyzer-malloc-leak]: leak of ‘sb’
xfsprogs-6.17.0/repair/sb.c:204:1: enter_function: entry to ‘find_secondary_sb’
xfsprogs-6.17.0/repair/sb.c:219:13: call_function: inlined call to ‘verify_sb_blocksize’ from ‘find_secondary_sb’
xfsprogs-6.17.0/repair/sb.c:220:34: branch_false: ...to here
xfsprogs-6.17.0/repair/sb.c:221:20: branch_true: following ‘true’ branch...
xfsprogs-6.17.0/repair/sb.c:222:34: branch_true: ...to here
xfsprogs-6.17.0/repair/sb.c:222:34: call_function: calling ‘__find_secondary_sb’ from ‘find_secondary_sb’
#  135|   			done = 1;
#  136|   
#  137|-> 		do_warn(".");
#  138|   
#  139|   		/*

Error: GCC_ANALYZER_WARNING (CWE-401): [#def266]
xfsprogs-6.17.0/repair/sb.c:145:25: warning[-Wanalyzer-malloc-leak]: leak of ‘sb’
xfsprogs-6.17.0/repair/sb.c:204:1: enter_function: entry to ‘find_secondary_sb’
xfsprogs-6.17.0/repair/sb.c:219:13: call_function: inlined call to ‘verify_sb_blocksize’ from ‘find_secondary_sb’
xfsprogs-6.17.0/repair/sb.c:220:34: branch_false: ...to here
xfsprogs-6.17.0/repair/sb.c:221:20: branch_true: following ‘true’ branch...
xfsprogs-6.17.0/repair/sb.c:222:34: branch_true: ...to here
xfsprogs-6.17.0/repair/sb.c:222:34: call_function: calling ‘__find_secondary_sb’ from ‘find_secondary_sb’
#  143|   		for (i = 0; !done && i < bsize; i += BBSIZE)  {
#  144|   			c_bufsb = (char *)sb + i;
#  145|-> 			libxfs_sb_from_disk(&bufsb, (struct xfs_dsb *)c_bufsb);
#  146|   
#  147|   			if (verify_sb(c_bufsb, &bufsb, 0) != XR_OK)

Error: GCC_ANALYZER_WARNING (CWE-401): [#def267]
xfsprogs-6.17.0/repair/sb.c:403:14: warning[-Wanalyzer-malloc-leak]: leak of ‘list’
xfsprogs-6.17.0/repair/sb.c:708:1: enter_function: entry to ‘verify_set_primary_sb’
xfsprogs-6.17.0/repair/sb.c:740:9: call_function: calling ‘get_sb_geometry’ from ‘verify_set_primary_sb’
xfsprogs-6.17.0/repair/sb.c:740:9: return_function: returning to ‘verify_set_primary_sb’ from ‘get_sb_geometry’
xfsprogs-6.17.0/repair/sb.c:741:16: call_function: calling ‘add_geo’ from ‘verify_set_primary_sb’
xfsprogs-6.17.0/repair/sb.c:741:16: return_function: returning to ‘verify_set_primary_sb’ from ‘add_geo’
xfsprogs-6.17.0/repair/sb.c:747:24: branch_true: following ‘true’ branch...
xfsprogs-6.17.0/repair/sb.c:748:23: branch_true: ...to here
xfsprogs-6.17.0/repair/sb.c:750:26: call_function: calling ‘get_sb’ from ‘verify_set_primary_sb’
#  401|   		return(XR_BAD_MAGIC);
#  402|   
#  403|-> 	if (!xfs_sb_good_version(sb))
#  404|   		return(XR_BAD_VERSION);
#  405|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def268]
xfsprogs-6.17.0/repair/sb.c:552:9: warning[-Wanalyzer-malloc-leak]: leak of ‘buf’
xfsprogs-6.17.0/repair/sb.c:537:12: branch_false: following ‘false’ branch...
xfsprogs-6.17.0/repair/sb.c:540:15: branch_false: ...to here
xfsprogs-6.17.0/repair/sb.c:540:15: acquire_memory: allocated here
xfsprogs-6.17.0/repair/sb.c:541:12: branch_false: following ‘false’ branch (when ‘buf’ is non-NULL)...
xfsprogs-6.17.0/repair/sb.c:545:9: branch_false: ...to here
xfsprogs-6.17.0/repair/sb.c:547:12: branch_false: following ‘false’ branch...
xfsprogs-6.17.0/repair/sb.c:552:9: branch_false: ...to here
xfsprogs-6.17.0/repair/sb.c:552:9: throw: if ‘libxfs_sb_to_disk’ throws an exception...
xfsprogs-6.17.0/repair/sb.c:552:9: danger: ‘buf’ leaks here; was allocated at [(3)](sarif:/runs/0/results/4/codeFlows/0/threadFlows/0/locations/2)
#  550|   	}
#  551|   
#  552|-> 	libxfs_sb_to_disk(buf, sbp);
#  553|   
#  554|   	if (xfs_sb_version_hascrc(sbp))

Error: GCC_ANALYZER_WARNING (CWE-401): [#def269]
xfsprogs-6.17.0/repair/sb.c:574:24: warning[-Wanalyzer-malloc-leak]: leak of ‘list’
xfsprogs-6.17.0/repair/sb.c:708:1: enter_function: entry to ‘verify_set_primary_sb’
xfsprogs-6.17.0/repair/sb.c:740:9: call_function: calling ‘get_sb_geometry’ from ‘verify_set_primary_sb’
xfsprogs-6.17.0/repair/sb.c:740:9: return_function: returning to ‘verify_set_primary_sb’ from ‘get_sb_geometry’
xfsprogs-6.17.0/repair/sb.c:741:16: call_function: calling ‘add_geo’ from ‘verify_set_primary_sb’
xfsprogs-6.17.0/repair/sb.c:741:16: return_function: returning to ‘verify_set_primary_sb’ from ‘add_geo’
xfsprogs-6.17.0/repair/sb.c:747:24: branch_true: following ‘true’ branch...
xfsprogs-6.17.0/repair/sb.c:748:23: branch_true: ...to here
xfsprogs-6.17.0/repair/sb.c:750:26: call_function: calling ‘get_sb’ from ‘verify_set_primary_sb’
#  572|   	struct xfs_dsb *buf;
#  573|   
#  574|-> 	buf = memalign(libxfs_device_alignment(), size);
#  575|   	if (buf == NULL) {
#  576|   		do_error(

Error: GCC_ANALYZER_WARNING (CWE-401): [#def270]
xfsprogs-6.17.0/repair/sb.c:576:17: warning[-Wanalyzer-malloc-leak]: leak of ‘list’
xfsprogs-6.17.0/repair/sb.c:708:1: enter_function: entry to ‘verify_set_primary_sb’
xfsprogs-6.17.0/repair/sb.c:740:9: call_function: calling ‘get_sb_geometry’ from ‘verify_set_primary_sb’
xfsprogs-6.17.0/repair/sb.c:740:9: return_function: returning to ‘verify_set_primary_sb’ from ‘get_sb_geometry’
xfsprogs-6.17.0/repair/sb.c:741:16: call_function: calling ‘add_geo’ from ‘verify_set_primary_sb’
xfsprogs-6.17.0/repair/sb.c:741:16: return_function: returning to ‘verify_set_primary_sb’ from ‘add_geo’
xfsprogs-6.17.0/repair/sb.c:747:24: branch_true: following ‘true’ branch...
xfsprogs-6.17.0/repair/sb.c:748:23: branch_true: ...to here
xfsprogs-6.17.0/repair/sb.c:750:26: call_function: calling ‘get_sb’ from ‘verify_set_primary_sb’
#  574|   	buf = memalign(libxfs_device_alignment(), size);
#  575|   	if (buf == NULL) {
#  576|-> 		do_error(
#  577|   	_("error reading superblock %u -- failed to memalign buffer\n"),
#  578|   			agno);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def271]
xfsprogs-6.17.0/repair/sb.c:587:17: warning[-Wanalyzer-malloc-leak]: leak of ‘buf’
xfsprogs-6.17.0/repair/sb.c:574:15: acquire_memory: allocated here
xfsprogs-6.17.0/repair/sb.c:575:12: branch_false: following ‘false’ branch (when ‘buf’ is non-NULL)...
xfsprogs-6.17.0/repair/sb.c:581:9: branch_false: ...to here
xfsprogs-6.17.0/repair/sb.c:586:12: branch_true: following ‘true’ branch...
xfsprogs-6.17.0/repair/sb.c:588:9: branch_true: ...to here
xfsprogs-6.17.0/repair/sb.c:587:17: throw: if ‘do_warn’ throws an exception...
xfsprogs-6.17.0/repair/sb.c:587:17: danger: ‘buf’ leaks here; was allocated at [(1)](sarif:/runs/0/results/7/codeFlows/0/threadFlows/0/locations/0)
#  585|   
#  586|   	if (lseek(x.data.fd, off, SEEK_SET) != off)  {
#  587|-> 		do_warn(
#  588|   	_("error reading superblock %u -- seek to offset %" PRId64 " failed\n"),
#  589|   			agno, off);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def272]
xfsprogs-6.17.0/repair/sb.c:587:17: warning[-Wanalyzer-malloc-leak]: leak of ‘list’
xfsprogs-6.17.0/repair/sb.c:708:1: enter_function: entry to ‘verify_set_primary_sb’
xfsprogs-6.17.0/repair/sb.c:740:9: call_function: calling ‘get_sb_geometry’ from ‘verify_set_primary_sb’
xfsprogs-6.17.0/repair/sb.c:740:9: return_function: returning to ‘verify_set_primary_sb’ from ‘get_sb_geometry’
xfsprogs-6.17.0/repair/sb.c:741:16: call_function: calling ‘add_geo’ from ‘verify_set_primary_sb’
xfsprogs-6.17.0/repair/sb.c:741:16: return_function: returning to ‘verify_set_primary_sb’ from ‘add_geo’
xfsprogs-6.17.0/repair/sb.c:747:24: branch_true: following ‘true’ branch...
xfsprogs-6.17.0/repair/sb.c:748:23: branch_true: ...to here
xfsprogs-6.17.0/repair/sb.c:750:26: call_function: calling ‘get_sb’ from ‘verify_set_primary_sb’
#  585|   
#  586|   	if (lseek(x.data.fd, off, SEEK_SET) != off)  {
#  587|-> 		do_warn(
#  588|   	_("error reading superblock %u -- seek to offset %" PRId64 " failed\n"),
#  589|   			agno, off);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def273]
xfsprogs-6.17.0/repair/sb.c:596:17: warning[-Wanalyzer-malloc-leak]: leak of ‘buf’
xfsprogs-6.17.0/repair/sb.c:574:15: acquire_memory: allocated here
xfsprogs-6.17.0/repair/sb.c:575:12: branch_false: following ‘false’ branch (when ‘buf’ is non-NULL)...
xfsprogs-6.17.0/repair/sb.c:581:9: branch_false: ...to here
xfsprogs-6.17.0/repair/sb.c:586:12: branch_false: following ‘false’ branch...
xfsprogs-6.17.0/repair/sb.c:594:21: branch_false: ...to here
xfsprogs-6.17.0/repair/sb.c:594:12: branch_true: following ‘true’ branch (when ‘size != rval’)...
xfsprogs-6.17.0/repair/sb.c:595:25: branch_true: ...to here
xfsprogs-6.17.0/repair/sb.c:596:17: throw: if ‘do_warn’ throws an exception...
xfsprogs-6.17.0/repair/sb.c:596:17: danger: ‘buf’ leaks here; was allocated at [(1)](sarif:/runs/0/results/9/codeFlows/0/threadFlows/0/locations/0)
#  594|   	if ((rval = read(x.data.fd, buf, size)) != size)  {
#  595|   		error = errno;
#  596|-> 		do_warn(
#  597|   	_("superblock read failed, offset %" PRId64 ", size %d, ag %u, rval %d\n"),
#  598|   			off, size, agno, rval);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def274]
xfsprogs-6.17.0/repair/sb.c:596:17: warning[-Wanalyzer-malloc-leak]: leak of ‘list’
xfsprogs-6.17.0/repair/sb.c:708:1: enter_function: entry to ‘verify_set_primary_sb’
xfsprogs-6.17.0/repair/sb.c:740:9: call_function: calling ‘get_sb_geometry’ from ‘verify_set_primary_sb’
xfsprogs-6.17.0/repair/sb.c:740:9: return_function: returning to ‘verify_set_primary_sb’ from ‘get_sb_geometry’
xfsprogs-6.17.0/repair/sb.c:741:16: call_function: calling ‘add_geo’ from ‘verify_set_primary_sb’
xfsprogs-6.17.0/repair/sb.c:741:16: return_function: returning to ‘verify_set_primary_sb’ from ‘add_geo’
xfsprogs-6.17.0/repair/sb.c:747:24: branch_true: following ‘true’ branch...
xfsprogs-6.17.0/repair/sb.c:748:23: branch_true: ...to here
xfsprogs-6.17.0/repair/sb.c:750:26: call_function: calling ‘get_sb’ from ‘verify_set_primary_sb’
#  594|   	if ((rval = read(x.data.fd, buf, size)) != size)  {
#  595|   		error = errno;
#  596|-> 		do_warn(
#  597|   	_("superblock read failed, offset %" PRId64 ", size %d, ag %u, rval %d\n"),
#  598|   			off, size, agno, rval);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def275]
xfsprogs-6.17.0/repair/sb.c:599:17: warning[-Wanalyzer-malloc-leak]: leak of ‘buf’
xfsprogs-6.17.0/repair/sb.c:574:15: acquire_memory: allocated here
xfsprogs-6.17.0/repair/sb.c:575:12: branch_false: following ‘false’ branch (when ‘buf’ is non-NULL)...
xfsprogs-6.17.0/repair/sb.c:581:9: branch_false: ...to here
xfsprogs-6.17.0/repair/sb.c:586:12: branch_false: following ‘false’ branch...
xfsprogs-6.17.0/repair/sb.c:594:21: branch_false: ...to here
xfsprogs-6.17.0/repair/sb.c:594:12: branch_true: following ‘true’ branch (when ‘size != rval’)...
xfsprogs-6.17.0/repair/sb.c:595:25: branch_true: ...to here
xfsprogs-6.17.0/repair/sb.c:599:17: throw: if ‘do_error’ throws an exception...
xfsprogs-6.17.0/repair/sb.c:599:17: danger: ‘buf’ leaks here; was allocated at [(1)](sarif:/runs/0/results/11/codeFlows/0/threadFlows/0/locations/0)
#  597|   	_("superblock read failed, offset %" PRId64 ", size %d, ag %u, rval %d\n"),
#  598|   			off, size, agno, rval);
#  599|-> 		do_error("%s\n", strerror(error));
#  600|   	}
#  601|   	libxfs_sb_from_disk(sbp, buf);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def276]
xfsprogs-6.17.0/repair/sb.c:599:17: warning[-Wanalyzer-malloc-leak]: leak of ‘list’
xfsprogs-6.17.0/repair/sb.c:708:1: enter_function: entry to ‘verify_set_primary_sb’
xfsprogs-6.17.0/repair/sb.c:740:9: call_function: calling ‘get_sb_geometry’ from ‘verify_set_primary_sb’
xfsprogs-6.17.0/repair/sb.c:740:9: return_function: returning to ‘verify_set_primary_sb’ from ‘get_sb_geometry’
xfsprogs-6.17.0/repair/sb.c:741:16: call_function: calling ‘add_geo’ from ‘verify_set_primary_sb’
xfsprogs-6.17.0/repair/sb.c:741:16: return_function: returning to ‘verify_set_primary_sb’ from ‘add_geo’
xfsprogs-6.17.0/repair/sb.c:747:24: branch_true: following ‘true’ branch...
xfsprogs-6.17.0/repair/sb.c:748:23: branch_true: ...to here
xfsprogs-6.17.0/repair/sb.c:750:26: call_function: calling ‘get_sb’ from ‘verify_set_primary_sb’
#  597|   	_("superblock read failed, offset %" PRId64 ", size %d, ag %u, rval %d\n"),
#  598|   			off, size, agno, rval);
#  599|-> 		do_error("%s\n", strerror(error));
#  600|   	}
#  601|   	libxfs_sb_from_disk(sbp, buf);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def277]
xfsprogs-6.17.0/repair/sb.c:601:9: warning[-Wanalyzer-malloc-leak]: leak of ‘buf’
xfsprogs-6.17.0/repair/sb.c:574:15: acquire_memory: allocated here
xfsprogs-6.17.0/repair/sb.c:575:12: branch_false: following ‘false’ branch (when ‘buf’ is non-NULL)...
xfsprogs-6.17.0/repair/sb.c:581:9: branch_false: ...to here
xfsprogs-6.17.0/repair/sb.c:586:12: branch_false: following ‘false’ branch...
xfsprogs-6.17.0/repair/sb.c:594:21: branch_false: ...to here
xfsprogs-6.17.0/repair/sb.c:594:12: branch_false: following ‘false’ branch (when ‘size == rval’)...
xfsprogs-6.17.0/repair/sb.c:601:9: branch_false: ...to here
xfsprogs-6.17.0/repair/sb.c:601:9: throw: if ‘libxfs_sb_from_disk’ throws an exception...
xfsprogs-6.17.0/repair/sb.c:601:9: danger: ‘buf’ leaks here; was allocated at [(1)](sarif:/runs/0/results/13/codeFlows/0/threadFlows/0/locations/0)
#  599|   		do_error("%s\n", strerror(error));
#  600|   	}
#  601|-> 	libxfs_sb_from_disk(sbp, buf);
#  602|   
#  603|   	rval = verify_sb((char *)buf, sbp, agno == 0);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def278]
xfsprogs-6.17.0/repair/sb.c:601:9: warning[-Wanalyzer-malloc-leak]: leak of ‘list’
xfsprogs-6.17.0/repair/sb.c:708:1: enter_function: entry to ‘verify_set_primary_sb’
xfsprogs-6.17.0/repair/sb.c:740:9: call_function: calling ‘get_sb_geometry’ from ‘verify_set_primary_sb’
xfsprogs-6.17.0/repair/sb.c:740:9: return_function: returning to ‘verify_set_primary_sb’ from ‘get_sb_geometry’
xfsprogs-6.17.0/repair/sb.c:741:16: call_function: calling ‘add_geo’ from ‘verify_set_primary_sb’
xfsprogs-6.17.0/repair/sb.c:741:16: return_function: returning to ‘verify_set_primary_sb’ from ‘add_geo’
xfsprogs-6.17.0/repair/sb.c:747:24: branch_true: following ‘true’ branch...
xfsprogs-6.17.0/repair/sb.c:748:23: branch_true: ...to here
xfsprogs-6.17.0/repair/sb.c:750:26: call_function: calling ‘get_sb’ from ‘verify_set_primary_sb’
#  599|   		do_error("%s\n", strerror(error));
#  600|   	}
#  601|-> 	libxfs_sb_from_disk(sbp, buf);
#  602|   
#  603|   	rval = verify_sb((char *)buf, sbp, agno == 0);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def279]
xfsprogs-6.17.0/repair/sb.c:795:33: warning[-Wanalyzer-malloc-leak]: leak of ‘list’
xfsprogs-6.17.0/repair/sb.c:708:1: enter_function: entry to ‘verify_set_primary_sb’
xfsprogs-6.17.0/repair/sb.c:740:9: call_function: calling ‘get_sb_geometry’ from ‘verify_set_primary_sb’
xfsprogs-6.17.0/repair/sb.c:740:9: return_function: returning to ‘verify_set_primary_sb’ from ‘get_sb_geometry’
xfsprogs-6.17.0/repair/sb.c:741:16: call_function: calling ‘add_geo’ from ‘verify_set_primary_sb’
xfsprogs-6.17.0/repair/sb.c:741:16: return_function: returning to ‘verify_set_primary_sb’ from ‘add_geo’
xfsprogs-6.17.0/repair/sb.c:747:24: branch_false: following ‘false’ branch...
xfsprogs-6.17.0/repair/sb.c:772:22: branch_false: ...to here
xfsprogs-6.17.0/repair/sb.c:772:12: branch_false: following ‘false’ branch...
xfsprogs-6.17.0/repair/sb.c:772:12: branch_false: ...to here
xfsprogs-6.17.0/repair/sb.c:777:19: call_function: inlined call to ‘get_best_geo’ from ‘verify_set_primary_sb’
xfsprogs-6.17.0/repair/sb.c:784:9: branch_false: ...to here
xfsprogs-6.17.0/repair/sb.c:793:20: branch_true: following ‘true’ branch...
xfsprogs-6.17.0/repair/sb.c:794:29: branch_true: ...to here
xfsprogs-6.17.0/repair/sb.c:794:28: branch_true: following ‘true’ branch...
xfsprogs-6.17.0/repair/sb.c:796:9: branch_true: ...to here
xfsprogs-6.17.0/repair/sb.c:795:33: throw: if ‘do_warn’ throws an exception...
xfsprogs-6.17.0/repair/sb.c:795:33: danger: ‘list’ leaks here; was allocated at [(13)](sarif:/runs/0/results/15/codeFlows/0/threadFlows/0/locations/12)
#  793|   		if (current->refs != 2)  {
#  794|   			if (!force_geo)  {
#  795|-> 				do_warn(
#  796|   	_("Only two AGs detected and they do not match - "
#  797|   	  "cannot validate filesystem geometry.\n"

Error: GCC_ANALYZER_WARNING (CWE-401): [#def280]
xfsprogs-6.17.0/repair/sb.c:811:25: warning[-Wanalyzer-malloc-leak]: leak of ‘list’
xfsprogs-6.17.0/repair/sb.c:708:1: enter_function: entry to ‘verify_set_primary_sb’
xfsprogs-6.17.0/repair/sb.c:740:9: call_function: calling ‘get_sb_geometry’ from ‘verify_set_primary_sb’
xfsprogs-6.17.0/repair/sb.c:740:9: return_function: returning to ‘verify_set_primary_sb’ from ‘get_sb_geometry’
xfsprogs-6.17.0/repair/sb.c:741:16: call_function: calling ‘add_geo’ from ‘verify_set_primary_sb’
xfsprogs-6.17.0/repair/sb.c:741:16: return_function: returning to ‘verify_set_primary_sb’ from ‘add_geo’
xfsprogs-6.17.0/repair/sb.c:747:24: branch_false: following ‘false’ branch...
xfsprogs-6.17.0/repair/sb.c:772:22: branch_false: ...to here
xfsprogs-6.17.0/repair/sb.c:772:12: branch_false: following ‘false’ branch...
xfsprogs-6.17.0/repair/sb.c:772:12: branch_false: ...to here
xfsprogs-6.17.0/repair/sb.c:777:19: call_function: inlined call to ‘get_best_geo’ from ‘verify_set_primary_sb’
xfsprogs-6.17.0/repair/sb.c:784:9: branch_false: ...to here
xfsprogs-6.17.0/repair/sb.c:810:20: branch_true: following ‘true’ branch...
xfsprogs-6.17.0/repair/sb.c:812:9: branch_true: ...to here
xfsprogs-6.17.0/repair/sb.c:811:25: throw: if ‘do_warn’ throws an exception...
xfsprogs-6.17.0/repair/sb.c:811:25: danger: ‘list’ leaks here; was allocated at [(13)](sarif:/runs/0/results/16/codeFlows/0/threadFlows/0/locations/12)
#  809|   		 */
#  810|   		if (!force_geo)  {
#  811|-> 			do_warn(
#  812|   	_("Only one AG detected - "
#  813|   	  "cannot validate filesystem geometry.\n"

Error: GCC_ANALYZER_WARNING (CWE-401): [#def281]
xfsprogs-6.17.0/repair/scan.c:3322:17: warning[-Wanalyzer-malloc-leak]: leak of ‘sb’
xfsprogs-6.17.0/repair/scan.c:3309:31: acquire_memory: allocated here
xfsprogs-6.17.0/repair/scan.c:3310:12: branch_false: following ‘false’ branch (when ‘sb’ is non-NULL)...
xfsprogs-6.17.0/repair/scan.c:3315:17: branch_false: ...to here
xfsprogs-6.17.0/repair/scan.c:3317:12: branch_false: following ‘false’ branch...
xfsprogs-6.17.0/repair/scan.c:3321:18: branch_false: ...to here
xfsprogs-6.17.0/repair/scan.c:3321:12: branch_true: following ‘true’ branch...
xfsprogs-6.17.0/repair/scan.c:3322:25: branch_true: ...to here
xfsprogs-6.17.0/repair/scan.c:3322:17: throw: if ‘do_warn’ throws an exception...
xfsprogs-6.17.0/repair/scan.c:3322:17: danger: ‘sb’ leaks here; was allocated at [(1)](sarif:/runs/0/results/2/codeFlows/0/threadFlows/0/locations/0)
# 3320|   	}
# 3321|   	if (sbbuf->b_error == -EFSBADCRC)
# 3322|-> 		do_warn(_("superblock has bad CRC for ag %d\n"), agno);
# 3323|   	libxfs_sb_from_disk(sb, sbbuf->b_addr);
# 3324|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def282]
xfsprogs-6.17.0/repair/scan.c:3323:9: warning[-Wanalyzer-malloc-leak]: leak of ‘sb’
xfsprogs-6.17.0/repair/scan.c:3309:31: acquire_memory: allocated here
xfsprogs-6.17.0/repair/scan.c:3310:12: branch_false: following ‘false’ branch (when ‘sb’ is non-NULL)...
xfsprogs-6.17.0/repair/scan.c:3315:17: branch_false: ...to here
xfsprogs-6.17.0/repair/scan.c:3317:12: branch_false: following ‘false’ branch...
xfsprogs-6.17.0/repair/scan.c:3321:18: branch_false: ...to here
xfsprogs-6.17.0/repair/scan.c:3323:9: throw: if ‘libxfs_sb_from_disk’ throws an exception...
xfsprogs-6.17.0/repair/scan.c:3323:9: danger: ‘sb’ leaks here; was allocated at [(1)](sarif:/runs/0/results/3/codeFlows/0/threadFlows/0/locations/0)
# 3321|   	if (sbbuf->b_error == -EFSBADCRC)
# 3322|   		do_warn(_("superblock has bad CRC for ag %d\n"), agno);
# 3323|-> 	libxfs_sb_from_disk(sb, sbbuf->b_addr);
# 3324|   
# 3325|   	error = salvage_buffer(mp->m_dev,

Error: GCC_ANALYZER_WARNING (CWE-401): [#def283]
xfsprogs-6.17.0/repair/scan.c:3478:9: warning[-Wanalyzer-malloc-leak]: leak of ‘agcnts’
xfsprogs-6.17.0/repair/scan.c:3471:18: acquire_memory: allocated here
xfsprogs-6.17.0/repair/scan.c:3472:12: branch_false: following ‘false’ branch (when ‘agcnts’ is non-NULL)...
xfsprogs-6.17.0/repair/scan.c:3476:9: branch_false: ...to here
xfsprogs-6.17.0/repair/scan.c:3478:9: throw: if ‘create_work_queue’ throws an exception...
xfsprogs-6.17.0/repair/scan.c:3478:9: danger: ‘agcnts’ leaks here; was allocated at [(1)](sarif:/runs/0/results/4/codeFlows/0/threadFlows/0/locations/0)
# 3476|   	memset(agcnts, 0, mp->m_sb.sb_agcount * sizeof(*agcnts));
# 3477|   
# 3478|-> 	create_work_queue(&wq, mp, scan_threads);
# 3479|   
# 3480|   	for (i = 0; i < mp->m_sb.sb_agcount; i++)

Error: GCC_ANALYZER_WARNING (CWE-401): [#def284]
xfsprogs-6.17.0/repair/scan.c:3481:17: warning[-Wanalyzer-malloc-leak]: leak of ‘agcnts’
xfsprogs-6.17.0/repair/scan.c:3471:18: acquire_memory: allocated here
xfsprogs-6.17.0/repair/scan.c:3472:12: branch_false: following ‘false’ branch (when ‘agcnts’ is non-NULL)...
xfsprogs-6.17.0/repair/scan.c:3476:9: branch_false: ...to here
xfsprogs-6.17.0/repair/scan.c:3480:21: branch_true: following ‘true’ branch...
xfsprogs-6.17.0/repair/scan.c:3481:52: branch_true: ...to here
xfsprogs-6.17.0/repair/scan.c:3481:17: throw: if ‘queue_work’ throws an exception...
xfsprogs-6.17.0/repair/scan.c:3481:17: danger: ‘agcnts’ leaks here; was allocated at [(1)](sarif:/runs/0/results/5/codeFlows/0/threadFlows/0/locations/0)
# 3479|   
# 3480|   	for (i = 0; i < mp->m_sb.sb_agcount; i++)
# 3481|-> 		queue_work(&wq, scan_ag, i, &agcnts[i]);
# 3482|   
# 3483|   	destroy_work_queue(&wq);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def285]
xfsprogs-6.17.0/repair/scan.c:3483:9: warning[-Wanalyzer-malloc-leak]: leak of ‘agcnts’
xfsprogs-6.17.0/repair/scan.c:3471:18: acquire_memory: allocated here
xfsprogs-6.17.0/repair/scan.c:3472:12: branch_false: following ‘false’ branch (when ‘agcnts’ is non-NULL)...
xfsprogs-6.17.0/repair/scan.c:3476:9: branch_false: ...to here
xfsprogs-6.17.0/repair/scan.c:3480:21: branch_false: following ‘false’ branch...
xfsprogs-6.17.0/repair/scan.c:3483:9: branch_false: ...to here
xfsprogs-6.17.0/repair/scan.c:3483:9: throw: if ‘destroy_work_queue’ throws an exception...
xfsprogs-6.17.0/repair/scan.c:3483:9: danger: ‘agcnts’ leaks here; was allocated at [(1)](sarif:/runs/0/results/6/codeFlows/0/threadFlows/0/locations/0)
# 3481|   		queue_work(&wq, scan_ag, i, &agcnts[i]);
# 3482|   
# 3483|-> 	destroy_work_queue(&wq);
# 3484|   
# 3485|   	/* tally up the counts */

Error: GCC_ANALYZER_WARNING (CWE-476): [#def286]
xfsprogs-6.17.0/repair/slab.c:229:17: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘qs’
xfsprogs-6.17.0/repair/slab.c:215:12: branch_false: following ‘false’ branch...
xfsprogs-6.17.0/repair/slab.c:225:38: branch_false: ...to here
xfsprogs-6.17.0/repair/slab.c:227:16: branch_true: following ‘true’ branch (when ‘hdr’ is non-NULL)...
xfsprogs-6.17.0/repair/slab.c:228:22: branch_true: ...to here
xfsprogs-6.17.0/repair/slab.c:228:22: acquire_memory: this call could return NULL
xfsprogs-6.17.0/repair/slab.c:229:17: danger: ‘qs’ could be NULL: unchecked value from [(5)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/4)
#  227|   	while (hdr) {
#  228|   		qs = malloc(sizeof(struct qsort_slab));
#  229|-> 		qs->slab = slab;
#  230|   		qs->hdr = hdr;
#  231|   		qs->compare_fn = compare_fn;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def287]
xfsprogs-6.17.0/repair/slab.c:232:17: warning[-Wanalyzer-malloc-leak]: leak of ‘qs’
xfsprogs-6.17.0/repair/slab.c:215:12: branch_false: following ‘false’ branch...
xfsprogs-6.17.0/repair/slab.c:225:38: branch_false: ...to here
xfsprogs-6.17.0/repair/slab.c:227:16: branch_true: following ‘true’ branch (when ‘hdr’ is non-NULL)...
xfsprogs-6.17.0/repair/slab.c:228:22: branch_true: ...to here
xfsprogs-6.17.0/repair/slab.c:228:22: acquire_memory: allocated here
xfsprogs-6.17.0/repair/slab.c:232:17: throw: if ‘queue_work’ throws an exception...
xfsprogs-6.17.0/repair/slab.c:232:17: danger: ‘qs’ leaks here; was allocated at [(5)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/4)
#  230|   		qs->hdr = hdr;
#  231|   		qs->compare_fn = compare_fn;
#  232|-> 		queue_work(&wq, qsort_slab_helper, 0, qs);
#  233|   		hdr = hdr->sh_next;
#  234|   	}

Error: GCC_ANALYZER_WARNING (CWE-401): [#def288]
xfsprogs-6.17.0/repair/strblobs.c:55:18: warning[-Wanalyzer-malloc-leak]: leak of ‘sb’
xfsprogs-6.17.0/repair/strblobs.c:51:14: acquire_memory: allocated here
xfsprogs-6.17.0/repair/strblobs.c:52:12: branch_false: following ‘false’ branch (when ‘sb’ is non-NULL)...
xfsprogs-6.17.0/repair/strblobs.c:55:18: branch_false: ...to here
xfsprogs-6.17.0/repair/strblobs.c:55:18: throw: if ‘xfblob_create’ throws an exception...
xfsprogs-6.17.0/repair/strblobs.c:55:18: danger: ‘sb’ leaks here; was allocated at [(1)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/0)
#   53|   		return ENOMEM;
#   54|   
#   55|-> 	error = -xfblob_create(descr, &sb->strings);
#   56|   	if (error)
#   57|   		goto out_free;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def289]
xfsprogs-6.17.0/repair/strblobs.c:210:17: warning[-Wanalyzer-malloc-leak]: leak of ‘buf’
xfsprogs-6.17.0/repair/strblobs.c:96:1: enter_function: entry to ‘__strblobs_lookup’
xfsprogs-6.17.0/repair/strblobs.c:111:45: branch_true: following ‘true’ branch (when ‘ent’ is non-NULL)...
xfsprogs-6.17.0/repair/strblobs.c:112:21: branch_true: ...to here
xfsprogs-6.17.0/repair/strblobs.c:115:20: branch_true: following ‘true’ branch (when ‘buf’ is NULL)...
xfsprogs-6.17.0/repair/strblobs.c:116:31: branch_true: ...to here
xfsprogs-6.17.0/repair/strblobs.c:116:31: acquire_memory: allocated here
xfsprogs-6.17.0/repair/strblobs.c:117:28: branch_false: following ‘false’ branch (when ‘buf’ is non-NULL)...
xfsprogs-6.17.0/repair/strblobs.c:121:25: branch_false: ...to here
xfsprogs-6.17.0/repair/strblobs.c:121:25: call_function: inlined call to ‘strblobs_load’ from ‘__strblobs_lookup’
#  208|   	unsigned int		str_len)
#  209|   {
#  210|-> 	return -xfblob_load(sblobs->strings, str_cookie, str, str_len);
#  211|   }

Error: GCC_ANALYZER_WARNING (CWE-457): [#def290]
xfsprogs-6.17.0/repair/xfs_repair.c:609:17: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘sb.sb_unit’
xfsprogs-6.17.0/repair/xfs_repair.c:593:24: branch_false: following ‘false’ branch...
xfsprogs-6.17.0/repair/xfs_repair.c:606:29: branch_false: ...to here
xfsprogs-6.17.0/repair/xfs_repair.c:606:12: branch_true: following ‘true’ branch...
xfsprogs-6.17.0/repair/xfs_repair.c:607:25: branch_true: ...to here
xfsprogs-6.17.0/repair/xfs_repair.c:609:17: danger: use of uninitialized value ‘sb.sb_unit’ here
#  607|   		do_warn(_("AG %u superblock contains plausible sb_unit value\n"),
#  608|   				agno);
#  609|-> 		new_sunit = sb.sb_unit;
#  610|   		goto fix;
#  611|   	}

Error: GCC_ANALYZER_WARNING (CWE-401): [#def291]
xfsprogs-6.17.0/repair/xfs_repair.c:840:16: warning[-Wanalyzer-malloc-leak]: leak of ‘msgbuf’
xfsprogs-6.17.0/repair/xfs_repair.c:1086:1: enter_function: entry to ‘main’
xfsprogs-6.17.0/repair/xfs_repair.c:1109:9: call_function: calling ‘process_args’ from ‘main’
xfsprogs-6.17.0/repair/xfs_repair.c:1109:9: return_function: returning to ‘main’ from ‘process_args’
xfsprogs-6.17.0/repair/xfs_repair.c:1112:18: acquire_memory: allocated here
xfsprogs-6.17.0/repair/xfs_repair.c:1128:12: branch_true: following ‘true’ branch...
xfsprogs-6.17.0/repair/xfs_repair.c:1130:24: branch_true: ...to here
xfsprogs-6.17.0/repair/xfs_repair.c:1131:20: branch_true: following ‘true’ branch...
xfsprogs-6.17.0/repair/xfs_repair.c:1132:25: branch_true: ...to here
xfsprogs-6.17.0/repair/xfs_repair.c:1132:25: call_function: calling ‘check_fs_vs_host_sectsize’ from ‘main’
#  838|   	struct xfs_fsop_geom	geom = { 0 };
#  839|   
#  840|-> 	ret = -xfrog_geometry(x.data.fd, &geom);
#  841|   	if (ret) {
#  842|   		do_log(_("Cannot get host filesystem geometry.\n"

Error: GCC_ANALYZER_WARNING (CWE-401): [#def292]
xfsprogs-6.17.0/repair/xfs_repair.c:849:29: warning[-Wanalyzer-malloc-leak]: leak of ‘msgbuf’
xfsprogs-6.17.0/repair/xfs_repair.c:1086:1: enter_function: entry to ‘main’
xfsprogs-6.17.0/repair/xfs_repair.c:1109:9: call_function: calling ‘process_args’ from ‘main’
xfsprogs-6.17.0/repair/xfs_repair.c:1109:9: return_function: returning to ‘main’ from ‘process_args’
xfsprogs-6.17.0/repair/xfs_repair.c:1112:18: acquire_memory: allocated here
xfsprogs-6.17.0/repair/xfs_repair.c:1128:12: branch_true: following ‘true’ branch...
xfsprogs-6.17.0/repair/xfs_repair.c:1130:24: branch_true: ...to here
xfsprogs-6.17.0/repair/xfs_repair.c:1131:20: branch_true: following ‘true’ branch...
xfsprogs-6.17.0/repair/xfs_repair.c:1132:25: branch_true: ...to here
xfsprogs-6.17.0/repair/xfs_repair.c:1132:25: call_function: calling ‘check_fs_vs_host_sectsize’ from ‘main’
#  847|   
#  848|   	if (sb->sb_sectsize < geom.sectsize) {
#  849|-> 		old_flags = fcntl(x.data.fd, F_GETFL, 0);
#  850|   		if (fcntl(x.data.fd, F_SETFL, old_flags & ~O_DIRECT) < 0) {
#  851|   			do_warn(_(

Error: GCC_ANALYZER_WARNING (CWE-401): [#def293]
xfsprogs-6.17.0/repair/xfs_repair.c:850:21: warning[-Wanalyzer-malloc-leak]: leak of ‘msgbuf’
xfsprogs-6.17.0/repair/xfs_repair.c:1086:1: enter_function: entry to ‘main’
xfsprogs-6.17.0/repair/xfs_repair.c:1109:9: call_function: calling ‘process_args’ from ‘main’
xfsprogs-6.17.0/repair/xfs_repair.c:1109:9: return_function: returning to ‘main’ from ‘process_args’
xfsprogs-6.17.0/repair/xfs_repair.c:1112:18: acquire_memory: allocated here
xfsprogs-6.17.0/repair/xfs_repair.c:1128:12: branch_true: following ‘true’ branch...
xfsprogs-6.17.0/repair/xfs_repair.c:1130:24: branch_true: ...to here
xfsprogs-6.17.0/repair/xfs_repair.c:1131:20: branch_true: following ‘true’ branch...
xfsprogs-6.17.0/repair/xfs_repair.c:1132:25: branch_true: ...to here
xfsprogs-6.17.0/repair/xfs_repair.c:1132:25: call_function: calling ‘check_fs_vs_host_sectsize’ from ‘main’
#  848|   	if (sb->sb_sectsize < geom.sectsize) {
#  849|   		old_flags = fcntl(x.data.fd, F_GETFL, 0);
#  850|-> 		if (fcntl(x.data.fd, F_SETFL, old_flags & ~O_DIRECT) < 0) {
#  851|   			do_warn(_(
#  852|   	"Sector size on host filesystem larger than image sector size.\n"

Error: GCC_ANALYZER_WARNING (CWE-401): [#def294]
xfsprogs-6.17.0/repair/xfs_repair.c:1064:9: warning[-Wanalyzer-malloc-leak]: leak of ‘msgbuf’
xfsprogs-6.17.0/repair/xfs_repair.c:1086:1: enter_function: entry to ‘main’
xfsprogs-6.17.0/repair/xfs_repair.c:1109:9: call_function: calling ‘process_args’ from ‘main’
xfsprogs-6.17.0/repair/xfs_repair.c:1109:9: return_function: returning to ‘main’ from ‘process_args’
xfsprogs-6.17.0/repair/xfs_repair.c:1112:18: acquire_memory: allocated here
xfsprogs-6.17.0/repair/xfs_repair.c:1115:9: call_function: calling ‘phase_end’ from ‘main’
# 1062|   	int			phase)
# 1063|   {
# 1064|-> 	timestamp(mp, PHASE_END, phase, NULL);
# 1065|   
# 1066|   	/* Fail if someone injected an post-phase error. */

Error: GCC_ANALYZER_WARNING (CWE-401): [#def295]
xfsprogs-6.17.0/repair/xfs_repair.c:1114:9: warning[-Wanalyzer-malloc-leak]: leak of ‘msgbuf’
xfsprogs-6.17.0/repair/xfs_repair.c:1086:1: enter_function: entry to ‘main’
xfsprogs-6.17.0/repair/xfs_repair.c:1109:9: call_function: calling ‘process_args’ from ‘main’
xfsprogs-6.17.0/repair/xfs_repair.c:1109:9: return_function: returning to ‘main’ from ‘process_args’
xfsprogs-6.17.0/repair/xfs_repair.c:1112:18: acquire_memory: allocated here
xfsprogs-6.17.0/repair/xfs_repair.c:1114:9: throw: if ‘timestamp’ throws an exception...
xfsprogs-6.17.0/repair/xfs_repair.c:1114:9: danger: ‘msgbuf’ leaks here; was allocated at [(9)](sarif:/runs/0/results/6/codeFlows/0/threadFlows/0/locations/8)
# 1112|   	msgbuf = malloc(DURATION_BUF_SIZE);
# 1113|   
# 1114|-> 	timestamp(temp_mp, PHASE_START, 0, NULL);
# 1115|   	phase_end(temp_mp, 0);
# 1116|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def296]
xfsprogs-6.17.0/repair/xfs_repair.c:1130:24: warning[-Wanalyzer-malloc-leak]: leak of ‘msgbuf’
xfsprogs-6.17.0/repair/xfs_repair.c:1086:1: enter_function: entry to ‘main’
xfsprogs-6.17.0/repair/xfs_repair.c:1109:9: call_function: calling ‘process_args’ from ‘main’
xfsprogs-6.17.0/repair/xfs_repair.c:1109:9: return_function: returning to ‘main’ from ‘process_args’
xfsprogs-6.17.0/repair/xfs_repair.c:1112:18: acquire_memory: allocated here
xfsprogs-6.17.0/repair/xfs_repair.c:1128:12: branch_true: following ‘true’ branch...
xfsprogs-6.17.0/repair/xfs_repair.c:1130:24: branch_true: ...to here
xfsprogs-6.17.0/repair/xfs_repair.c:1130:24: throw: if ‘get_sb’ throws an exception...
xfsprogs-6.17.0/repair/xfs_repair.c:1130:24: danger: ‘msgbuf’ leaks here; was allocated at [(9)](sarif:/runs/0/results/7/codeFlows/0/threadFlows/0/locations/8)
# 1128|   	if (isa_file) {
# 1129|   		/* Best effort attempt to validate fs vs host sector size */
# 1130|-> 		rval = get_sb(&psb, 0, XFS_MAX_SECTORSIZE, 0);
# 1131|   		if (rval == XR_OK)
# 1132|   			check_fs_vs_host_sectsize(&psb);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def297]
xfsprogs-6.17.0/repair/xfs_repair.c:1136:9: warning[-Wanalyzer-malloc-leak]: leak of ‘msgbuf’
xfsprogs-6.17.0/repair/xfs_repair.c:1086:1: enter_function: entry to ‘main’
xfsprogs-6.17.0/repair/xfs_repair.c:1109:9: call_function: calling ‘process_args’ from ‘main’
xfsprogs-6.17.0/repair/xfs_repair.c:1109:9: return_function: returning to ‘main’ from ‘process_args’
xfsprogs-6.17.0/repair/xfs_repair.c:1112:18: acquire_memory: allocated here
xfsprogs-6.17.0/repair/xfs_repair.c:1136:9: throw: if ‘phase1’ throws an exception...
xfsprogs-6.17.0/repair/xfs_repair.c:1136:9: danger: ‘msgbuf’ leaks here; was allocated at [(9)](sarif:/runs/0/results/8/codeFlows/0/threadFlows/0/locations/8)
# 1134|   
# 1135|   	/* do phase1 to make sure we have a superblock */
# 1136|-> 	phase1(temp_mp);
# 1137|   	phase_end(temp_mp, 1);
# 1138|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def298]
xfsprogs-6.17.0/repair/xfs_repair.c:1146:16: warning[-Wanalyzer-malloc-leak]: leak of ‘msgbuf’
xfsprogs-6.17.0/repair/xfs_repair.c:1086:1: enter_function: entry to ‘main’
xfsprogs-6.17.0/repair/xfs_repair.c:1109:9: call_function: calling ‘process_args’ from ‘main’
xfsprogs-6.17.0/repair/xfs_repair.c:1109:9: return_function: returning to ‘main’ from ‘process_args’
xfsprogs-6.17.0/repair/xfs_repair.c:1112:18: acquire_memory: allocated here
xfsprogs-6.17.0/repair/xfs_repair.c:1146:16: throw: if ‘get_sb’ throws an exception...
xfsprogs-6.17.0/repair/xfs_repair.c:1146:16: danger: ‘msgbuf’ leaks here; was allocated at [(9)](sarif:/runs/0/results/9/codeFlows/0/threadFlows/0/locations/8)
# 1144|   	}
# 1145|   
# 1146|-> 	rval = get_sb(&psb, 0, XFS_MAX_SECTORSIZE, 0);
# 1147|   	if (rval != XR_OK) {
# 1148|   		do_warn(_("Primary superblock bad after phase 1!\n"

Error: GCC_ANALYZER_WARNING (CWE-401): [#def299]
xfsprogs-6.17.0/repair/xfs_repair.c:1166:14: warning[-Wanalyzer-malloc-leak]: leak of ‘msgbuf’
xfsprogs-6.17.0/repair/xfs_repair.c:1086:1: enter_function: entry to ‘main’
xfsprogs-6.17.0/repair/xfs_repair.c:1109:9: call_function: calling ‘process_args’ from ‘main’
xfsprogs-6.17.0/repair/xfs_repair.c:1109:9: return_function: returning to ‘main’ from ‘process_args’
xfsprogs-6.17.0/repair/xfs_repair.c:1112:18: acquire_memory: allocated here
xfsprogs-6.17.0/repair/xfs_repair.c:1147:12: branch_false: following ‘false’ branch...
xfsprogs-6.17.0/repair/xfs_repair.c:1157:13: branch_false: ...to here
xfsprogs-6.17.0/repair/xfs_repair.c:1166:14: throw: if ‘libxfs_mount’ throws an exception...
xfsprogs-6.17.0/repair/xfs_repair.c:1166:14: danger: ‘msgbuf’ leaks here; was allocated at [(9)](sarif:/runs/0/results/10/codeFlows/0/threadFlows/0/locations/8)
# 1164|   	 */
# 1165|   	memset(&xfs_m, 0, sizeof(xfs_mount_t));
# 1166|-> 	mp = libxfs_mount(&xfs_m, &psb, &x, 0);
# 1167|   
# 1168|   	if (!mp)  {

Error: GCC_ANALYZER_WARNING (CWE-401): [#def300]
xfsprogs-6.17.0/repair/xfs_repair.c:1191:30: warning[-Wanalyzer-malloc-leak]: leak of ‘msgbuf’
xfsprogs-6.17.0/repair/xfs_repair.c:1086:1: enter_function: entry to ‘main’
xfsprogs-6.17.0/repair/xfs_repair.c:1109:9: call_function: calling ‘process_args’ from ‘main’
xfsprogs-6.17.0/repair/xfs_repair.c:1109:9: return_function: returning to ‘main’ from ‘process_args’
xfsprogs-6.17.0/repair/xfs_repair.c:1112:18: acquire_memory: allocated here
xfsprogs-6.17.0/repair/xfs_repair.c:1147:12: branch_false: following ‘false’ branch...
xfsprogs-6.17.0/repair/xfs_repair.c:1157:13: branch_false: ...to here
xfsprogs-6.17.0/repair/xfs_repair.c:1168:12: branch_false: following ‘false’ branch...
xfsprogs-6.17.0/repair/xfs_repair.c:1174:9: branch_false: ...to here
xfsprogs-6.17.0/repair/xfs_repair.c:1191:30: throw: if ‘libxfs_symlink_blocks’ throws an exception...
xfsprogs-6.17.0/repair/xfs_repair.c:1191:30: danger: ‘msgbuf’ leaks here; was allocated at [(9)](sarif:/runs/0/results/11/codeFlows/0/threadFlows/0/locations/8)
# 1189|   
# 1190|   	chunks_pblock = mp->m_sb.sb_inopblock / XFS_INODES_PER_CHUNK;
# 1191|-> 	max_symlink_blocks = libxfs_symlink_blocks(mp, XFS_SYMLINK_MAXLEN);
# 1192|   
# 1193|   	/*

Error: GCC_ANALYZER_WARNING (CWE-401): [#def301]
xfsprogs-6.17.0/repair/xfs_repair.c:1230:35: warning[-Wanalyzer-malloc-leak]: leak of ‘msgbuf’
xfsprogs-6.17.0/repair/xfs_repair.c:1086:1: enter_function: entry to ‘main’
xfsprogs-6.17.0/repair/xfs_repair.c:1109:9: call_function: calling ‘process_args’ from ‘main’
xfsprogs-6.17.0/repair/xfs_repair.c:1109:9: return_function: returning to ‘main’ from ‘process_args’
xfsprogs-6.17.0/repair/xfs_repair.c:1112:18: acquire_memory: allocated here
xfsprogs-6.17.0/repair/xfs_repair.c:1147:12: branch_false: following ‘false’ branch...
xfsprogs-6.17.0/repair/xfs_repair.c:1157:13: branch_false: ...to here
xfsprogs-6.17.0/repair/xfs_repair.c:1168:12: branch_false: following ‘false’ branch...
xfsprogs-6.17.0/repair/xfs_repair.c:1174:9: branch_false: ...to here
xfsprogs-6.17.0/repair/xfs_repair.c:1229:12: branch_true: following ‘true’ branch...
xfsprogs-6.17.0/repair/xfs_repair.c:1230:35: branch_true: ...to here
xfsprogs-6.17.0/repair/xfs_repair.c:1230:35: throw: if ‘platform_nproc’ throws an exception...
xfsprogs-6.17.0/repair/xfs_repair.c:1230:35: danger: ‘msgbuf’ leaks here; was allocated at [(9)](sarif:/runs/0/results/12/codeFlows/0/threadFlows/0/locations/8)
# 1228|   
# 1229|   	if (ag_stride) {
# 1230|-> 		int max_threads = platform_nproc() * 8;
# 1231|   
# 1232|   		thread_count = (glob_agcount + ag_stride - 1) / ag_stride;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def302]
xfsprogs-6.17.0/repair/xfs_repair.c:1239:25: warning[-Wanalyzer-malloc-leak]: leak of ‘msgbuf’
xfsprogs-6.17.0/repair/xfs_repair.c:1086:1: enter_function: entry to ‘main’
xfsprogs-6.17.0/repair/xfs_repair.c:1109:9: call_function: calling ‘process_args’ from ‘main’
xfsprogs-6.17.0/repair/xfs_repair.c:1109:9: return_function: returning to ‘main’ from ‘process_args’
xfsprogs-6.17.0/repair/xfs_repair.c:1112:18: acquire_memory: allocated here
xfsprogs-6.17.0/repair/xfs_repair.c:1147:12: branch_false: following ‘false’ branch...
xfsprogs-6.17.0/repair/xfs_repair.c:1157:13: branch_false: ...to here
xfsprogs-6.17.0/repair/xfs_repair.c:1168:12: branch_false: following ‘false’ branch...
xfsprogs-6.17.0/repair/xfs_repair.c:1174:9: branch_false: ...to here
xfsprogs-6.17.0/repair/xfs_repair.c:1229:12: branch_true: following ‘true’ branch...
xfsprogs-6.17.0/repair/xfs_repair.c:1230:35: branch_true: ...to here
xfsprogs-6.17.0/repair/xfs_repair.c:1238:20: branch_true: following ‘true’ branch...
xfsprogs-6.17.0/repair/xfs_repair.c:1239:25: branch_true: ...to here
xfsprogs-6.17.0/repair/xfs_repair.c:1239:25: throw: if ‘thread_init’ throws an exception...
xfsprogs-6.17.0/repair/xfs_repair.c:1239:25: danger: ‘msgbuf’ leaks here; was allocated at [(9)](sarif:/runs/0/results/13/codeFlows/0/threadFlows/0/locations/8)
# 1237|   		}
# 1238|   		if (thread_count > 0)
# 1239|-> 			thread_init();
# 1240|   		else {
# 1241|   			thread_count = 1;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def303]
xfsprogs-6.17.0/repair/xfs_repair.c:1247:17: warning[-Wanalyzer-malloc-leak]: leak of ‘msgbuf’
xfsprogs-6.17.0/repair/xfs_repair.c:1086:1: enter_function: entry to ‘main’
xfsprogs-6.17.0/repair/xfs_repair.c:1109:9: call_function: calling ‘process_args’ from ‘main’
xfsprogs-6.17.0/repair/xfs_repair.c:1109:9: return_function: returning to ‘main’ from ‘process_args’
xfsprogs-6.17.0/repair/xfs_repair.c:1112:18: acquire_memory: allocated here
xfsprogs-6.17.0/repair/xfs_repair.c:1147:12: branch_false: following ‘false’ branch...
xfsprogs-6.17.0/repair/xfs_repair.c:1157:13: branch_false: ...to here
xfsprogs-6.17.0/repair/xfs_repair.c:1168:12: branch_false: following ‘false’ branch...
xfsprogs-6.17.0/repair/xfs_repair.c:1174:9: branch_false: ...to here
xfsprogs-6.17.0/repair/xfs_repair.c:1229:12: branch_true: following ‘true’ branch...
xfsprogs-6.17.0/repair/xfs_repair.c:1230:35: branch_true: ...to here
xfsprogs-6.17.0/repair/xfs_repair.c:1246:12: branch_true: following ‘true’ branch...
xfsprogs-6.17.0/repair/xfs_repair.c:1247:17: throw: if ‘init_progress_rpt’ throws an exception...
xfsprogs-6.17.0/repair/xfs_repair.c:1247:17: danger: ‘msgbuf’ leaks here; was allocated at [(9)](sarif:/runs/0/results/14/codeFlows/0/threadFlows/0/locations/8)
# 1245|   
# 1246|   	if (ag_stride && report_interval) {
# 1247|-> 		init_progress_rpt();
# 1248|   		if (msgbuf) {
# 1249|   			do_log(_("        - reporting progress in intervals of %s\n"),

Error: GCC_ANALYZER_WARNING (CWE-401): [#def304]
xfsprogs-6.17.0/repair/xfs_repair.c:1249:25: warning[-Wanalyzer-malloc-leak]: leak of ‘msgbuf’
xfsprogs-6.17.0/repair/xfs_repair.c:1086:1: enter_function: entry to ‘main’
xfsprogs-6.17.0/repair/xfs_repair.c:1109:9: call_function: calling ‘process_args’ from ‘main’
xfsprogs-6.17.0/repair/xfs_repair.c:1109:9: return_function: returning to ‘main’ from ‘process_args’
xfsprogs-6.17.0/repair/xfs_repair.c:1112:18: acquire_memory: allocated here
xfsprogs-6.17.0/repair/xfs_repair.c:1147:12: branch_false: following ‘false’ branch...
xfsprogs-6.17.0/repair/xfs_repair.c:1157:13: branch_false: ...to here
xfsprogs-6.17.0/repair/xfs_repair.c:1168:12: branch_false: following ‘false’ branch...
xfsprogs-6.17.0/repair/xfs_repair.c:1174:9: branch_false: ...to here
xfsprogs-6.17.0/repair/xfs_repair.c:1229:12: branch_true: following ‘true’ branch...
xfsprogs-6.17.0/repair/xfs_repair.c:1230:35: branch_true: ...to here
xfsprogs-6.17.0/repair/xfs_repair.c:1246:12: branch_true: following ‘true’ branch...
xfsprogs-6.17.0/repair/xfs_repair.c:1248:20: branch_true: following ‘true’ branch (when ‘msgbuf’ is non-NULL)...
xfsprogs-6.17.0/repair/xfs_repair.c:1249:25: branch_true: ...to here
xfsprogs-6.17.0/repair/xfs_repair.c:1249:25: throw: if ‘duration’ throws an exception...
xfsprogs-6.17.0/repair/xfs_repair.c:1249:25: danger: ‘msgbuf’ leaks here; was allocated at [(9)](sarif:/runs/0/results/15/codeFlows/0/threadFlows/0/locations/8)
# 1247|   		init_progress_rpt();
# 1248|   		if (msgbuf) {
# 1249|-> 			do_log(_("        - reporting progress in intervals of %s\n"),
# 1250|   			duration(report_interval, msgbuf));
# 1251|   		}

Error: GCC_ANALYZER_WARNING (CWE-401): [#def305]
xfsprogs-6.17.0/repair/xfs_repair.c:1274:17: warning[-Wanalyzer-malloc-leak]: leak of ‘msgbuf’
xfsprogs-6.17.0/repair/xfs_repair.c:1086:1: enter_function: entry to ‘main’
xfsprogs-6.17.0/repair/xfs_repair.c:1109:9: call_function: calling ‘process_args’ from ‘main’
xfsprogs-6.17.0/repair/xfs_repair.c:1109:9: return_function: returning to ‘main’ from ‘process_args’
xfsprogs-6.17.0/repair/xfs_repair.c:1112:18: acquire_memory: allocated here
xfsprogs-6.17.0/repair/xfs_repair.c:1147:12: branch_false: following ‘false’ branch...
xfsprogs-6.17.0/repair/xfs_repair.c:1157:13: branch_false: ...to here
xfsprogs-6.17.0/repair/xfs_repair.c:1168:12: branch_false: following ‘false’ branch...
xfsprogs-6.17.0/repair/xfs_repair.c:1174:9: branch_false: ...to here
xfsprogs-6.17.0/repair/xfs_repair.c:1246:12: branch_false: following ‘false’ branch...
xfsprogs-6.17.0/repair/xfs_repair.c:1269:13: branch_false: ...to here
xfsprogs-6.17.0/repair/xfs_repair.c:1274:17: throw: if ‘libxfs_bcache_purge’ throws an exception...
xfsprogs-6.17.0/repair/xfs_repair.c:1274:17: danger: ‘msgbuf’ leaks here; was allocated at [(9)](sarif:/runs/0/results/16/codeFlows/0/threadFlows/0/locations/8)
# 1272|   		struct rlimit	rlim;
# 1273|   
# 1274|-> 		libxfs_bcache_purge(mp);
# 1275|   		cache_destroy(mp->m_ddev_targp->bcache);
# 1276|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def306]
xfsprogs-6.17.0/repair/xfs_repair.c:1275:17: warning[-Wanalyzer-malloc-leak]: leak of ‘msgbuf’
xfsprogs-6.17.0/repair/xfs_repair.c:1086:1: enter_function: entry to ‘main’
xfsprogs-6.17.0/repair/xfs_repair.c:1109:9: call_function: calling ‘process_args’ from ‘main’
xfsprogs-6.17.0/repair/xfs_repair.c:1109:9: return_function: returning to ‘main’ from ‘process_args’
xfsprogs-6.17.0/repair/xfs_repair.c:1112:18: acquire_memory: allocated here
xfsprogs-6.17.0/repair/xfs_repair.c:1147:12: branch_false: following ‘false’ branch...
xfsprogs-6.17.0/repair/xfs_repair.c:1157:13: branch_false: ...to here
xfsprogs-6.17.0/repair/xfs_repair.c:1168:12: branch_false: following ‘false’ branch...
xfsprogs-6.17.0/repair/xfs_repair.c:1174:9: branch_false: ...to here
xfsprogs-6.17.0/repair/xfs_repair.c:1246:12: branch_false: following ‘false’ branch...
xfsprogs-6.17.0/repair/xfs_repair.c:1269:13: branch_false: ...to here
xfsprogs-6.17.0/repair/xfs_repair.c:1275:17: throw: if ‘cache_destroy’ throws an exception...
xfsprogs-6.17.0/repair/xfs_repair.c:1275:17: danger: ‘msgbuf’ leaks here; was allocated at [(9)](sarif:/runs/0/results/17/codeFlows/0/threadFlows/0/locations/8)
# 1273|   
# 1274|   		libxfs_bcache_purge(mp);
# 1275|-> 		cache_destroy(mp->m_ddev_targp->bcache);
# 1276|   
# 1277|   		mem_used = (mp->m_sb.sb_icount >> (10 - 2)) +

Error: GCC_ANALYZER_WARNING (CWE-401): [#def307]
xfsprogs-6.17.0/repair/xfs_repair.c:1281:47: warning[-Wanalyzer-malloc-leak]: leak of ‘msgbuf’
xfsprogs-6.17.0/repair/xfs_repair.c:1086:1: enter_function: entry to ‘main’
xfsprogs-6.17.0/repair/xfs_repair.c:1109:9: call_function: calling ‘process_args’ from ‘main’
xfsprogs-6.17.0/repair/xfs_repair.c:1109:9: return_function: returning to ‘main’ from ‘process_args’
xfsprogs-6.17.0/repair/xfs_repair.c:1112:18: acquire_memory: allocated here
xfsprogs-6.17.0/repair/xfs_repair.c:1147:12: branch_false: following ‘false’ branch...
xfsprogs-6.17.0/repair/xfs_repair.c:1157:13: branch_false: ...to here
xfsprogs-6.17.0/repair/xfs_repair.c:1168:12: branch_false: following ‘false’ branch...
xfsprogs-6.17.0/repair/xfs_repair.c:1174:9: branch_false: ...to here
xfsprogs-6.17.0/repair/xfs_repair.c:1246:12: branch_false: following ‘false’ branch...
xfsprogs-6.17.0/repair/xfs_repair.c:1269:13: branch_false: ...to here
xfsprogs-6.17.0/repair/xfs_repair.c:1280:27: branch_false: following ‘false’ branch...
xfsprogs-6.17.0/repair/xfs_repair.c:1281:47: branch_false: ...to here
xfsprogs-6.17.0/repair/xfs_repair.c:1281:47: throw: if ‘platform_physmem’ throws an exception...
xfsprogs-6.17.0/repair/xfs_repair.c:1281:47: danger: ‘msgbuf’ leaks here; was allocated at [(9)](sarif:/runs/0/results/18/codeFlows/0/threadFlows/0/locations/8)
# 1279|   					50000;	/* rough estimate of 50MB overhead */
# 1280|   		max_mem = max_mem_specified ? max_mem_specified * 1024 :
# 1281|-> 					      platform_physmem() * 3 / 4;
# 1282|   
# 1283|   		if (getrlimit(RLIMIT_AS, &rlim) != -1 &&

Error: GCC_ANALYZER_WARNING (CWE-775): [#def308]
xfsprogs-6.17.0/rtcp/xfs_rtcp.c:276:17: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘fromfd’
xfsprogs-6.17.0/rtcp/xfs_rtcp.c:101:1: enter_function: entry to ‘rtcp’
xfsprogs-6.17.0/rtcp/xfs_rtcp.c:126:12: branch_false: following ‘false’ branch...
xfsprogs-6.17.0/rtcp/xfs_rtcp.c:135:9: branch_false: ...to here
xfsprogs-6.17.0/rtcp/xfs_rtcp.c:146:27: call_function: calling ‘xfsrtextsize’ from ‘rtcp’
xfsprogs-6.17.0/rtcp/xfs_rtcp.c:146:27: return_function: returning to ‘rtcp’ from ‘xfsrtextsize’
xfsprogs-6.17.0/rtcp/xfs_rtcp.c:146:12: branch_false: following ‘false’ branch...
xfsprogs-6.17.0/rtcp/xfs_rtcp.c:156:9: branch_false: ...to here
xfsprogs-6.17.0/rtcp/xfs_rtcp.c:196:20: branch_false: following ‘false’ branch...
xfsprogs-6.17.0/rtcp/xfs_rtcp.c:202:22: call_function: inlined call to ‘xfsctl’ from ‘rtcp’
xfsprogs-6.17.0/rtcp/xfs_rtcp.c:202:20: branch_false: following ‘false’ branch...
xfsprogs-6.17.0/rtcp/xfs_rtcp.c:213:24: branch_false: ...to here
xfsprogs-6.17.0/rtcp/xfs_rtcp.c:213:20: branch_false: following ‘false’ branch...
xfsprogs-6.17.0/rtcp/xfs_rtcp.c:223:20: branch_false: ...to here
xfsprogs-6.17.0/rtcp/xfs_rtcp.c:236:12: branch_false: following ‘false’ branch...
xfsprogs-6.17.0/rtcp/xfs_rtcp.c:245:9: branch_false: ...to here
xfsprogs-6.17.0/rtcp/xfs_rtcp.c:259:32: acquire_resource: opened here
xfsprogs-6.17.0/rtcp/xfs_rtcp.c:259:20: branch_false: following ‘false’ branch...
xfsprogs-6.17.0/rtcp/xfs_rtcp.c:272:14: call_function: inlined call to ‘xfsctl’ from ‘rtcp’
xfsprogs-6.17.0/rtcp/xfs_rtcp.c:272:12: branch_true: following ‘true’ branch...
xfsprogs-6.17.0/rtcp/xfs_rtcp.c:275:44: branch_true: ...to here
xfsprogs-6.17.0/rtcp/xfs_rtcp.c:276:17: throw: if ‘close’ throws an exception...
xfsprogs-6.17.0/rtcp/xfs_rtcp.c:276:17: danger: ‘fromfd’ leaks here; was opened at [(22)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/21)
#  274|   			_("%s: couldn't get direct I/O information: %s\n"),
#  275|   			progname, strerror(errno));
#  276|-> 		close( fromfd );
#  277|   		close( tofd );
#  278|   		if ( remove )

Error: GCC_ANALYZER_WARNING (CWE-775): [#def309]
xfsprogs-6.17.0/rtcp/xfs_rtcp.c:286:17: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘fromfd’
xfsprogs-6.17.0/rtcp/xfs_rtcp.c:101:1: enter_function: entry to ‘rtcp’
xfsprogs-6.17.0/rtcp/xfs_rtcp.c:126:12: branch_false: following ‘false’ branch...
xfsprogs-6.17.0/rtcp/xfs_rtcp.c:135:9: branch_false: ...to here
xfsprogs-6.17.0/rtcp/xfs_rtcp.c:146:27: call_function: calling ‘xfsrtextsize’ from ‘rtcp’
xfsprogs-6.17.0/rtcp/xfs_rtcp.c:146:27: return_function: returning to ‘rtcp’ from ‘xfsrtextsize’
xfsprogs-6.17.0/rtcp/xfs_rtcp.c:146:12: branch_false: following ‘false’ branch...
xfsprogs-6.17.0/rtcp/xfs_rtcp.c:156:9: branch_false: ...to here
xfsprogs-6.17.0/rtcp/xfs_rtcp.c:196:20: branch_false: following ‘false’ branch...
xfsprogs-6.17.0/rtcp/xfs_rtcp.c:202:22: call_function: inlined call to ‘xfsctl’ from ‘rtcp’
xfsprogs-6.17.0/rtcp/xfs_rtcp.c:202:20: branch_false: following ‘false’ branch...
xfsprogs-6.17.0/rtcp/xfs_rtcp.c:213:24: branch_false: ...to here
xfsprogs-6.17.0/rtcp/xfs_rtcp.c:213:20: branch_false: following ‘false’ branch...
xfsprogs-6.17.0/rtcp/xfs_rtcp.c:223:20: branch_false: ...to here
xfsprogs-6.17.0/rtcp/xfs_rtcp.c:236:12: branch_false: following ‘false’ branch...
xfsprogs-6.17.0/rtcp/xfs_rtcp.c:245:9: branch_false: ...to here
xfsprogs-6.17.0/rtcp/xfs_rtcp.c:259:32: acquire_resource: opened here
xfsprogs-6.17.0/rtcp/xfs_rtcp.c:259:20: branch_false: following ‘false’ branch...
xfsprogs-6.17.0/rtcp/xfs_rtcp.c:272:14: call_function: inlined call to ‘xfsctl’ from ‘rtcp’
xfsprogs-6.17.0/rtcp/xfs_rtcp.c:272:12: branch_false: following ‘false’ branch...
xfsprogs-6.17.0/rtcp/xfs_rtcp.c:283:14: branch_false: ...to here
xfsprogs-6.17.0/rtcp/xfs_rtcp.c:283:12: branch_true: following ‘true’ branch...
xfsprogs-6.17.0/rtcp/xfs_rtcp.c:284:17: branch_true: ...to here
xfsprogs-6.17.0/rtcp/xfs_rtcp.c:286:17: throw: if ‘close’ throws an exception...
xfsprogs-6.17.0/rtcp/xfs_rtcp.c:286:17: danger: ‘fromfd’ leaks here; was opened at [(22)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/21)
#  284|   		fprintf(stderr, _("%s: extent size %d not a multiple of %d.\n"),
#  285|   			progname, rtextsize, dioattr.d_miniosz);
#  286|-> 		close( fromfd );
#  287|   		close( tofd );
#  288|   		if ( remove )

Error: GCC_ANALYZER_WARNING (CWE-775): [#def310]
xfsprogs-6.17.0/rtcp/xfs_rtcp.c:310:25: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘fromfd’
xfsprogs-6.17.0/rtcp/xfs_rtcp.c:101:1: enter_function: entry to ‘rtcp’
xfsprogs-6.17.0/rtcp/xfs_rtcp.c:126:12: branch_false: following ‘false’ branch...
xfsprogs-6.17.0/rtcp/xfs_rtcp.c:135:9: branch_false: ...to here
xfsprogs-6.17.0/rtcp/xfs_rtcp.c:146:27: call_function: calling ‘xfsrtextsize’ from ‘rtcp’
xfsprogs-6.17.0/rtcp/xfs_rtcp.c:146:27: return_function: returning to ‘rtcp’ from ‘xfsrtextsize’
xfsprogs-6.17.0/rtcp/xfs_rtcp.c:146:12: branch_false: following ‘false’ branch...
xfsprogs-6.17.0/rtcp/xfs_rtcp.c:156:9: branch_false: ...to here
xfsprogs-6.17.0/rtcp/xfs_rtcp.c:196:20: branch_false: following ‘false’ branch...
xfsprogs-6.17.0/rtcp/xfs_rtcp.c:202:22: call_function: inlined call to ‘xfsctl’ from ‘rtcp’
xfsprogs-6.17.0/rtcp/xfs_rtcp.c:202:20: branch_false: following ‘false’ branch...
xfsprogs-6.17.0/rtcp/xfs_rtcp.c:213:24: branch_false: ...to here
xfsprogs-6.17.0/rtcp/xfs_rtcp.c:213:20: branch_false: following ‘false’ branch...
xfsprogs-6.17.0/rtcp/xfs_rtcp.c:223:20: branch_false: ...to here
xfsprogs-6.17.0/rtcp/xfs_rtcp.c:236:12: branch_false: following ‘false’ branch...
xfsprogs-6.17.0/rtcp/xfs_rtcp.c:245:9: branch_false: ...to here
xfsprogs-6.17.0/rtcp/xfs_rtcp.c:259:32: acquire_resource: opened here
xfsprogs-6.17.0/rtcp/xfs_rtcp.c:259:20: branch_false: following ‘false’ branch...
xfsprogs-6.17.0/rtcp/xfs_rtcp.c:272:14: call_function: inlined call to ‘xfsctl’ from ‘rtcp’
xfsprogs-6.17.0/rtcp/xfs_rtcp.c:272:12: branch_false: following ‘false’ branch...
xfsprogs-6.17.0/rtcp/xfs_rtcp.c:283:14: branch_false: ...to here
xfsprogs-6.17.0/rtcp/xfs_rtcp.c:283:12: branch_false: following ‘false’ branch...
xfsprogs-6.17.0/rtcp/xfs_rtcp.c:297:14: branch_false: ...to here
xfsprogs-6.17.0/rtcp/xfs_rtcp.c:297:12: branch_true: following ‘true’ branch...
xfsprogs-6.17.0/rtcp/xfs_rtcp.c:298:24: branch_true: ...to here
xfsprogs-6.17.0/rtcp/xfs_rtcp.c:300:20: branch_false: following ‘false’ branch...
xfsprogs-6.17.0/rtcp/xfs_rtcp.c:307:25: branch_false: ...to here
xfsprogs-6.17.0/rtcp/xfs_rtcp.c:310:25: throw: if ‘close’ throws an exception...
xfsprogs-6.17.0/rtcp/xfs_rtcp.c:310:25: danger: ‘fromfd’ leaks here; was opened at [(22)](sarif:/runs/0/results/2/codeFlows/0/threadFlows/0/locations/21)
#  308|   				"size which is a multiple of %d bytes.\n"),
#  309|   				tbuf, dioattr.d_miniosz);
#  310|-> 			close( fromfd );
#  311|   			close( tofd );
#  312|   			if ( remove )

Error: GCC_ANALYZER_WARNING (CWE-688): [#def311]
xfsprogs-6.17.0/rtcp/xfs_rtcp.c:320:9: warning[-Wanalyzer-possible-null-argument]: use of possibly-NULL ‘fbuf’ where non-null expected
xfsprogs-6.17.0/rtcp/xfs_rtcp.c:101:1: enter_function: entry to ‘rtcp’
xfsprogs-6.17.0/rtcp/xfs_rtcp.c:126:12: branch_false: following ‘false’ branch...
xfsprogs-6.17.0/rtcp/xfs_rtcp.c:135:9: branch_false: ...to here
xfsprogs-6.17.0/rtcp/xfs_rtcp.c:146:27: call_function: calling ‘xfsrtextsize’ from ‘rtcp’
xfsprogs-6.17.0/rtcp/xfs_rtcp.c:146:27: return_function: returning to ‘rtcp’ from ‘xfsrtextsize’
xfsprogs-6.17.0/rtcp/xfs_rtcp.c:146:12: branch_false: following ‘false’ branch...
xfsprogs-6.17.0/rtcp/xfs_rtcp.c:156:9: branch_false: ...to here
xfsprogs-6.17.0/rtcp/xfs_rtcp.c:196:20: branch_false: following ‘false’ branch...
xfsprogs-6.17.0/rtcp/xfs_rtcp.c:202:22: call_function: inlined call to ‘xfsctl’ from ‘rtcp’
xfsprogs-6.17.0/rtcp/xfs_rtcp.c:202:20: branch_false: following ‘false’ branch...
xfsprogs-6.17.0/rtcp/xfs_rtcp.c:213:24: branch_false: ...to here
xfsprogs-6.17.0/rtcp/xfs_rtcp.c:213:20: branch_false: following ‘false’ branch...
xfsprogs-6.17.0/rtcp/xfs_rtcp.c:223:20: branch_false: ...to here
xfsprogs-6.17.0/rtcp/xfs_rtcp.c:236:12: branch_false: following ‘false’ branch...
xfsprogs-6.17.0/rtcp/xfs_rtcp.c:245:9: branch_false: ...to here
xfsprogs-6.17.0/rtcp/xfs_rtcp.c:247:12: branch_false: following ‘false’ branch...
xfsprogs-6.17.0/rtcp/xfs_rtcp.c:250:24: branch_false: ...to here
xfsprogs-6.17.0/rtcp/xfs_rtcp.c:250:20: branch_false: following ‘false’ branch...
xfsprogs-6.17.0/rtcp/xfs_rtcp.c:272:14: call_function: inlined call to ‘xfsctl’ from ‘rtcp’
xfsprogs-6.17.0/rtcp/xfs_rtcp.c:272:12: branch_false: following ‘false’ branch...
xfsprogs-6.17.0/rtcp/xfs_rtcp.c:283:14: branch_false: ...to here
xfsprogs-6.17.0/rtcp/xfs_rtcp.c:283:12: branch_false: following ‘false’ branch...
xfsprogs-6.17.0/rtcp/xfs_rtcp.c:297:14: branch_false: ...to here
xfsprogs-6.17.0/rtcp/xfs_rtcp.c:319:16: acquire_memory: this call could return NULL
xfsprogs-6.17.0/rtcp/xfs_rtcp.c:320:9: danger: argument 1 (‘fbuf’) from [(31)](sarif:/runs/0/results/3/codeFlows/0/threadFlows/0/locations/30) could be NULL where non-null expected
#  318|   	iosz =  dioattr.d_miniosz;
#  319|   	fbuf = memalign( dioattr.d_mem, iosz);
#  320|-> 	memset(fbuf, 0, iosz);
#  321|   
#  322|   	/*

Error: GCC_ANALYZER_WARNING (CWE-775): [#def312]
xfsprogs-6.17.0/rtcp/xfs_rtcp.c:346:27: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘fromfd’
xfsprogs-6.17.0/rtcp/xfs_rtcp.c:101:1: enter_function: entry to ‘rtcp’
xfsprogs-6.17.0/rtcp/xfs_rtcp.c:126:12: branch_false: following ‘false’ branch...
xfsprogs-6.17.0/rtcp/xfs_rtcp.c:135:9: branch_false: ...to here
xfsprogs-6.17.0/rtcp/xfs_rtcp.c:146:27: call_function: calling ‘xfsrtextsize’ from ‘rtcp’
xfsprogs-6.17.0/rtcp/xfs_rtcp.c:146:27: return_function: returning to ‘rtcp’ from ‘xfsrtextsize’
xfsprogs-6.17.0/rtcp/xfs_rtcp.c:146:12: branch_false: following ‘false’ branch...
xfsprogs-6.17.0/rtcp/xfs_rtcp.c:156:9: branch_false: ...to here
xfsprogs-6.17.0/rtcp/xfs_rtcp.c:196:20: branch_false: following ‘false’ branch...
xfsprogs-6.17.0/rtcp/xfs_rtcp.c:202:22: call_function: inlined call to ‘xfsctl’ from ‘rtcp’
xfsprogs-6.17.0/rtcp/xfs_rtcp.c:202:20: branch_false: following ‘false’ branch...
xfsprogs-6.17.0/rtcp/xfs_rtcp.c:213:24: branch_false: ...to here
xfsprogs-6.17.0/rtcp/xfs_rtcp.c:213:20: branch_false: following ‘false’ branch...
xfsprogs-6.17.0/rtcp/xfs_rtcp.c:223:20: branch_false: ...to here
xfsprogs-6.17.0/rtcp/xfs_rtcp.c:236:12: branch_false: following ‘false’ branch...
xfsprogs-6.17.0/rtcp/xfs_rtcp.c:245:9: branch_false: ...to here
xfsprogs-6.17.0/rtcp/xfs_rtcp.c:259:32: acquire_resource: opened here
xfsprogs-6.17.0/rtcp/xfs_rtcp.c:259:20: branch_false: following ‘false’ branch...
xfsprogs-6.17.0/rtcp/xfs_rtcp.c:272:14: call_function: inlined call to ‘xfsctl’ from ‘rtcp’
xfsprogs-6.17.0/rtcp/xfs_rtcp.c:272:12: branch_false: following ‘false’ branch...
xfsprogs-6.17.0/rtcp/xfs_rtcp.c:283:14: branch_false: ...to here
xfsprogs-6.17.0/rtcp/xfs_rtcp.c:283:12: branch_false: following ‘false’ branch...
xfsprogs-6.17.0/rtcp/xfs_rtcp.c:297:14: branch_false: ...to here
xfsprogs-6.17.0/rtcp/xfs_rtcp.c:325:17: branch_true: following ‘true’ branch (when ‘readct != 0’)...
xfsprogs-6.17.0/rtcp/xfs_rtcp.c:329:20: branch_true: ...to here
xfsprogs-6.17.0/rtcp/xfs_rtcp.c:329:20: branch_false: following ‘false’ branch (when ‘readct >= 0’)...
xfsprogs-6.17.0/rtcp/xfs_rtcp.c:336:20: branch_false: ...to here
xfsprogs-6.17.0/rtcp/xfs_rtcp.c:346:27: throw: if ‘write’ throws an exception...
xfsprogs-6.17.0/rtcp/xfs_rtcp.c:346:27: danger: ‘fromfd’ leaks here; was opened at [(22)](sarif:/runs/0/results/5/codeFlows/0/threadFlows/0/locations/21)
#  344|   		 * write to target file
#  345|   		 */
#  346|-> 		writect = write( tofd, fbuf, readct);
#  347|   
#  348|   		if ( writect != readct ) {

Error: GCC_ANALYZER_WARNING (CWE-401): [#def313]
xfsprogs-6.17.0/rtcp/xfs_rtcp.c:346:27: warning[-Wanalyzer-malloc-leak]: leak of ‘fbuf’
xfsprogs-6.17.0/rtcp/xfs_rtcp.c:101:1: enter_function: entry to ‘rtcp’
xfsprogs-6.17.0/rtcp/xfs_rtcp.c:126:12: branch_false: following ‘false’ branch...
xfsprogs-6.17.0/rtcp/xfs_rtcp.c:135:9: branch_false: ...to here
xfsprogs-6.17.0/rtcp/xfs_rtcp.c:146:27: call_function: calling ‘xfsrtextsize’ from ‘rtcp’
xfsprogs-6.17.0/rtcp/xfs_rtcp.c:146:27: return_function: returning to ‘rtcp’ from ‘xfsrtextsize’
xfsprogs-6.17.0/rtcp/xfs_rtcp.c:146:12: branch_false: following ‘false’ branch...
xfsprogs-6.17.0/rtcp/xfs_rtcp.c:156:9: branch_false: ...to here
xfsprogs-6.17.0/rtcp/xfs_rtcp.c:196:20: branch_false: following ‘false’ branch...
xfsprogs-6.17.0/rtcp/xfs_rtcp.c:202:22: call_function: inlined call to ‘xfsctl’ from ‘rtcp’
xfsprogs-6.17.0/rtcp/xfs_rtcp.c:202:20: branch_false: following ‘false’ branch...
xfsprogs-6.17.0/rtcp/xfs_rtcp.c:213:24: branch_false: ...to here
xfsprogs-6.17.0/rtcp/xfs_rtcp.c:213:20: branch_false: following ‘false’ branch...
xfsprogs-6.17.0/rtcp/xfs_rtcp.c:223:20: branch_false: ...to here
xfsprogs-6.17.0/rtcp/xfs_rtcp.c:236:12: branch_false: following ‘false’ branch...
xfsprogs-6.17.0/rtcp/xfs_rtcp.c:245:9: branch_false: ...to here
xfsprogs-6.17.0/rtcp/xfs_rtcp.c:247:12: branch_false: following ‘false’ branch...
xfsprogs-6.17.0/rtcp/xfs_rtcp.c:250:24: branch_false: ...to here
xfsprogs-6.17.0/rtcp/xfs_rtcp.c:250:20: branch_false: following ‘false’ branch...
xfsprogs-6.17.0/rtcp/xfs_rtcp.c:272:14: call_function: inlined call to ‘xfsctl’ from ‘rtcp’
xfsprogs-6.17.0/rtcp/xfs_rtcp.c:272:12: branch_false: following ‘false’ branch...
xfsprogs-6.17.0/rtcp/xfs_rtcp.c:283:14: branch_false: ...to here
xfsprogs-6.17.0/rtcp/xfs_rtcp.c:283:12: branch_false: following ‘false’ branch...
xfsprogs-6.17.0/rtcp/xfs_rtcp.c:297:14: branch_false: ...to here
xfsprogs-6.17.0/rtcp/xfs_rtcp.c:319:16: acquire_memory: allocated here
xfsprogs-6.17.0/rtcp/xfs_rtcp.c:325:17: branch_true: following ‘true’ branch (when ‘readct != 0’)...
xfsprogs-6.17.0/rtcp/xfs_rtcp.c:329:20: branch_true: ...to here
xfsprogs-6.17.0/rtcp/xfs_rtcp.c:329:20: branch_false: following ‘false’ branch (when ‘readct >= 0’)...
xfsprogs-6.17.0/rtcp/xfs_rtcp.c:336:20: branch_false: ...to here
xfsprogs-6.17.0/rtcp/xfs_rtcp.c:346:27: throw: if ‘write’ throws an exception...
xfsprogs-6.17.0/rtcp/xfs_rtcp.c:346:27: danger: ‘fbuf’ leaks here; was allocated at [(31)](sarif:/runs/0/results/4/codeFlows/0/threadFlows/0/locations/30)
#  344|   		 * write to target file
#  345|   		 */
#  346|-> 		writect = write( tofd, fbuf, readct);
#  347|   
#  348|   		if ( writect != readct ) {

Error: GCC_ANALYZER_WARNING (CWE-775): [#def314]
xfsprogs-6.17.0/rtcp/xfs_rtcp.c:351:25: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘fromfd’
xfsprogs-6.17.0/rtcp/xfs_rtcp.c:101:1: enter_function: entry to ‘rtcp’
xfsprogs-6.17.0/rtcp/xfs_rtcp.c:126:12: branch_false: following ‘false’ branch...
xfsprogs-6.17.0/rtcp/xfs_rtcp.c:135:9: branch_false: ...to here
xfsprogs-6.17.0/rtcp/xfs_rtcp.c:146:27: call_function: calling ‘xfsrtextsize’ from ‘rtcp’
xfsprogs-6.17.0/rtcp/xfs_rtcp.c:146:27: return_function: returning to ‘rtcp’ from ‘xfsrtextsize’
xfsprogs-6.17.0/rtcp/xfs_rtcp.c:146:12: branch_false: following ‘false’ branch...
xfsprogs-6.17.0/rtcp/xfs_rtcp.c:156:9: branch_false: ...to here
xfsprogs-6.17.0/rtcp/xfs_rtcp.c:196:20: branch_false: following ‘false’ branch...
xfsprogs-6.17.0/rtcp/xfs_rtcp.c:202:22: call_function: inlined call to ‘xfsctl’ from ‘rtcp’
xfsprogs-6.17.0/rtcp/xfs_rtcp.c:202:20: branch_false: following ‘false’ branch...
xfsprogs-6.17.0/rtcp/xfs_rtcp.c:213:24: branch_false: ...to here
xfsprogs-6.17.0/rtcp/xfs_rtcp.c:213:20: branch_false: following ‘false’ branch...
xfsprogs-6.17.0/rtcp/xfs_rtcp.c:223:20: branch_false: ...to here
xfsprogs-6.17.0/rtcp/xfs_rtcp.c:236:12: branch_false: following ‘false’ branch...
xfsprogs-6.17.0/rtcp/xfs_rtcp.c:245:9: branch_false: ...to here
xfsprogs-6.17.0/rtcp/xfs_rtcp.c:259:32: acquire_resource: opened here
xfsprogs-6.17.0/rtcp/xfs_rtcp.c:259:20: branch_false: following ‘false’ branch...
xfsprogs-6.17.0/rtcp/xfs_rtcp.c:272:14: call_function: inlined call to ‘xfsctl’ from ‘rtcp’
xfsprogs-6.17.0/rtcp/xfs_rtcp.c:272:12: branch_false: following ‘false’ branch...
xfsprogs-6.17.0/rtcp/xfs_rtcp.c:283:14: branch_false: ...to here
xfsprogs-6.17.0/rtcp/xfs_rtcp.c:283:12: branch_false: following ‘false’ branch...
xfsprogs-6.17.0/rtcp/xfs_rtcp.c:297:14: branch_false: ...to here
xfsprogs-6.17.0/rtcp/xfs_rtcp.c:325:17: branch_true: following ‘true’ branch (when ‘readct != 0’)...
xfsprogs-6.17.0/rtcp/xfs_rtcp.c:329:20: branch_true: ...to here
xfsprogs-6.17.0/rtcp/xfs_rtcp.c:329:20: branch_false: following ‘false’ branch (when ‘readct >= 0’)...
xfsprogs-6.17.0/rtcp/xfs_rtcp.c:336:20: branch_false: ...to here
xfsprogs-6.17.0/rtcp/xfs_rtcp.c:351:25: throw: if ‘close’ throws an exception...
xfsprogs-6.17.0/rtcp/xfs_rtcp.c:351:25: danger: ‘fromfd’ leaks here; was opened at [(22)](sarif:/runs/0/results/7/codeFlows/0/threadFlows/0/locations/21)
#  349|   			fprintf(stderr, _("%s: write error: %s\n"),
#  350|   				progname, strerror(errno));
#  351|-> 			close(fromfd);
#  352|   			close(tofd);
#  353|   			free( fbuf );

Error: GCC_ANALYZER_WARNING (CWE-401): [#def315]
xfsprogs-6.17.0/rtcp/xfs_rtcp.c:351:25: warning[-Wanalyzer-malloc-leak]: leak of ‘fbuf’
xfsprogs-6.17.0/rtcp/xfs_rtcp.c:101:1: enter_function: entry to ‘rtcp’
xfsprogs-6.17.0/rtcp/xfs_rtcp.c:126:12: branch_false: following ‘false’ branch...
xfsprogs-6.17.0/rtcp/xfs_rtcp.c:135:9: branch_false: ...to here
xfsprogs-6.17.0/rtcp/xfs_rtcp.c:146:27: call_function: calling ‘xfsrtextsize’ from ‘rtcp’
xfsprogs-6.17.0/rtcp/xfs_rtcp.c:146:27: return_function: returning to ‘rtcp’ from ‘xfsrtextsize’
xfsprogs-6.17.0/rtcp/xfs_rtcp.c:146:12: branch_false: following ‘false’ branch...
xfsprogs-6.17.0/rtcp/xfs_rtcp.c:156:9: branch_false: ...to here
xfsprogs-6.17.0/rtcp/xfs_rtcp.c:196:20: branch_false: following ‘false’ branch...
xfsprogs-6.17.0/rtcp/xfs_rtcp.c:202:22: call_function: inlined call to ‘xfsctl’ from ‘rtcp’
xfsprogs-6.17.0/rtcp/xfs_rtcp.c:202:20: branch_false: following ‘false’ branch...
xfsprogs-6.17.0/rtcp/xfs_rtcp.c:213:24: branch_false: ...to here
xfsprogs-6.17.0/rtcp/xfs_rtcp.c:213:20: branch_false: following ‘false’ branch...
xfsprogs-6.17.0/rtcp/xfs_rtcp.c:223:20: branch_false: ...to here
xfsprogs-6.17.0/rtcp/xfs_rtcp.c:236:12: branch_false: following ‘false’ branch...
xfsprogs-6.17.0/rtcp/xfs_rtcp.c:245:9: branch_false: ...to here
xfsprogs-6.17.0/rtcp/xfs_rtcp.c:247:12: branch_false: following ‘false’ branch...
xfsprogs-6.17.0/rtcp/xfs_rtcp.c:250:24: branch_false: ...to here
xfsprogs-6.17.0/rtcp/xfs_rtcp.c:250:20: branch_false: following ‘false’ branch...
xfsprogs-6.17.0/rtcp/xfs_rtcp.c:272:14: call_function: inlined call to ‘xfsctl’ from ‘rtcp’
xfsprogs-6.17.0/rtcp/xfs_rtcp.c:272:12: branch_false: following ‘false’ branch...
xfsprogs-6.17.0/rtcp/xfs_rtcp.c:283:14: branch_false: ...to here
xfsprogs-6.17.0/rtcp/xfs_rtcp.c:283:12: branch_false: following ‘false’ branch...
xfsprogs-6.17.0/rtcp/xfs_rtcp.c:297:14: branch_false: ...to here
xfsprogs-6.17.0/rtcp/xfs_rtcp.c:319:16: acquire_memory: allocated here
xfsprogs-6.17.0/rtcp/xfs_rtcp.c:325:17: branch_true: following ‘true’ branch (when ‘readct != 0’)...
xfsprogs-6.17.0/rtcp/xfs_rtcp.c:329:20: branch_true: ...to here
xfsprogs-6.17.0/rtcp/xfs_rtcp.c:329:20: branch_false: following ‘false’ branch (when ‘readct >= 0’)...
xfsprogs-6.17.0/rtcp/xfs_rtcp.c:336:20: branch_false: ...to here
xfsprogs-6.17.0/rtcp/xfs_rtcp.c:351:25: throw: if ‘close’ throws an exception...
xfsprogs-6.17.0/rtcp/xfs_rtcp.c:351:25: danger: ‘fbuf’ leaks here; was allocated at [(31)](sarif:/runs/0/results/6/codeFlows/0/threadFlows/0/locations/30)
#  349|   			fprintf(stderr, _("%s: write error: %s\n"),
#  350|   				progname, strerror(errno));
#  351|-> 			close(fromfd);
#  352|   			close(tofd);
#  353|   			free( fbuf );

Error: GCC_ANALYZER_WARNING (CWE-401): [#def316]
xfsprogs-6.17.0/rtcp/xfs_rtcp.c:352:25: warning[-Wanalyzer-malloc-leak]: leak of ‘fbuf’
xfsprogs-6.17.0/rtcp/xfs_rtcp.c:101:1: enter_function: entry to ‘rtcp’
xfsprogs-6.17.0/rtcp/xfs_rtcp.c:126:12: branch_false: following ‘false’ branch...
xfsprogs-6.17.0/rtcp/xfs_rtcp.c:135:9: branch_false: ...to here
xfsprogs-6.17.0/rtcp/xfs_rtcp.c:146:27: call_function: calling ‘xfsrtextsize’ from ‘rtcp’
xfsprogs-6.17.0/rtcp/xfs_rtcp.c:146:27: return_function: returning to ‘rtcp’ from ‘xfsrtextsize’
xfsprogs-6.17.0/rtcp/xfs_rtcp.c:146:12: branch_false: following ‘false’ branch...
xfsprogs-6.17.0/rtcp/xfs_rtcp.c:156:9: branch_false: ...to here
xfsprogs-6.17.0/rtcp/xfs_rtcp.c:196:20: branch_false: following ‘false’ branch...
xfsprogs-6.17.0/rtcp/xfs_rtcp.c:202:22: call_function: inlined call to ‘xfsctl’ from ‘rtcp’
xfsprogs-6.17.0/rtcp/xfs_rtcp.c:202:20: branch_false: following ‘false’ branch...
xfsprogs-6.17.0/rtcp/xfs_rtcp.c:213:24: branch_false: ...to here
xfsprogs-6.17.0/rtcp/xfs_rtcp.c:213:20: branch_false: following ‘false’ branch...
xfsprogs-6.17.0/rtcp/xfs_rtcp.c:223:20: branch_false: ...to here
xfsprogs-6.17.0/rtcp/xfs_rtcp.c:236:12: branch_false: following ‘false’ branch...
xfsprogs-6.17.0/rtcp/xfs_rtcp.c:245:9: branch_false: ...to here
xfsprogs-6.17.0/rtcp/xfs_rtcp.c:272:12: branch_false: following ‘false’ branch...
xfsprogs-6.17.0/rtcp/xfs_rtcp.c:283:14: branch_false: ...to here
xfsprogs-6.17.0/rtcp/xfs_rtcp.c:283:12: branch_false: following ‘false’ branch...
xfsprogs-6.17.0/rtcp/xfs_rtcp.c:297:14: branch_false: ...to here
xfsprogs-6.17.0/rtcp/xfs_rtcp.c:319:16: acquire_memory: allocated here
xfsprogs-6.17.0/rtcp/xfs_rtcp.c:325:17: branch_true: following ‘true’ branch (when ‘readct != 0’)...
xfsprogs-6.17.0/rtcp/xfs_rtcp.c:329:20: branch_true: ...to here
xfsprogs-6.17.0/rtcp/xfs_rtcp.c:329:20: branch_false: following ‘false’ branch (when ‘readct >= 0’)...
xfsprogs-6.17.0/rtcp/xfs_rtcp.c:336:20: branch_false: ...to here
xfsprogs-6.17.0/rtcp/xfs_rtcp.c:352:25: throw: if ‘close’ throws an exception...
xfsprogs-6.17.0/rtcp/xfs_rtcp.c:352:25: danger: ‘fbuf’ leaks here; was allocated at [(26)](sarif:/runs/0/results/8/codeFlows/0/threadFlows/0/locations/25)
#  350|   				progname, strerror(errno));
#  351|   			close(fromfd);
#  352|-> 			close(tofd);
#  353|   			free( fbuf );
#  354|   			return( -1 );

Error: GCC_ANALYZER_WARNING (CWE-775): [#def317]
xfsprogs-6.17.0/rtcp/xfs_rtcp.c:360:9: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘fromfd’
xfsprogs-6.17.0/rtcp/xfs_rtcp.c:101:1: enter_function: entry to ‘rtcp’
xfsprogs-6.17.0/rtcp/xfs_rtcp.c:126:12: branch_false: following ‘false’ branch...
xfsprogs-6.17.0/rtcp/xfs_rtcp.c:135:9: branch_false: ...to here
xfsprogs-6.17.0/rtcp/xfs_rtcp.c:146:27: call_function: calling ‘xfsrtextsize’ from ‘rtcp’
xfsprogs-6.17.0/rtcp/xfs_rtcp.c:146:27: return_function: returning to ‘rtcp’ from ‘xfsrtextsize’
xfsprogs-6.17.0/rtcp/xfs_rtcp.c:146:12: branch_false: following ‘false’ branch...
xfsprogs-6.17.0/rtcp/xfs_rtcp.c:156:9: branch_false: ...to here
xfsprogs-6.17.0/rtcp/xfs_rtcp.c:196:20: branch_false: following ‘false’ branch...
xfsprogs-6.17.0/rtcp/xfs_rtcp.c:202:22: call_function: inlined call to ‘xfsctl’ from ‘rtcp’
xfsprogs-6.17.0/rtcp/xfs_rtcp.c:202:20: branch_false: following ‘false’ branch...
xfsprogs-6.17.0/rtcp/xfs_rtcp.c:213:24: branch_false: ...to here
xfsprogs-6.17.0/rtcp/xfs_rtcp.c:213:20: branch_false: following ‘false’ branch...
xfsprogs-6.17.0/rtcp/xfs_rtcp.c:223:20: branch_false: ...to here
xfsprogs-6.17.0/rtcp/xfs_rtcp.c:236:12: branch_false: following ‘false’ branch...
xfsprogs-6.17.0/rtcp/xfs_rtcp.c:245:9: branch_false: ...to here
xfsprogs-6.17.0/rtcp/xfs_rtcp.c:259:32: acquire_resource: opened here
xfsprogs-6.17.0/rtcp/xfs_rtcp.c:259:20: branch_false: following ‘false’ branch...
xfsprogs-6.17.0/rtcp/xfs_rtcp.c:272:14: call_function: inlined call to ‘xfsctl’ from ‘rtcp’
xfsprogs-6.17.0/rtcp/xfs_rtcp.c:272:12: branch_false: following ‘false’ branch...
xfsprogs-6.17.0/rtcp/xfs_rtcp.c:283:14: branch_false: ...to here
xfsprogs-6.17.0/rtcp/xfs_rtcp.c:283:12: branch_false: following ‘false’ branch...
xfsprogs-6.17.0/rtcp/xfs_rtcp.c:297:14: branch_false: ...to here
xfsprogs-6.17.0/rtcp/xfs_rtcp.c:360:9: throw: if ‘close’ throws an exception...
xfsprogs-6.17.0/rtcp/xfs_rtcp.c:360:9: danger: ‘fromfd’ leaks here; was opened at [(22)](sarif:/runs/0/results/10/codeFlows/0/threadFlows/0/locations/21)
#  358|   	}
#  359|   
#  360|-> 	close(fromfd);
#  361|   	close(tofd);
#  362|   	free( fbuf );

Error: GCC_ANALYZER_WARNING (CWE-401): [#def318]
xfsprogs-6.17.0/rtcp/xfs_rtcp.c:360:9: warning[-Wanalyzer-malloc-leak]: leak of ‘fbuf’
xfsprogs-6.17.0/rtcp/xfs_rtcp.c:101:1: enter_function: entry to ‘rtcp’
xfsprogs-6.17.0/rtcp/xfs_rtcp.c:126:12: branch_false: following ‘false’ branch...
xfsprogs-6.17.0/rtcp/xfs_rtcp.c:135:9: branch_false: ...to here
xfsprogs-6.17.0/rtcp/xfs_rtcp.c:146:27: call_function: calling ‘xfsrtextsize’ from ‘rtcp’
xfsprogs-6.17.0/rtcp/xfs_rtcp.c:146:27: return_function: returning to ‘rtcp’ from ‘xfsrtextsize’
xfsprogs-6.17.0/rtcp/xfs_rtcp.c:146:12: branch_false: following ‘false’ branch...
xfsprogs-6.17.0/rtcp/xfs_rtcp.c:156:9: branch_false: ...to here
xfsprogs-6.17.0/rtcp/xfs_rtcp.c:196:20: branch_false: following ‘false’ branch...
xfsprogs-6.17.0/rtcp/xfs_rtcp.c:202:22: call_function: inlined call to ‘xfsctl’ from ‘rtcp’
xfsprogs-6.17.0/rtcp/xfs_rtcp.c:202:20: branch_false: following ‘false’ branch...
xfsprogs-6.17.0/rtcp/xfs_rtcp.c:213:24: branch_false: ...to here
xfsprogs-6.17.0/rtcp/xfs_rtcp.c:213:20: branch_false: following ‘false’ branch...
xfsprogs-6.17.0/rtcp/xfs_rtcp.c:223:20: branch_false: ...to here
xfsprogs-6.17.0/rtcp/xfs_rtcp.c:236:12: branch_false: following ‘false’ branch...
xfsprogs-6.17.0/rtcp/xfs_rtcp.c:245:9: branch_false: ...to here
xfsprogs-6.17.0/rtcp/xfs_rtcp.c:247:12: branch_false: following ‘false’ branch...
xfsprogs-6.17.0/rtcp/xfs_rtcp.c:250:24: branch_false: ...to here
xfsprogs-6.17.0/rtcp/xfs_rtcp.c:250:20: branch_false: following ‘false’ branch...
xfsprogs-6.17.0/rtcp/xfs_rtcp.c:272:14: call_function: inlined call to ‘xfsctl’ from ‘rtcp’
xfsprogs-6.17.0/rtcp/xfs_rtcp.c:272:12: branch_false: following ‘false’ branch...
xfsprogs-6.17.0/rtcp/xfs_rtcp.c:283:14: branch_false: ...to here
xfsprogs-6.17.0/rtcp/xfs_rtcp.c:283:12: branch_false: following ‘false’ branch...
xfsprogs-6.17.0/rtcp/xfs_rtcp.c:297:14: branch_false: ...to here
xfsprogs-6.17.0/rtcp/xfs_rtcp.c:319:16: acquire_memory: allocated here
xfsprogs-6.17.0/rtcp/xfs_rtcp.c:360:9: throw: if ‘close’ throws an exception...
xfsprogs-6.17.0/rtcp/xfs_rtcp.c:360:9: danger: ‘fbuf’ leaks here; was allocated at [(31)](sarif:/runs/0/results/9/codeFlows/0/threadFlows/0/locations/30)
#  358|   	}
#  359|   
#  360|-> 	close(fromfd);
#  361|   	close(tofd);
#  362|   	free( fbuf );

Error: GCC_ANALYZER_WARNING (CWE-401): [#def319]
xfsprogs-6.17.0/rtcp/xfs_rtcp.c:361:9: warning[-Wanalyzer-malloc-leak]: leak of ‘fbuf’
xfsprogs-6.17.0/rtcp/xfs_rtcp.c:101:1: enter_function: entry to ‘rtcp’
xfsprogs-6.17.0/rtcp/xfs_rtcp.c:126:12: branch_false: following ‘false’ branch...
xfsprogs-6.17.0/rtcp/xfs_rtcp.c:135:9: branch_false: ...to here
xfsprogs-6.17.0/rtcp/xfs_rtcp.c:146:27: call_function: calling ‘xfsrtextsize’ from ‘rtcp’
xfsprogs-6.17.0/rtcp/xfs_rtcp.c:146:27: return_function: returning to ‘rtcp’ from ‘xfsrtextsize’
xfsprogs-6.17.0/rtcp/xfs_rtcp.c:146:12: branch_false: following ‘false’ branch...
xfsprogs-6.17.0/rtcp/xfs_rtcp.c:156:9: branch_false: ...to here
xfsprogs-6.17.0/rtcp/xfs_rtcp.c:196:20: branch_false: following ‘false’ branch...
xfsprogs-6.17.0/rtcp/xfs_rtcp.c:202:22: call_function: inlined call to ‘xfsctl’ from ‘rtcp’
xfsprogs-6.17.0/rtcp/xfs_rtcp.c:202:20: branch_false: following ‘false’ branch...
xfsprogs-6.17.0/rtcp/xfs_rtcp.c:213:24: branch_false: ...to here
xfsprogs-6.17.0/rtcp/xfs_rtcp.c:213:20: branch_false: following ‘false’ branch...
xfsprogs-6.17.0/rtcp/xfs_rtcp.c:223:20: branch_false: ...to here
xfsprogs-6.17.0/rtcp/xfs_rtcp.c:236:12: branch_false: following ‘false’ branch...
xfsprogs-6.17.0/rtcp/xfs_rtcp.c:245:9: branch_false: ...to here
xfsprogs-6.17.0/rtcp/xfs_rtcp.c:272:12: branch_false: following ‘false’ branch...
xfsprogs-6.17.0/rtcp/xfs_rtcp.c:283:14: branch_false: ...to here
xfsprogs-6.17.0/rtcp/xfs_rtcp.c:283:12: branch_false: following ‘false’ branch...
xfsprogs-6.17.0/rtcp/xfs_rtcp.c:297:14: branch_false: ...to here
xfsprogs-6.17.0/rtcp/xfs_rtcp.c:319:16: acquire_memory: allocated here
xfsprogs-6.17.0/rtcp/xfs_rtcp.c:361:9: throw: if ‘close’ throws an exception...
xfsprogs-6.17.0/rtcp/xfs_rtcp.c:361:9: danger: ‘fbuf’ leaks here; was allocated at [(26)](sarif:/runs/0/results/11/codeFlows/0/threadFlows/0/locations/25)
#  359|   
#  360|   	close(fromfd);
#  361|-> 	close(tofd);
#  362|   	free( fbuf );
#  363|   	return( 0 );

Error: GCC_ANALYZER_WARNING (CWE-775): [#def320]
xfsprogs-6.17.0/rtcp/xfs_rtcp.c:381:17: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘open(path, 0)’
xfsprogs-6.17.0/rtcp/xfs_rtcp.c:375:14: acquire_resource: opened here
xfsprogs-6.17.0/rtcp/xfs_rtcp.c:376:12: branch_false: following ‘false’ branch...
xfsprogs-6.17.0/rtcp/xfs_rtcp.c:381:17: branch_false: ...to here
xfsprogs-6.17.0/rtcp/xfs_rtcp.c:381:17: throw: if ‘xfrog_geometry’ throws an exception...
xfsprogs-6.17.0/rtcp/xfs_rtcp.c:381:17: danger: ‘open(path, 0)’ leaks here; was opened at [(1)](sarif:/runs/0/results/12/codeFlows/0/threadFlows/0/locations/0)
#  379|   		return -1;
#  380|   	}
#  381|-> 	rval = -xfrog_geometry(fd, &geo);
#  382|   	close(fd);
#  383|   	if (rval)

Error: GCC_ANALYZER_WARNING (CWE-401): [#def321]
xfsprogs-6.17.0/scrub/counter.c:41:16: warning[-Wanalyzer-malloc-leak]: leak of ‘p’
xfsprogs-6.17.0/scrub/counter.c:38:13: acquire_memory: allocated here
xfsprogs-6.17.0/scrub/counter.c:39:12: branch_false: following ‘false’ branch (when ‘p’ is non-NULL)...
xfsprogs-6.17.0/scrub/counter.c:41:16: branch_false: ...to here
xfsprogs-6.17.0/scrub/counter.c:41:16: throw: if ‘ptvar_alloc’ throws an exception...
xfsprogs-6.17.0/scrub/counter.c:41:16: danger: ‘p’ leaks here; was allocated at [(1)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/0)
#   39|   	if (!p)
#   40|   		return errno;
#   41|-> 	ret = -ptvar_alloc(nr, sizeof(uint64_t), NULL, &p->var);
#   42|   	if (ret) {
#   43|   		free(p);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def322]
xfsprogs-6.17.0/scrub/disk.c:194:22: warning[-Wanalyzer-malloc-leak]: leak of ‘disk’
xfsprogs-6.17.0/scrub/disk.c:190:16: acquire_memory: allocated here
xfsprogs-6.17.0/scrub/disk.c:191:12: branch_false: following ‘false’ branch (when ‘disk’ is non-NULL)...
xfsprogs-6.17.0/scrub/disk.c:194:22: branch_false: ...to here
xfsprogs-6.17.0/scrub/disk.c:194:22: throw: if ‘open’ throws an exception...
xfsprogs-6.17.0/scrub/disk.c:194:22: danger: ‘disk’ leaks here; was allocated at [(1)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/0)
#  192|   		return NULL;
#  193|   
#  194|-> 	disk->d_fd = open(pathname, O_RDONLY | O_DIRECT | O_NOATIME);
#  195|   	if (disk->d_fd < 0)
#  196|   		goto out_free;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def323]
xfsprogs-6.17.0/scrub/fscounters.c:88:16: warning[-Wanalyzer-malloc-leak]: leak of ‘ci’
xfsprogs-6.17.0/scrub/fscounters.c:83:14: acquire_memory: allocated here
xfsprogs-6.17.0/scrub/fscounters.c:85:12: branch_false: following ‘false’ branch (when ‘ci’ is non-NULL)...
xfsprogs-6.17.0/scrub/fscounters.c:88:16: branch_false: ...to here
xfsprogs-6.17.0/scrub/fscounters.c:88:16: throw: if ‘scrub_nproc_workqueue’ throws an exception...
xfsprogs-6.17.0/scrub/fscounters.c:88:16: danger: ‘ci’ leaks here; was allocated at [(1)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/0)
#   86|   		return errno;
#   87|   
#   88|-> 	ret = -workqueue_create(&wq, (struct xfs_mount *)ctx,
#   89|   			scrub_nproc_workqueue(ctx));
#   90|   	if (ret)

Error: GCC_ANALYZER_WARNING (CWE-401): [#def324]
xfsprogs-6.17.0/scrub/fscounters.c:94:24: warning[-Wanalyzer-malloc-leak]: leak of ‘ci’
xfsprogs-6.17.0/scrub/fscounters.c:83:14: acquire_memory: allocated here
xfsprogs-6.17.0/scrub/fscounters.c:85:12: branch_false: following ‘false’ branch (when ‘ci’ is non-NULL)...
xfsprogs-6.17.0/scrub/fscounters.c:88:16: branch_false: ...to here
xfsprogs-6.17.0/scrub/fscounters.c:90:12: branch_false: following ‘false’ branch...
xfsprogs-6.17.0/scrub/fscounters.c:90:12: branch_false: ...to here
xfsprogs-6.17.0/scrub/fscounters.c:93:24: branch_true: following ‘true’ branch...
xfsprogs-6.17.0/scrub/fscounters.c:94:24: throw: if ‘workqueue_add’ throws an exception...
xfsprogs-6.17.0/scrub/fscounters.c:94:24: danger: ‘ci’ leaks here; was allocated at [(1)](sarif:/runs/0/results/2/codeFlows/0/threadFlows/0/locations/0)
#   92|   
#   93|   	for (agno = 0; agno < ctx->mnt.fsgeom.agcount && !ci->error; agno++) {
#   94|-> 		ret = -workqueue_add(&wq, count_ag_inodes, agno, ci);
#   95|   		if (ret)
#   96|   			break;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def325]
xfsprogs-6.17.0/scrub/fscounters.c:99:17: warning[-Wanalyzer-malloc-leak]: leak of ‘ci’
xfsprogs-6.17.0/scrub/fscounters.c:83:14: acquire_memory: allocated here
xfsprogs-6.17.0/scrub/fscounters.c:85:12: branch_false: following ‘false’ branch (when ‘ci’ is non-NULL)...
xfsprogs-6.17.0/scrub/fscounters.c:88:16: branch_false: ...to here
xfsprogs-6.17.0/scrub/fscounters.c:90:12: branch_false: following ‘false’ branch...
xfsprogs-6.17.0/scrub/fscounters.c:90:12: branch_false: ...to here
xfsprogs-6.17.0/scrub/fscounters.c:99:17: throw: if ‘workqueue_terminate’ throws an exception...
xfsprogs-6.17.0/scrub/fscounters.c:99:17: danger: ‘ci’ leaks here; was allocated at [(1)](sarif:/runs/0/results/3/codeFlows/0/threadFlows/0/locations/0)
#   97|   	}
#   98|   
#   99|-> 	ret2 = -workqueue_terminate(&wq);
#  100|   	if (!ret && ret2)
#  101|   		ret = ret2;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def326]
xfsprogs-6.17.0/scrub/fscounters.c:102:9: warning[-Wanalyzer-malloc-leak]: leak of ‘ci’
xfsprogs-6.17.0/scrub/fscounters.c:83:14: acquire_memory: allocated here
xfsprogs-6.17.0/scrub/fscounters.c:85:12: branch_false: following ‘false’ branch (when ‘ci’ is non-NULL)...
xfsprogs-6.17.0/scrub/fscounters.c:88:16: branch_false: ...to here
xfsprogs-6.17.0/scrub/fscounters.c:90:12: branch_false: following ‘false’ branch...
xfsprogs-6.17.0/scrub/fscounters.c:90:12: branch_false: ...to here
xfsprogs-6.17.0/scrub/fscounters.c:102:9: throw: if ‘workqueue_destroy’ throws an exception...
xfsprogs-6.17.0/scrub/fscounters.c:102:9: danger: ‘ci’ leaks here; was allocated at [(1)](sarif:/runs/0/results/4/codeFlows/0/threadFlows/0/locations/0)
#  100|   	if (!ret && ret2)
#  101|   		ret = ret2;
#  102|-> 	workqueue_destroy(&wq);
#  103|   
#  104|   	if (ci->error) {

Error: GCC_ANALYZER_WARNING (CWE-476): [#def327]
xfsprogs-6.17.0/scrub/inodes.c:473:34: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘arg’
xfsprogs-6.17.0/scrub/inodes.c:557:1: enter_function: entry to ‘scan_ag_inumbers’
xfsprogs-6.17.0/scrub/inodes.c:562:34: release_memory: ‘ichunk’ is NULL
xfsprogs-6.17.0/scrub/inodes.c:572:17: call_function: calling ‘alloc_ichunk’ from ‘scan_ag_inumbers’
xfsprogs-6.17.0/scrub/inodes.c:572:17: return_function: returning to ‘scan_ag_inumbers’ from ‘alloc_ichunk’
xfsprogs-6.17.0/scrub/inodes.c:573:12: branch_false: following ‘false’ branch...
xfsprogs-6.17.0/scrub/inodes.c:575:16: branch_false: ...to here
xfsprogs-6.17.0/scrub/inodes.c:575:16: release_memory: ‘ichunk’ is NULL
xfsprogs-6.17.0/scrub/inodes.c:579:16: branch_true: following ‘true’ branch (when ‘error == 0’)...
xfsprogs-6.17.0/scrub/inodes.c:579:27: branch_true: ...to here
xfsprogs-6.17.0/scrub/inodes.c:579:16: branch_false: following ‘false’ branch...
xfsprogs-6.17.0/scrub/inodes.c:579:42: branch_false: ...to here
xfsprogs-6.17.0/scrub/inodes.c:579:16: branch_true: following ‘true’ branch...
xfsprogs-6.17.0/scrub/inodes.c:584:31: branch_true: ...to here
xfsprogs-6.17.0/scrub/inodes.c:584:20: branch_false: following ‘false’ branch...
xfsprogs-6.17.0/scrub/inodes.c:593:17: branch_false: ...to here
xfsprogs-6.17.0/scrub/inodes.c:602:27: branch_false: following ‘false’ branch...
xfsprogs-6.17.0/scrub/inodes.c:618:25: branch_false: ...to here
xfsprogs-6.17.0/scrub/inodes.c:618:25: release_memory: ‘ichunk’ is NULL
xfsprogs-6.17.0/scrub/inodes.c:618:25: call_function: calling ‘scan_ag_bulkstat’ from ‘scan_ag_inumbers’
#  471|   	struct xfs_inumbers_req	*ireq = ichunk_to_inumbers(ichunk);
#  472|   	struct xfs_bulkstat_req	*breq = ichunk_to_bulkstat(ichunk);
#  473|-> 	struct scan_inodes	*si = ichunk->si;
#  474|   	struct xfs_bulkstat	*bs = &breq->bulkstat[0];
#  475|   	struct xfs_inumbers	*inumbers = &ireq->inumbers[0];

Error: GCC_ANALYZER_WARNING (CWE-401): [#def328]
xfsprogs-6.17.0/scrub/inodes.c:578:18: warning[-Wanalyzer-malloc-leak]: leak of ‘ichunk’
xfsprogs-6.17.0/scrub/inodes.c:557:1: enter_function: entry to ‘scan_ag_inumbers’
xfsprogs-6.17.0/scrub/inodes.c:572:17: call_function: calling ‘alloc_ichunk’ from ‘scan_ag_inumbers’
xfsprogs-6.17.0/scrub/inodes.c:572:17: return_function: returning to ‘scan_ag_inumbers’ from ‘alloc_ichunk’
xfsprogs-6.17.0/scrub/inodes.c:573:12: branch_false: following ‘false’ branch...
xfsprogs-6.17.0/scrub/inodes.c:575:16: branch_false: ...to here
xfsprogs-6.17.0/scrub/inodes.c:578:18: throw: if ‘xfrog_inumbers’ throws an exception...
xfsprogs-6.17.0/scrub/inodes.c:578:18: danger: ‘ichunk’ leaks here; was allocated at [(4)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/3)
#  576|   
#  577|   	/* Find the inode chunk & alloc mask */
#  578|-> 	error = -xfrog_inumbers(&ctx->mnt, ireq);
#  579|   	while (!error && !si->aborted && ireq->hdr.ocount > 0) {
#  580|   		/*

Error: GCC_ANALYZER_WARNING (CWE-401): [#def329]
xfsprogs-6.17.0/scrub/inodes.c:794:16: warning[-Wanalyzer-malloc-leak]: leak of ‘ureq’
xfsprogs-6.17.0/scrub/inodes.c:783:16: acquire_memory: allocated here
xfsprogs-6.17.0/scrub/inodes.c:785:12: branch_false: following ‘false’ branch (when ‘ureq’ is non-NULL)...
xfsprogs-6.17.0/scrub/inodes.c:790:9: branch_false: ...to here
xfsprogs-6.17.0/scrub/inodes.c:794:16: throw: if ‘xfrog_bulkstat’ throws an exception...
xfsprogs-6.17.0/scrub/inodes.c:794:16: danger: ‘ureq’ leaks here; was allocated at [(1)](sarif:/runs/0/results/2/codeFlows/0/threadFlows/0/locations/0)
#  792|   	ureq->breq.hdr.ino = *cursor;
#  793|   
#  794|-> 	ret = -xfrog_bulkstat(&ctx->mnt, &ureq->breq);
#  795|   	if (ret) {
#  796|   		what = _("user files bulkstat");

Error: GCC_ANALYZER_WARNING (CWE-401): [#def330]
xfsprogs-6.17.0/scrub/phase5.c:134:15: warning[-Wanalyzer-malloc-leak]: leak of ‘fdopendir(*fd)’
xfsprogs-6.17.0/scrub/phase5.c:378:1: enter_function: entry to ‘check_inode_names’
xfsprogs-6.17.0/scrub/phase5.c:399:20: branch_false: following ‘false’ branch...
xfsprogs-6.17.0/scrub/phase5.c:403:20: branch_false: ...to here
xfsprogs-6.17.0/scrub/phase5.c:403:20: branch_false: following ‘false’ branch...
xfsprogs-6.17.0/scrub/phase5.c:408:13: branch_false: ...to here
xfsprogs-6.17.0/scrub/phase5.c:408:12: branch_false: following ‘false’ branch...
xfsprogs-6.17.0/scrub/phase5.c:420:13: branch_false: ...to here
xfsprogs-6.17.0/scrub/phase5.c:420:12: branch_true: following ‘true’ branch...
xfsprogs-6.17.0/scrub/phase5.c:421:22: branch_true: ...to here
xfsprogs-6.17.0/scrub/phase5.c:422:20: branch_false: following ‘false’ branch...
xfsprogs-6.17.0/scrub/phase5.c:430:25: branch_false: ...to here
xfsprogs-6.17.0/scrub/phase5.c:430:25: call_function: calling ‘check_dirent_names’ from ‘check_inode_names’
#  132|   	*fd = -1; /* closedir will close *fd for us */
#  133|   
#  134|-> 	ret = unicrash_dir_init(&uc, ctx, bstat);
#  135|   	if (ret) {
#  136|   		str_liberror(ctx, ret, descr_render(dsc));

Error: GCC_ANALYZER_WARNING (CWE-401): [#def331]
xfsprogs-6.17.0/scrub/phase5.c:136:17: warning[-Wanalyzer-malloc-leak]: leak of ‘fdopendir(*fd)’
xfsprogs-6.17.0/scrub/phase5.c:378:1: enter_function: entry to ‘check_inode_names’
xfsprogs-6.17.0/scrub/phase5.c:399:20: branch_false: following ‘false’ branch...
xfsprogs-6.17.0/scrub/phase5.c:403:20: branch_false: ...to here
xfsprogs-6.17.0/scrub/phase5.c:403:20: branch_false: following ‘false’ branch...
xfsprogs-6.17.0/scrub/phase5.c:408:13: branch_false: ...to here
xfsprogs-6.17.0/scrub/phase5.c:408:12: branch_false: following ‘false’ branch...
xfsprogs-6.17.0/scrub/phase5.c:420:13: branch_false: ...to here
xfsprogs-6.17.0/scrub/phase5.c:420:12: branch_true: following ‘true’ branch...
xfsprogs-6.17.0/scrub/phase5.c:421:22: branch_true: ...to here
xfsprogs-6.17.0/scrub/phase5.c:422:20: branch_false: following ‘false’ branch...
xfsprogs-6.17.0/scrub/phase5.c:430:25: branch_false: ...to here
xfsprogs-6.17.0/scrub/phase5.c:430:25: call_function: calling ‘check_dirent_names’ from ‘check_inode_names’
#  134|   	ret = unicrash_dir_init(&uc, ctx, bstat);
#  135|   	if (ret) {
#  136|-> 		str_liberror(ctx, ret, descr_render(dsc));
#  137|   		goto out_unicrash;
#  138|   	}

Error: GCC_ANALYZER_WARNING (CWE-401): [#def332]
xfsprogs-6.17.0/scrub/phase5.c:141:18: warning[-Wanalyzer-malloc-leak]: leak of ‘fdopendir(*fd)’
xfsprogs-6.17.0/scrub/phase5.c:378:1: enter_function: entry to ‘check_inode_names’
xfsprogs-6.17.0/scrub/phase5.c:399:20: branch_false: following ‘false’ branch...
xfsprogs-6.17.0/scrub/phase5.c:403:20: branch_false: ...to here
xfsprogs-6.17.0/scrub/phase5.c:403:20: branch_false: following ‘false’ branch...
xfsprogs-6.17.0/scrub/phase5.c:408:13: branch_false: ...to here
xfsprogs-6.17.0/scrub/phase5.c:408:12: branch_false: following ‘false’ branch...
xfsprogs-6.17.0/scrub/phase5.c:420:13: branch_false: ...to here
xfsprogs-6.17.0/scrub/phase5.c:420:12: branch_true: following ‘true’ branch...
xfsprogs-6.17.0/scrub/phase5.c:421:22: branch_true: ...to here
xfsprogs-6.17.0/scrub/phase5.c:422:20: branch_false: following ‘false’ branch...
xfsprogs-6.17.0/scrub/phase5.c:430:25: branch_false: ...to here
xfsprogs-6.17.0/scrub/phase5.c:430:25: call_function: calling ‘check_dirent_names’ from ‘check_inode_names’
#  139|   
#  140|   	errno = 0;
#  141|-> 	dentry = readdir(dir);
#  142|   	while (dentry) {
#  143|   		if (uc)

Error: GCC_ANALYZER_WARNING (CWE-401): [#def333]
xfsprogs-6.17.0/scrub/phase5.c:162:9: warning[-Wanalyzer-malloc-leak]: leak of ‘fdopendir(*fd)’
xfsprogs-6.17.0/scrub/phase5.c:378:1: enter_function: entry to ‘check_inode_names’
xfsprogs-6.17.0/scrub/phase5.c:399:20: branch_false: following ‘false’ branch...
xfsprogs-6.17.0/scrub/phase5.c:403:20: branch_false: ...to here
xfsprogs-6.17.0/scrub/phase5.c:403:20: branch_false: following ‘false’ branch...
xfsprogs-6.17.0/scrub/phase5.c:408:13: branch_false: ...to here
xfsprogs-6.17.0/scrub/phase5.c:408:12: branch_false: following ‘false’ branch...
xfsprogs-6.17.0/scrub/phase5.c:420:13: branch_false: ...to here
xfsprogs-6.17.0/scrub/phase5.c:420:12: branch_true: following ‘true’ branch...
xfsprogs-6.17.0/scrub/phase5.c:421:22: branch_true: ...to here
xfsprogs-6.17.0/scrub/phase5.c:422:20: branch_false: following ‘false’ branch...
xfsprogs-6.17.0/scrub/phase5.c:430:25: branch_false: ...to here
xfsprogs-6.17.0/scrub/phase5.c:430:25: call_function: calling ‘check_dirent_names’ from ‘check_inode_names’
#  160|   
#  161|   out_unicrash:
#  162|-> 	closedir(dir);
#  163|   	return ret;
#  164|   }

Error: GCC_ANALYZER_WARNING (CWE-401): [#def334]
xfsprogs-6.17.0/scrub/phase5.c:208:17: warning[-Wanalyzer-malloc-leak]: leak of ‘attrlist’
xfsprogs-6.17.0/scrub/phase5.c:198:20: acquire_memory: allocated here
xfsprogs-6.17.0/scrub/phase5.c:199:12: branch_false: following ‘false’ branch (when ‘attrlist’ is non-NULL)...
xfsprogs-6.17.0/scrub/phase5.c:205:18: branch_false: ...to here
xfsprogs-6.17.0/scrub/phase5.c:206:12: branch_true: following ‘true’ branch (when ‘keybuf’ is NULL)...
xfsprogs-6.17.0/scrub/phase5.c:207:25: branch_true: ...to here
xfsprogs-6.17.0/scrub/phase5.c:208:17: throw: if ‘__descr_render’ throws an exception...
xfsprogs-6.17.0/scrub/phase5.c:208:17: danger: ‘attrlist’ leaks here; was allocated at [(1)](sarif:/runs/0/results/7/codeFlows/0/threadFlows/0/locations/0)
#  206|   	if (!keybuf) {
#  207|   		error = errno;
#  208|-> 		str_errno(ctx, descr_render(dsc));
#  209|   		goto out_attrlist;
#  210|   	}

Error: GCC_ANALYZER_WARNING (CWE-401): [#def335]
xfsprogs-6.17.0/scrub/phase5.c:212:17: warning[-Wanalyzer-malloc-leak]: leak of ‘attrlist’
xfsprogs-6.17.0/scrub/phase5.c:198:20: acquire_memory: allocated here
xfsprogs-6.17.0/scrub/phase5.c:199:12: branch_false: following ‘false’ branch (when ‘attrlist’ is non-NULL)...
xfsprogs-6.17.0/scrub/phase5.c:205:18: branch_false: ...to here
xfsprogs-6.17.0/scrub/phase5.c:206:12: branch_false: following ‘false’ branch (when ‘keybuf’ is non-NULL)...
xfsprogs-6.17.0/scrub/phase5.c:212:17: branch_false: ...to here
xfsprogs-6.17.0/scrub/phase5.c:212:17: throw: if ‘unicrash_xattr_init’ throws an exception...
xfsprogs-6.17.0/scrub/phase5.c:212:17: danger: ‘attrlist’ leaks here; was allocated at [(1)](sarif:/runs/0/results/10/codeFlows/0/threadFlows/0/locations/0)
#  210|   	}
#  211|   
#  212|-> 	error = unicrash_xattr_init(&uc, ctx, bstat);
#  213|   	if (error) {
#  214|   		str_liberror(ctx, error, descr_render(dsc));

Error: GCC_ANALYZER_WARNING (CWE-401): [#def336]
xfsprogs-6.17.0/scrub/phase5.c:212:17: warning[-Wanalyzer-malloc-leak]: leak of ‘keybuf’
xfsprogs-6.17.0/scrub/phase5.c:199:12: branch_false: following ‘false’ branch (when ‘attrlist’ is non-NULL)...
xfsprogs-6.17.0/scrub/phase5.c:205:18: branch_false: ...to here
xfsprogs-6.17.0/scrub/phase5.c:205:18: acquire_memory: allocated here
xfsprogs-6.17.0/scrub/phase5.c:206:12: branch_false: following ‘false’ branch (when ‘keybuf’ is non-NULL)...
xfsprogs-6.17.0/scrub/phase5.c:212:17: branch_false: ...to here
xfsprogs-6.17.0/scrub/phase5.c:212:17: throw: if ‘unicrash_xattr_init’ throws an exception...
xfsprogs-6.17.0/scrub/phase5.c:212:17: danger: ‘keybuf’ leaks here; was allocated at [(3)](sarif:/runs/0/results/9/codeFlows/0/threadFlows/0/locations/2)
#  210|   	}
#  211|   
#  212|-> 	error = unicrash_xattr_init(&uc, ctx, bstat);
#  213|   	if (error) {
#  214|   		str_liberror(ctx, error, descr_render(dsc));

Error: GCC_ANALYZER_WARNING (CWE-401): [#def337]
xfsprogs-6.17.0/scrub/phase5.c:214:17: warning[-Wanalyzer-malloc-leak]: leak of ‘attrlist’
xfsprogs-6.17.0/scrub/phase5.c:198:20: acquire_memory: allocated here
xfsprogs-6.17.0/scrub/phase5.c:199:12: branch_false: following ‘false’ branch (when ‘attrlist’ is non-NULL)...
xfsprogs-6.17.0/scrub/phase5.c:205:18: branch_false: ...to here
xfsprogs-6.17.0/scrub/phase5.c:206:12: branch_false: following ‘false’ branch (when ‘keybuf’ is non-NULL)...
xfsprogs-6.17.0/scrub/phase5.c:212:17: branch_false: ...to here
xfsprogs-6.17.0/scrub/phase5.c:213:12: branch_true: following ‘true’ branch...
xfsprogs-6.17.0/scrub/phase5.c:214:17: branch_true: ...to here
xfsprogs-6.17.0/scrub/phase5.c:214:17: throw: if ‘__descr_render’ throws an exception...
xfsprogs-6.17.0/scrub/phase5.c:214:17: danger: ‘attrlist’ leaks here; was allocated at [(1)](sarif:/runs/0/results/12/codeFlows/0/threadFlows/0/locations/0)
#  212|   	error = unicrash_xattr_init(&uc, ctx, bstat);
#  213|   	if (error) {
#  214|-> 		str_liberror(ctx, error, descr_render(dsc));
#  215|   		goto out_keybuf;
#  216|   	}

Error: GCC_ANALYZER_WARNING (CWE-401): [#def338]
xfsprogs-6.17.0/scrub/phase5.c:214:17: warning[-Wanalyzer-malloc-leak]: leak of ‘keybuf’
xfsprogs-6.17.0/scrub/phase5.c:199:12: branch_false: following ‘false’ branch (when ‘attrlist’ is non-NULL)...
xfsprogs-6.17.0/scrub/phase5.c:205:18: branch_false: ...to here
xfsprogs-6.17.0/scrub/phase5.c:205:18: acquire_memory: allocated here
xfsprogs-6.17.0/scrub/phase5.c:206:12: branch_false: following ‘false’ branch (when ‘keybuf’ is non-NULL)...
xfsprogs-6.17.0/scrub/phase5.c:212:17: branch_false: ...to here
xfsprogs-6.17.0/scrub/phase5.c:213:12: branch_true: following ‘true’ branch...
xfsprogs-6.17.0/scrub/phase5.c:214:17: branch_true: ...to here
xfsprogs-6.17.0/scrub/phase5.c:214:17: throw: if ‘__descr_render’ throws an exception...
xfsprogs-6.17.0/scrub/phase5.c:214:17: danger: ‘keybuf’ leaks here; was allocated at [(3)](sarif:/runs/0/results/11/codeFlows/0/threadFlows/0/locations/2)
#  212|   	error = unicrash_xattr_init(&uc, ctx, bstat);
#  213|   	if (error) {
#  214|-> 		str_liberror(ctx, error, descr_render(dsc));
#  215|   		goto out_keybuf;
#  216|   	}

Error: GCC_ANALYZER_WARNING (CWE-401): [#def339]
xfsprogs-6.17.0/scrub/phase5.c:249:25: warning[-Wanalyzer-malloc-leak]: leak of ‘keybuf’
xfsprogs-6.17.0/scrub/phase5.c:199:12: branch_false: following ‘false’ branch (when ‘attrlist’ is non-NULL)...
xfsprogs-6.17.0/scrub/phase5.c:205:18: branch_false: ...to here
xfsprogs-6.17.0/scrub/phase5.c:205:18: acquire_memory: allocated here
xfsprogs-6.17.0/scrub/phase5.c:206:12: branch_false: following ‘false’ branch (when ‘keybuf’ is non-NULL)...
xfsprogs-6.17.0/scrub/phase5.c:212:17: branch_false: ...to here
xfsprogs-6.17.0/scrub/phase5.c:213:12: branch_false: following ‘false’ branch...
xfsprogs-6.17.0/scrub/phase5.c:213:12: branch_false: ...to here
xfsprogs-6.17.0/scrub/phase5.c:244:12: branch_true: following ‘true’ branch (when ‘error != 0’)...
xfsprogs-6.17.0/scrub/phase5.c:245:21: branch_true: ...to here
xfsprogs-6.17.0/scrub/phase5.c:248:20: branch_true: following ‘true’ branch (when ‘error != 0’)...
xfsprogs-6.17.0/scrub/phase5.c:249:25: branch_true: ...to here
xfsprogs-6.17.0/scrub/phase5.c:249:25: throw: if ‘__descr_render’ throws an exception...
xfsprogs-6.17.0/scrub/phase5.c:249:25: danger: ‘keybuf’ leaks here; was allocated at [(3)](sarif:/runs/0/results/15/codeFlows/0/threadFlows/0/locations/2)
#  247|   		error = errno;
#  248|   		if (errno)
#  249|-> 			str_errno(ctx, descr_render(dsc));
#  250|   	}
#  251|   out_uc:

Error: GCC_ANALYZER_WARNING (CWE-401): [#def340]
xfsprogs-6.17.0/scrub/phase5.c:689:16: warning[-Wanalyzer-malloc-leak]: leak of ‘item’
xfsprogs-6.17.0/scrub/phase5.c:679:16: acquire_memory: allocated here
xfsprogs-6.17.0/scrub/phase5.c:680:12: branch_false: following ‘false’ branch (when ‘item’ is non-NULL)...
xfsprogs-6.17.0/scrub/phase5.c:685:9: branch_false: ...to here
xfsprogs-6.17.0/scrub/phase5.c:689:16: throw: if ‘workqueue_add’ throws an exception...
xfsprogs-6.17.0/scrub/phase5.c:689:16: danger: ‘item’ leaks here; was allocated at [(1)](sarif:/runs/0/results/17/codeFlows/0/threadFlows/0/locations/0)
#  687|   	item->abortedp = abortedp;
#  688|   
#  689|-> 	ret = -workqueue_add(wq, fs_scan_worker, nr, item);
#  690|   	if (ret)
#  691|   		str_liberror(ctx, ret, _("queuing fs scan work"));

Error: GCC_ANALYZER_WARNING (CWE-401): [#def341]
xfsprogs-6.17.0/scrub/phase5.c:766:16: warning[-Wanalyzer-malloc-leak]: leak of ‘item’
xfsprogs-6.17.0/scrub/phase5.c:756:16: acquire_memory: allocated here
xfsprogs-6.17.0/scrub/phase5.c:757:12: branch_false: following ‘false’ branch (when ‘item’ is non-NULL)...
xfsprogs-6.17.0/scrub/phase5.c:757:12: branch_false: ...to here
xfsprogs-6.17.0/scrub/phase5.c:766:16: throw: if ‘workqueue_add’ throws an exception...
xfsprogs-6.17.0/scrub/phase5.c:766:16: danger: ‘item’ leaks here; was allocated at [(1)](sarif:/runs/0/results/18/codeFlows/0/threadFlows/0/locations/0)
#  764|   	item->abortedp = abortedp;
#  765|   
#  766|-> 	ret = -workqueue_add(wq, fs_scan_worker, 0, item);
#  767|   	if (ret)
#  768|   		str_liberror(ctx, ret, _("queuing metapath scan work"));

Error: GCC_ANALYZER_WARNING (CWE-401): [#def342]
xfsprogs-6.17.0/scrub/read_verify.c:314:16: warning[-Wanalyzer-malloc-leak]: leak of ‘tmp’
xfsprogs-6.17.0/scrub/read_verify.c:306:15: acquire_memory: allocated here
xfsprogs-6.17.0/scrub/read_verify.c:307:12: branch_false: following ‘false’ branch (when ‘tmp’ is non-NULL)...
xfsprogs-6.17.0/scrub/read_verify.c:312:9: branch_false: ...to here
xfsprogs-6.17.0/scrub/read_verify.c:314:16: throw: if ‘workqueue_add’ throws an exception...
xfsprogs-6.17.0/scrub/read_verify.c:314:16: danger: ‘tmp’ leaks here; was allocated at [(1)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/0)
#  312|   	memcpy(tmp, rv, sizeof(*tmp));
#  313|   
#  314|-> 	ret = -workqueue_add(&rvp->wq, read_verify, 0, tmp);
#  315|   	if (ret) {
#  316|   		free(tmp);

Error: GCC_ANALYZER_WARNING (CWE-476): [#def343]
xfsprogs-6.17.0/scrub/scrub.c:305:9: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’
xfsprogs-6.17.0/scrub/scrub.c:296:1: enter_function: entry to ‘xfrog_scrubv_add_item’
xfsprogs-6.17.0/scrub/scrub.c:304:13: call_function: inlined call to ‘xfrog_scrubv_next_vector’ from ‘xfrog_scrubv_add_item’
xfsprogs-6.17.0/scrub/scrub.c:305:9: branch_true: ...to here
xfsprogs-6.17.0/scrub/scrub.c:305:9: danger: dereference of NULL ‘<unknown>’
#  303|   
#  304|   	v = xfrog_scrubv_next_vector(scrubv);
#  305|-> 	v->sv_type = scrub_type;
#  306|   	if (want_repair)
#  307|   		v->sv_flags |= XFS_SCRUB_IFLAG_REPAIR;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def344]
xfsprogs-6.17.0/scrub/scrub.c:321:9: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’
xfsprogs-6.17.0/scrub/scrub.c:314:1: enter_function: entry to ‘xfrog_scrubv_add_barrier’
xfsprogs-6.17.0/scrub/scrub.c:319:13: call_function: inlined call to ‘xfrog_scrubv_next_vector’ from ‘xfrog_scrubv_add_barrier’
xfsprogs-6.17.0/scrub/scrub.c:321:9: branch_true: ...to here
xfsprogs-6.17.0/scrub/scrub.c:321:9: danger: dereference of NULL ‘<unknown>’
#  319|   	v = xfrog_scrubv_next_vector(scrubv);
#  320|   
#  321|-> 	v->sv_type = XFS_SCRUB_TYPE_BARRIER;
#  322|   	v->sv_flags = XFS_SCRUB_OFLAG_CORRUPT | XFS_SCRUB_OFLAG_XFAIL |
#  323|   		      XFS_SCRUB_OFLAG_XCORRUPT | XFS_SCRUB_OFLAG_INCOMPLETE;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def345]
xfsprogs-6.17.0/scrub/vfs.c:100:18: warning[-Wanalyzer-malloc-leak]: leak of ‘<unknown>’
xfsprogs-6.17.0/scrub/vfs.c:87:12: branch_false: following ‘false’ branch (when ‘new_sftd’ is non-NULL)...
xfsprogs-6.17.0/scrub/vfs.c:90:26: branch_false: ...to here
xfsprogs-6.17.0/scrub/vfs.c:90:26: acquire_memory: allocated here
xfsprogs-6.17.0/scrub/vfs.c:91:12: branch_false: following ‘false’ branch...
xfsprogs-6.17.0/scrub/vfs.c:96:9: branch_false: ...to here
xfsprogs-6.17.0/scrub/vfs.c:100:18: throw: if ‘workqueue_add’ throws an exception...
xfsprogs-6.17.0/scrub/vfs.c:100:18: danger: ‘<unknown>’ leaks here; was allocated at [(3)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/2)
#   98|   
#   99|   	inc_nr_dirs(sft);
#  100|-> 	error = -workqueue_add(wq, scan_fs_dir, 0, new_sftd);
#  101|   	if (error) {
#  102|   		dec_nr_dirs(sft);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def346]
xfsprogs-6.17.0/scrub/vfs.c:100:18: warning[-Wanalyzer-malloc-leak]: leak of ‘new_sftd’
xfsprogs-6.17.0/scrub/vfs.c:86:20: acquire_memory: allocated here
xfsprogs-6.17.0/scrub/vfs.c:87:12: branch_false: following ‘false’ branch (when ‘new_sftd’ is non-NULL)...
xfsprogs-6.17.0/scrub/vfs.c:90:26: branch_false: ...to here
xfsprogs-6.17.0/scrub/vfs.c:91:12: branch_false: following ‘false’ branch...
xfsprogs-6.17.0/scrub/vfs.c:96:9: branch_false: ...to here
xfsprogs-6.17.0/scrub/vfs.c:100:18: throw: if ‘workqueue_add’ throws an exception...
xfsprogs-6.17.0/scrub/vfs.c:100:18: danger: ‘new_sftd’ leaks here; was allocated at [(1)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/0)
#   98|   
#   99|   	inc_nr_dirs(sft);
#  100|-> 	error = -workqueue_add(wq, scan_fs_dir, 0, new_sftd);
#  101|   	if (error) {
#  102|   		dec_nr_dirs(sft);

Error: GCC_ANALYZER_WARNING (CWE-775): [#def347]
xfsprogs-6.17.0/scrub/vfs.c:141:17: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘open(*(struct scan_fs_tree_dir *)arg.path, 393472)’
xfsprogs-6.17.0/scrub/vfs.c:133:18: acquire_resource: opened here
xfsprogs-6.17.0/scrub/vfs.c:134:12: branch_false: following ‘false’ branch...
xfsprogs-6.17.0/scrub/vfs.c:141:17: branch_false: ...to here
xfsprogs-6.17.0/scrub/vfs.c:141:17: throw: if the called function throws an exception...
xfsprogs-6.17.0/scrub/vfs.c:141:17: danger: ‘open(*(struct scan_fs_tree_dir *)arg.path, 393472)’ leaks here; was opened at [(1)](sarif:/runs/0/results/2/codeFlows/0/threadFlows/0/locations/0)
#  139|   
#  140|   	/* Caller-specific directory checks. */
#  141|-> 	error = sft->dir_fn(ctx, sftd->path, dir_fd, sft->arg);
#  142|   	if (error) {
#  143|   		sft->aborted = true;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def348]
xfsprogs-6.17.0/scrub/xfs_scrub.c:750:42: warning[-Wanalyzer-malloc-leak]: leak of ‘progress_fp’
xfsprogs-6.17.0/scrub/xfs_scrub.c:737:12: branch_false: following ‘false’ branch...
xfsprogs-6.17.0/scrub/xfs_scrub.c:744:9: branch_false: ...to here
xfsprogs-6.17.0/scrub/xfs_scrub.c:747:16: branch_true: following ‘true’ branch (when ‘c != -1’)...
xfsprogs-6.17.0/scrub/xfs_scrub.c:748:17: branch_true: ...to here
xfsprogs-6.17.0/scrub/xfs_scrub.c:763:28: branch_false: following ‘false’ branch...
xfsprogs-6.17.0/scrub/xfs_scrub.c:767:39: branch_false: ...to here
xfsprogs-6.17.0/scrub/xfs_scrub.c:767:39: acquire_memory: allocated here
xfsprogs-6.17.0/scrub/xfs_scrub.c:768:28: branch_false: following ‘false’ branch (when ‘progress_fp’ is non-NULL)...
xfsprogs-6.17.0/scrub/xfs_scrub.c:768:28: branch_false: ...to here
xfsprogs-6.17.0/scrub/xfs_scrub.c:747:16: branch_true: following ‘true’ branch (when ‘c != -1’)...
xfsprogs-6.17.0/scrub/xfs_scrub.c:748:17: branch_true: ...to here
xfsprogs-6.17.0/scrub/xfs_scrub.c:750:42: throw: if ‘cvt_u64’ throws an exception...
xfsprogs-6.17.0/scrub/xfs_scrub.c:750:42: danger: ‘progress_fp’ leaks here; was allocated at [(7)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/6)
#  748|   		switch (c) {
#  749|   		case 'a':
#  750|-> 			ctx.max_errors = cvt_u64(optarg, 10);
#  751|   			if (errno) {
#  752|   				perror(optarg);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def349]
xfsprogs-6.17.0/scrub/xfs_scrub.c:752:33: warning[-Wanalyzer-malloc-leak]: leak of ‘progress_fp’
xfsprogs-6.17.0/scrub/xfs_scrub.c:737:12: branch_false: following ‘false’ branch...
xfsprogs-6.17.0/scrub/xfs_scrub.c:744:9: branch_false: ...to here
xfsprogs-6.17.0/scrub/xfs_scrub.c:747:16: branch_true: following ‘true’ branch (when ‘c != -1’)...
xfsprogs-6.17.0/scrub/xfs_scrub.c:748:17: branch_true: ...to here
xfsprogs-6.17.0/scrub/xfs_scrub.c:763:28: branch_false: following ‘false’ branch...
xfsprogs-6.17.0/scrub/xfs_scrub.c:767:39: branch_false: ...to here
xfsprogs-6.17.0/scrub/xfs_scrub.c:767:39: acquire_memory: allocated here
xfsprogs-6.17.0/scrub/xfs_scrub.c:768:28: branch_false: following ‘false’ branch (when ‘progress_fp’ is non-NULL)...
xfsprogs-6.17.0/scrub/xfs_scrub.c:768:28: branch_false: ...to here
xfsprogs-6.17.0/scrub/xfs_scrub.c:747:16: branch_true: following ‘true’ branch (when ‘c != -1’)...
xfsprogs-6.17.0/scrub/xfs_scrub.c:748:17: branch_true: ...to here
xfsprogs-6.17.0/scrub/xfs_scrub.c:752:33: throw: if ‘perror’ throws an exception...
xfsprogs-6.17.0/scrub/xfs_scrub.c:752:33: danger: ‘progress_fp’ leaks here; was allocated at [(7)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/6)
#  750|   			ctx.max_errors = cvt_u64(optarg, 10);
#  751|   			if (errno) {
#  752|-> 				perror(optarg);
#  753|   				usage();
#  754|   			}

Error: GCC_ANALYZER_WARNING (CWE-401): [#def350]
xfsprogs-6.17.0/scrub/xfs_scrub.c:762:30: warning[-Wanalyzer-malloc-leak]: leak of ‘progress_fp’
xfsprogs-6.17.0/scrub/xfs_scrub.c:737:12: branch_false: following ‘false’ branch...
xfsprogs-6.17.0/scrub/xfs_scrub.c:744:9: branch_false: ...to here
xfsprogs-6.17.0/scrub/xfs_scrub.c:747:16: branch_true: following ‘true’ branch (when ‘c != -1’)...
xfsprogs-6.17.0/scrub/xfs_scrub.c:748:17: branch_true: ...to here
xfsprogs-6.17.0/scrub/xfs_scrub.c:763:28: branch_false: following ‘false’ branch...
xfsprogs-6.17.0/scrub/xfs_scrub.c:767:39: branch_false: ...to here
xfsprogs-6.17.0/scrub/xfs_scrub.c:767:39: acquire_memory: allocated here
xfsprogs-6.17.0/scrub/xfs_scrub.c:768:28: branch_false: following ‘false’ branch (when ‘progress_fp’ is non-NULL)...
xfsprogs-6.17.0/scrub/xfs_scrub.c:768:28: branch_false: ...to here
xfsprogs-6.17.0/scrub/xfs_scrub.c:747:16: branch_true: following ‘true’ branch (when ‘c != -1’)...
xfsprogs-6.17.0/scrub/xfs_scrub.c:748:17: branch_true: ...to here
xfsprogs-6.17.0/scrub/xfs_scrub.c:762:30: throw: if ‘cvt_u32’ throws an exception...
xfsprogs-6.17.0/scrub/xfs_scrub.c:762:30: danger: ‘progress_fp’ leaks here; was allocated at [(7)](sarif:/runs/0/results/2/codeFlows/0/threadFlows/0/locations/6)
#  760|   		case 'C':
#  761|   			errno = 0;
#  762|-> 			fd = cvt_u32(optarg, 10);
#  763|   			if (errno) {
#  764|   				perror(optarg);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def351]
xfsprogs-6.17.0/scrub/xfs_scrub.c:764:33: warning[-Wanalyzer-malloc-leak]: leak of ‘progress_fp’
xfsprogs-6.17.0/scrub/xfs_scrub.c:737:12: branch_false: following ‘false’ branch...
xfsprogs-6.17.0/scrub/xfs_scrub.c:744:9: branch_false: ...to here
xfsprogs-6.17.0/scrub/xfs_scrub.c:747:16: branch_true: following ‘true’ branch (when ‘c != -1’)...
xfsprogs-6.17.0/scrub/xfs_scrub.c:748:17: branch_true: ...to here
xfsprogs-6.17.0/scrub/xfs_scrub.c:763:28: branch_false: following ‘false’ branch...
xfsprogs-6.17.0/scrub/xfs_scrub.c:767:39: branch_false: ...to here
xfsprogs-6.17.0/scrub/xfs_scrub.c:767:39: acquire_memory: allocated here
xfsprogs-6.17.0/scrub/xfs_scrub.c:768:28: branch_false: following ‘false’ branch (when ‘progress_fp’ is non-NULL)...
xfsprogs-6.17.0/scrub/xfs_scrub.c:768:28: branch_false: ...to here
xfsprogs-6.17.0/scrub/xfs_scrub.c:747:16: branch_true: following ‘true’ branch (when ‘c != -1’)...
xfsprogs-6.17.0/scrub/xfs_scrub.c:748:17: branch_true: ...to here
xfsprogs-6.17.0/scrub/xfs_scrub.c:764:33: throw: if ‘perror’ throws an exception...
xfsprogs-6.17.0/scrub/xfs_scrub.c:764:33: danger: ‘progress_fp’ leaks here; was allocated at [(7)](sarif:/runs/0/results/3/codeFlows/0/threadFlows/0/locations/6)
#  762|   			fd = cvt_u32(optarg, 10);
#  763|   			if (errno) {
#  764|-> 				perror(optarg);
#  765|   				usage();
#  766|   			}

Error: GCC_ANALYZER_WARNING (CWE-401): [#def352]
xfsprogs-6.17.0/scrub/xfs_scrub.c:769:33: warning[-Wanalyzer-malloc-leak]: leak of ‘progress_fp’
xfsprogs-6.17.0/scrub/xfs_scrub.c:737:12: branch_false: following ‘false’ branch...
xfsprogs-6.17.0/scrub/xfs_scrub.c:744:9: branch_false: ...to here
xfsprogs-6.17.0/scrub/xfs_scrub.c:747:16: branch_true: following ‘true’ branch (when ‘c != -1’)...
xfsprogs-6.17.0/scrub/xfs_scrub.c:748:17: branch_true: ...to here
xfsprogs-6.17.0/scrub/xfs_scrub.c:763:28: branch_false: following ‘false’ branch...
xfsprogs-6.17.0/scrub/xfs_scrub.c:767:39: branch_false: ...to here
xfsprogs-6.17.0/scrub/xfs_scrub.c:767:39: acquire_memory: allocated here
xfsprogs-6.17.0/scrub/xfs_scrub.c:768:28: branch_false: following ‘false’ branch (when ‘progress_fp’ is non-NULL)...
xfsprogs-6.17.0/scrub/xfs_scrub.c:768:28: branch_false: ...to here
xfsprogs-6.17.0/scrub/xfs_scrub.c:747:16: branch_true: following ‘true’ branch (when ‘c != -1’)...
xfsprogs-6.17.0/scrub/xfs_scrub.c:748:17: branch_true: ...to here
xfsprogs-6.17.0/scrub/xfs_scrub.c:763:28: branch_false: following ‘false’ branch...
xfsprogs-6.17.0/scrub/xfs_scrub.c:767:39: branch_false: ...to here
xfsprogs-6.17.0/scrub/xfs_scrub.c:769:33: throw: if ‘perror’ throws an exception...
xfsprogs-6.17.0/scrub/xfs_scrub.c:769:33: danger: ‘progress_fp’ leaks here; was allocated at [(7)](sarif:/runs/0/results/4/codeFlows/0/threadFlows/0/locations/6)
#  767|   			progress_fp = fdopen(fd, "w");
#  768|   			if (!progress_fp) {
#  769|-> 				perror(optarg);
#  770|   				usage();
#  771|   			}

Error: GCC_ANALYZER_WARNING (CWE-401): [#def353]
xfsprogs-6.17.0/scrub/xfs_scrub.c:847:21: warning[-Wanalyzer-malloc-leak]: leak of ‘progress_fp’
xfsprogs-6.17.0/scrub/xfs_scrub.c:737:12: branch_false: following ‘false’ branch...
xfsprogs-6.17.0/scrub/xfs_scrub.c:744:9: branch_false: ...to here
xfsprogs-6.17.0/scrub/xfs_scrub.c:747:16: branch_true: following ‘true’ branch (when ‘c != -1’)...
xfsprogs-6.17.0/scrub/xfs_scrub.c:748:17: branch_true: ...to here
xfsprogs-6.17.0/scrub/xfs_scrub.c:763:28: branch_false: following ‘false’ branch...
xfsprogs-6.17.0/scrub/xfs_scrub.c:767:39: branch_false: ...to here
xfsprogs-6.17.0/scrub/xfs_scrub.c:767:39: acquire_memory: allocated here
xfsprogs-6.17.0/scrub/xfs_scrub.c:768:28: branch_false: following ‘false’ branch (when ‘progress_fp’ is non-NULL)...
xfsprogs-6.17.0/scrub/xfs_scrub.c:768:28: branch_false: ...to here
xfsprogs-6.17.0/scrub/xfs_scrub.c:831:12: branch_false: following ‘false’ branch (when ‘vflag == 0’)...
xfsprogs-6.17.0/scrub/xfs_scrub.c:844:13: branch_false: ...to here
xfsprogs-6.17.0/scrub/xfs_scrub.c:844:12: branch_true: following ‘true’ branch...
xfsprogs-6.17.0/scrub/xfs_scrub.c:847:21: branch_true: ...to here
xfsprogs-6.17.0/scrub/xfs_scrub.c:847:21: throw: if ‘cvt_u32’ throws an exception...
xfsprogs-6.17.0/scrub/xfs_scrub.c:847:21: danger: ‘progress_fp’ leaks here; was allocated at [(7)](sarif:/runs/0/results/5/codeFlows/0/threadFlows/0/locations/6)
#  845|   		unsigned int	x;
#  846|   
#  847|-> 		x = cvt_u32(getenv("XFS_SCRUB_THREADS"), 10);
#  848|   		if (errno) {
#  849|   			perror("nr_threads");

Error: GCC_ANALYZER_WARNING (CWE-401): [#def354]
xfsprogs-6.17.0/scrub/xfs_scrub.c:849:25: warning[-Wanalyzer-malloc-leak]: leak of ‘progress_fp’
xfsprogs-6.17.0/scrub/xfs_scrub.c:737:12: branch_false: following ‘false’ branch...
xfsprogs-6.17.0/scrub/xfs_scrub.c:744:9: branch_false: ...to here
xfsprogs-6.17.0/scrub/xfs_scrub.c:747:16: branch_true: following ‘true’ branch (when ‘c != -1’)...
xfsprogs-6.17.0/scrub/xfs_scrub.c:748:17: branch_true: ...to here
xfsprogs-6.17.0/scrub/xfs_scrub.c:763:28: branch_false: following ‘false’ branch...
xfsprogs-6.17.0/scrub/xfs_scrub.c:767:39: branch_false: ...to here
xfsprogs-6.17.0/scrub/xfs_scrub.c:767:39: acquire_memory: allocated here
xfsprogs-6.17.0/scrub/xfs_scrub.c:768:28: branch_false: following ‘false’ branch (when ‘progress_fp’ is non-NULL)...
xfsprogs-6.17.0/scrub/xfs_scrub.c:768:28: branch_false: ...to here
xfsprogs-6.17.0/scrub/xfs_scrub.c:831:12: branch_false: following ‘false’ branch (when ‘vflag == 0’)...
xfsprogs-6.17.0/scrub/xfs_scrub.c:844:13: branch_false: ...to here
xfsprogs-6.17.0/scrub/xfs_scrub.c:844:12: branch_true: following ‘true’ branch...
xfsprogs-6.17.0/scrub/xfs_scrub.c:847:21: branch_true: ...to here
xfsprogs-6.17.0/scrub/xfs_scrub.c:848:20: branch_true: following ‘true’ branch...
xfsprogs-6.17.0/scrub/xfs_scrub.c:849:25: branch_true: ...to here
xfsprogs-6.17.0/scrub/xfs_scrub.c:849:25: throw: if ‘perror’ throws an exception...
xfsprogs-6.17.0/scrub/xfs_scrub.c:849:25: danger: ‘progress_fp’ leaks here; was allocated at [(7)](sarif:/runs/0/results/6/codeFlows/0/threadFlows/0/locations/6)
#  847|   		x = cvt_u32(getenv("XFS_SCRUB_THREADS"), 10);
#  848|   		if (errno) {
#  849|-> 			perror("nr_threads");
#  850|   			usage();
#  851|   		}

Error: GCC_ANALYZER_WARNING (CWE-401): [#def355]
xfsprogs-6.17.0/spaceman/file.c:98:17: warning[-Wanalyzer-malloc-leak]: leak of ‘filename’
xfsprogs-6.17.0/spaceman/file.c:87:20: acquire_memory: allocated here
xfsprogs-6.17.0/spaceman/file.c:88:12: branch_false: following ‘false’ branch (when ‘filename’ is non-NULL)...
xfsprogs-6.17.0/spaceman/file.c:96:41: branch_false: ...to here
xfsprogs-6.17.0/spaceman/file.c:97:12: branch_true: following ‘true’ branch...
xfsprogs-6.17.0/spaceman/file.c:98:17: branch_true: ...to here
xfsprogs-6.17.0/spaceman/file.c:98:17: throw: if ‘perror’ throws an exception...
xfsprogs-6.17.0/spaceman/file.c:98:17: danger: ‘filename’ leaks here; was allocated at [(1)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/0)
#   96|   					++filecount * sizeof(struct fileio));
#   97|   	if (!filetable) {
#   98|-> 		perror("realloc");
#   99|   		filecount = 0;
#  100|   		free(filename);

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-83.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-namexfsprogs-6.17.0-1.fc44
store-results-to/tmp/tmpwgd8ulpr/xfsprogs-6.17.0-1.fc44.tar.xz
time-created2026-01-08 22:15:27
time-finished2026-01-08 22:18:46
toolcsmock
tool-args'/usr/bin/csmock' '-r' 'fedora-rawhide-x86_64' '-t' 'gcc,cppcheck,clippy,shellcheck,unicontrol' '-o' '/tmp/tmpwgd8ulpr/xfsprogs-6.17.0-1.fc44.tar.xz' '--gcc-analyze' '--unicontrol-notests' '--unicontrol-bidi-only' '--install' 'pam' '--gcc-analyzer-bin=/usr/bin/gcc' '/tmp/tmpwgd8ulpr/xfsprogs-6.17.0-1.fc44.src.rpm'
tool-versioncsmock-3.8.3.20251215.161544.g62de9a5-1.el9