lvm2-2.03.38-1.fc44

List of Findings

Error: SHELLCHECK_WARNING (CWE-457): [#def1]
/usr/bin/blkdeactivate:151:23: warning[SC2154]: kname is referenced but not assigned (did you mean 'xname'?).
#  149|   
#  150|   add_device_to_skip_list() {
#  151|-> 	SKIP_DEVICE_LIST+=(["$kname"]=1)
#  152|   	return 1
#  153|   }

Error: SHELLCHECK_WARNING (CWE-457): [#def2]
/usr/bin/blkdeactivate:168:11: warning[SC2154]: mnt is referenced but not assigned.
#  166|   
#  167|   device_umount_one() {
#  168|-> 	test -z "$mnt" && return 0
#  169|   
#  170|   	if test -z "${SKIP_UMOUNT_LIST["$mnt"]}" -a "$DO_UMOUNT" -eq "1"; then

Error: SHELLCHECK_WARNING (CWE-457): [#def3]
/usr/bin/blkdeactivate:171:35: warning[SC2154]: name is referenced but not assigned (did you mean 'xname'?).
#  169|   
#  170|   	if test -z "${SKIP_UMOUNT_LIST["$mnt"]}" -a "$DO_UMOUNT" -eq "1"; then
#  171|-> 		echo -n "  [UMOUNT]: unmounting $name ($kname) mounted on $mnt... "
#  172|   		if eval "$UMOUNT" $UMOUNT_OPTS "$(printf "%s" "$mnt")" "$OUT" "$ERR"; then
#  173|   			echo "done"

Error: SHELLCHECK_WARNING (CWE-457): [#def4]
/usr/bin/blkdeactivate:187:8: warning[SC2154]: devtype is referenced but not assigned.
#  185|   
#  186|   device_umount() {
#  187|-> 	test "$devtype" != "lvm" && test "${kname:0:3}" != "dm-" \
#  188|             && test "${kname:0:2}" != "md" && return 0
#  189|   

Error: SHELLCHECK_WARNING (CWE-140): [#def5]
/usr/bin/lvm_import_vdo:207:19: warning[SC2207]: Prefer mapfile or read -a to split command output (or quote to avoid splitting).
#  205|   	local initial_status
#  206|   
#  207|-> 	initial_status=( $("$DMSETUP" status "$VDO_DM_SNAPSHOT_NAME") )
#  208|   	"$DMSETUP" reload "$VDO_DM_SNAPSHOT_NAME" --table "$(snapshot_target_line_ "$1" "$VDO_SNAPSHOT_LOOP" -merge)"
#  209|   	"$DMSETUP" suspend "$VDO_DM_SNAPSHOT_NAME" || {

Error: SHELLCHECK_WARNING (CWE-140): [#def6]
/usr/bin/lvm_import_vdo:225:12: warning[SC2207]: Prefer mapfile or read -a to split command output (or quote to avoid splitting).
#  223|   	# FIXME: Recovery when something prevents merging is hard
#  224|   	for i in {1..20}; do
#  225|-> 		status=( $("$DMSETUP" status "$VDO_DM_SNAPSHOT_NAME") )
#  226|   		# Check if merging is finished
#  227|   		[ "${status[3]%/*}" = "${status[4]}" ] && break

Error: SHELLCHECK_WARNING (CWE-563): [#def7]
/usr/bin/lvm_import_vdo:471:21: warning[SC2034]: vdo_non_converted appears unused. Verify use (or export if used externally).
#  469|   		# trim leading spaces
#  470|   		case "$(echo $line)" in
#  471|-> 		"Non converted"*) vdo_non_converted=1 ;;
#  472|   		"Length"*) vdo_length=${line##* = } ;;
#  473|   		"Conversion completed"*)

Error: SHELLCHECK_WARNING (CWE-563): [#def8]
/usr/bin/lvm_import_vdo:472:14: warning[SC2034]: vdo_length appears unused. Verify use (or export if used externally).
#  470|   		case "$(echo $line)" in
#  471|   		"Non converted"*) vdo_non_converted=1 ;;
#  472|-> 		"Length"*) vdo_length=${line##* = } ;;
#  473|   		"Conversion completed"*)
#  474|   			   vdo_aligned=${line##*aligned on }

Error: SHELLCHECK_WARNING: [#def9]
/usr/bin/lvmdump:133:8: warning[SC2294]: eval negates the benefit of arrays. Drop eval to preserve whitespace/symbols (or eval as string).
#  131|   log() {
#  132|   	echo "$@" >> "$log"
#  133|-> 	eval "$@"
#  134|   }
#  135|   

Error: SHELLCHECK_WARNING (CWE-140): [#def10]
/usr/bin/lvmpersist:171:9: warning[SC2207]: Prefer mapfile or read -a to split command output (or quote to avoid splitting).
#  169|   	# sort with -u eliminates repeated keys listed with multipath
#  170|   
#  171|-> 	KEYS=( $($cmd $cmdopts --in --read-keys "$dev" 2>/dev/null | grep "    0x" | sort -u | xargs ) )
#  172|   
#  173|   	if [ "${PIPESTATUS[0]}" -ne "0" ]; then

Error: SHELLCHECK_WARNING (CWE-670): [#def11]
/usr/bin/lvmpersist:856:13: warning[SC2128]: Expanding an array without an index only gives the first element.
#  854|   
#  855|   		get_key_list "$dev"
#  856|-> 		if [[ -n "$KEYS" ]]; then
#  857|   			logmsg "clear $GROUP keys not cleared from $dev - ${KEYS[*]}"
#  858|   			err=1

Error: SHELLCHECK_WARNING (CWE-140): [#def12]
/usr/bin/lvmpersist:1379:12: warning[SC2207]: Prefer mapfile or read -a to split command output (or quote to avoid splitting).
# 1377|   get_devices_from_vg() {
# 1378|   	local IFS=:
# 1379|-> 	DEVICES=( $("$LVM" vgs --nolocking --noheadings --separator : --sort pv_uuid --o pv_name --rows --config log/prefix=\"\" "$VGNAME") )
# 1380|   }
# 1381|   

Error: SHELLCHECK_WARNING (CWE-670): [#def13]
/usr/bin/lvmpersist:1386:15: warning[SC2128]: Expanding an array without an index only gives the first element.
# 1384|   fi
# 1385|   
# 1386|-> FIRST_DEVICE="$DEVICES"
# 1387|   
# 1388|   if [[ -z "$FIRST_DEVICE" ]]; then

Error: GCC_ANALYZER_WARNING (CWE-401): [#def14]
LVM2.2.03.38/daemons/dmeventd/dmeventd.c:129:9: warning[-Wanalyzer-malloc-leak]: leak of ‘message_data.id’
LVM2.2.03.38/daemons/dmeventd/dmeventd.c:2128:12: enter_function: entry to ‘_do_process_request’
LVM2.2.03.38/daemons/dmeventd/dmeventd.c:2135:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/daemons/dmeventd/dmeventd.c:2144:19: branch_false: ...to here
LVM2.2.03.38/daemons/dmeventd/dmeventd.c:2144:19: branch_true: following ‘true’ branch...
LVM2.2.03.38/daemons/dmeventd/dmeventd.c:2144:56: branch_true: ...to here
LVM2.2.03.38/daemons/dmeventd/dmeventd.c:2144:56: call_function: calling ‘_parse_message’ from ‘_do_process_request’
#  127|   	va_list ap;
#  128|   	va_start(ap, format);
#  129|-> 	dm_event_log("dmeventd", level, file, line, dm_errno_or_class, format, ap);
#  130|   	va_end(ap);
#  131|   }

Error: GCC_ANALYZER_WARNING (CWE-404): [#def15]
LVM2.2.03.38/daemons/dmeventd/dmeventd.c:129:9: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
LVM2.2.03.38/daemons/dmeventd/dmeventd.c:367:12: enter_function: entry to ‘_lookup_symbol’
LVM2.2.03.38/daemons/dmeventd/dmeventd.c:370:17: call_function: calling ‘_dmeventd_log’ from ‘_lookup_symbol’
#  127|   	va_list ap;
#  128|   	va_start(ap, format);
#  129|-> 	dm_event_log("dmeventd", level, file, line, dm_errno_or_class, format, ap);
#  130|   	va_end(ap);
#  131|   }

Error: GCC_ANALYZER_WARNING (CWE-775): [#def16]
LVM2.2.03.38/daemons/dmeventd/dmeventd.c:2308:13: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(oom_adj_path, "w")’
LVM2.2.03.38/daemons/dmeventd/dmeventd.c:2301:20: acquire_resource: opened here
LVM2.2.03.38/daemons/dmeventd/dmeventd.c:2301:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/daemons/dmeventd/dmeventd.c:2306:9: branch_false: ...to here
LVM2.2.03.38/daemons/dmeventd/dmeventd.c:2308:13: danger: ‘fopen(oom_adj_path, "w")’ leaks here; was opened at [(1)](sarif:/runs/0/results/4/codeFlows/0/threadFlows/0/locations/0)
# 2306|   	fprintf(fp, "%i", val);
# 2307|   
# 2308|-> 	if (dm_fclose(fp))
# 2309|   		log_sys_debug("fclose", oom_adj_path);
# 2310|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def17]
LVM2.2.03.38/daemons/dmeventd/dmeventd.c:2308:13: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(oom_adj_path, "w")’
LVM2.2.03.38/daemons/dmeventd/dmeventd.c:2301:20: acquire_memory: allocated here
LVM2.2.03.38/daemons/dmeventd/dmeventd.c:2301:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/daemons/dmeventd/dmeventd.c:2306:9: branch_false: ...to here
LVM2.2.03.38/daemons/dmeventd/dmeventd.c:2308:13: danger: ‘fopen(oom_adj_path, "w")’ leaks here; was allocated at [(1)](sarif:/runs/0/results/5/codeFlows/0/threadFlows/0/locations/0)
# 2306|   	fprintf(fp, "%i", val);
# 2307|   
# 2308|-> 	if (dm_fclose(fp))
# 2309|   		log_sys_debug("fclose", oom_adj_path);
# 2310|   

Error: GCC_ANALYZER_WARNING (CWE-131): [#def18]
LVM2.2.03.38/daemons/dmeventd/libdevmapper-event.c:294:28: warning[-Wanalyzer-allocation-size]: allocated buffer size is not a multiple of the pointee's size
#  292|   	size_t bytes = 0;
#  293|   	size_t size = 2 * sizeof(uint32_t) + msg->size;
#  294|-> 	uint32_t *header = alloca(size);
#  295|   	char *buf = (char *)header;
#  296|   	char drainbuf[128];

Error: GCC_ANALYZER_WARNING (CWE-404): [#def19]
LVM2.2.03.38/daemons/dmeventd/plugins/lvm2/dmeventd_lvm.c:43:1: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
LVM2.2.03.38/daemons/dmeventd/plugins/lvm2/dmeventd_lvm.c:43:1: acquire_resource: ‘va_start’ called here
LVM2.2.03.38/daemons/dmeventd/plugins/lvm2/dmeventd_lvm.c:43:1: throw: if ‘dm_event_log’ throws an exception...
LVM2.2.03.38/daemons/dmeventd/plugins/lvm2/dmeventd_lvm.c:43:1: danger: missing call to ‘va_end’ to match ‘va_start’ at [(1)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/0)
#   41|   };
#   42|   
#   43|-> DM_EVENT_LOG_FN("#lvm")
#   44|   
#   45|   static void _lvm2_print_log(int level, const char *file, int line,

Error: GCC_ANALYZER_WARNING (CWE-404): [#def20]
LVM2.2.03.38/daemons/dmeventd/plugins/mirror/dmeventd_mirror.c:31:1: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
LVM2.2.03.38/daemons/dmeventd/plugins/mirror/dmeventd_mirror.c:168:5: enter_function: entry to ‘register_device’
LVM2.2.03.38/daemons/dmeventd/plugins/mirror/dmeventd_mirror.c:177:17: call_function: calling ‘print_log’ from ‘register_device’
#   29|   };
#   30|   
#   31|-> DM_EVENT_LOG_FN("mirr")
#   32|   
#   33|   static void _process_status_code(dm_status_mirror_health_t health,

Error: GCC_ANALYZER_WARNING (CWE-404): [#def21]
LVM2.2.03.38/daemons/dmeventd/plugins/raid/dmeventd_raid.c:31:1: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
LVM2.2.03.38/daemons/dmeventd/plugins/raid/dmeventd_raid.c:31:1: acquire_resource: ‘va_start’ called here
LVM2.2.03.38/daemons/dmeventd/plugins/raid/dmeventd_raid.c:31:1: throw: if ‘dm_event_log’ throws an exception...
LVM2.2.03.38/daemons/dmeventd/plugins/raid/dmeventd_raid.c:31:1: danger: missing call to ‘va_end’ to match ‘va_start’ at [(1)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/0)
#   29|   };
#   30|   
#   31|-> DM_EVENT_LOG_FN("raid")
#   32|   
#   33|   /* FIXME Reformat to 80 char lines. */

Error: GCC_ANALYZER_WARNING (CWE-404): [#def22]
LVM2.2.03.38/daemons/dmeventd/plugins/snapshot/dmeventd_snapshot.c:40:1: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
LVM2.2.03.38/daemons/dmeventd/plugins/snapshot/dmeventd_snapshot.c:40:1: acquire_resource: ‘va_start’ called here
LVM2.2.03.38/daemons/dmeventd/plugins/snapshot/dmeventd_snapshot.c:40:1: throw: if ‘dm_event_log’ throws an exception...
LVM2.2.03.38/daemons/dmeventd/plugins/snapshot/dmeventd_snapshot.c:40:1: danger: missing call to ‘va_end’ to match ‘va_start’ at [(1)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/0)
#   38|   };
#   39|   
#   40|-> DM_EVENT_LOG_FN("snap")
#   41|   
#   42|   static int _run(const char *cmd, ...)

Error: GCC_ANALYZER_WARNING (CWE-775): [#def23]
LVM2.2.03.38/daemons/dmeventd/plugins/snapshot/dmeventd_snapshot.c:144:21: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(&procmounts, "r")’
LVM2.2.03.38/daemons/dmeventd/plugins/snapshot/dmeventd_snapshot.c:132:24: acquire_resource: opened here
LVM2.2.03.38/daemons/dmeventd/plugins/snapshot/dmeventd_snapshot.c:132:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/daemons/dmeventd/plugins/snapshot/dmeventd_snapshot.c:132:12: branch_false: ...to here
LVM2.2.03.38/daemons/dmeventd/plugins/snapshot/dmeventd_snapshot.c:138:16: branch_true: following ‘true’ branch...
LVM2.2.03.38/daemons/dmeventd/plugins/snapshot/dmeventd_snapshot.c:140:22: branch_true: ...to here
LVM2.2.03.38/daemons/dmeventd/plugins/snapshot/dmeventd_snapshot.c:140:20: branch_false: following ‘false’ branch...
LVM2.2.03.38/daemons/dmeventd/plugins/snapshot/dmeventd_snapshot.c:144:21: branch_false: ...to here
LVM2.2.03.38/daemons/dmeventd/plugins/snapshot/dmeventd_snapshot.c:144:21: throw: if ‘dm_split_words’ throws an exception...
LVM2.2.03.38/daemons/dmeventd/plugins/snapshot/dmeventd_snapshot.c:144:21: danger: ‘fopen(&procmounts, "r")’ leaks here; was opened at [(1)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/0)
#  142|   
#  143|   		/* words[0] is the mount point and words[1] is the device path */
#  144|-> 		if (dm_split_words(buffer, 3, 0, words) < 2)
#  145|   			continue;
#  146|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def24]
LVM2.2.03.38/daemons/dmeventd/plugins/snapshot/dmeventd_snapshot.c:144:21: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(&procmounts, "r")’
LVM2.2.03.38/daemons/dmeventd/plugins/snapshot/dmeventd_snapshot.c:132:24: acquire_memory: allocated here
LVM2.2.03.38/daemons/dmeventd/plugins/snapshot/dmeventd_snapshot.c:132:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/daemons/dmeventd/plugins/snapshot/dmeventd_snapshot.c:132:12: branch_false: ...to here
LVM2.2.03.38/daemons/dmeventd/plugins/snapshot/dmeventd_snapshot.c:138:16: branch_true: following ‘true’ branch...
LVM2.2.03.38/daemons/dmeventd/plugins/snapshot/dmeventd_snapshot.c:140:22: branch_true: ...to here
LVM2.2.03.38/daemons/dmeventd/plugins/snapshot/dmeventd_snapshot.c:140:20: branch_false: following ‘false’ branch...
LVM2.2.03.38/daemons/dmeventd/plugins/snapshot/dmeventd_snapshot.c:144:21: branch_false: ...to here
LVM2.2.03.38/daemons/dmeventd/plugins/snapshot/dmeventd_snapshot.c:144:21: throw: if ‘dm_split_words’ throws an exception...
LVM2.2.03.38/daemons/dmeventd/plugins/snapshot/dmeventd_snapshot.c:144:21: danger: ‘fopen(&procmounts, "r")’ leaks here; was allocated at [(1)](sarif:/runs/0/results/2/codeFlows/0/threadFlows/0/locations/0)
#  142|   
#  143|   		/* words[0] is the mount point and words[1] is the device path */
#  144|-> 		if (dm_split_words(buffer, 3, 0, words) < 2)
#  145|   			continue;
#  146|   

Error: GCC_ANALYZER_WARNING (CWE-775): [#def25]
LVM2.2.03.38/daemons/dmeventd/plugins/snapshot/dmeventd_snapshot.c:148:26: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(&procmounts, "r")’
LVM2.2.03.38/daemons/dmeventd/plugins/snapshot/dmeventd_snapshot.c:132:24: acquire_resource: opened here
LVM2.2.03.38/daemons/dmeventd/plugins/snapshot/dmeventd_snapshot.c:132:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/daemons/dmeventd/plugins/snapshot/dmeventd_snapshot.c:132:12: branch_false: ...to here
LVM2.2.03.38/daemons/dmeventd/plugins/snapshot/dmeventd_snapshot.c:138:16: branch_true: following ‘true’ branch...
LVM2.2.03.38/daemons/dmeventd/plugins/snapshot/dmeventd_snapshot.c:140:22: branch_true: ...to here
LVM2.2.03.38/daemons/dmeventd/plugins/snapshot/dmeventd_snapshot.c:140:20: branch_false: following ‘false’ branch...
LVM2.2.03.38/daemons/dmeventd/plugins/snapshot/dmeventd_snapshot.c:144:21: branch_false: ...to here
LVM2.2.03.38/daemons/dmeventd/plugins/snapshot/dmeventd_snapshot.c:138:16: branch_true: following ‘true’ branch...
LVM2.2.03.38/daemons/dmeventd/plugins/snapshot/dmeventd_snapshot.c:140:22: branch_true: ...to here
LVM2.2.03.38/daemons/dmeventd/plugins/snapshot/dmeventd_snapshot.c:140:20: branch_false: following ‘false’ branch...
LVM2.2.03.38/daemons/dmeventd/plugins/snapshot/dmeventd_snapshot.c:144:21: branch_false: ...to here
LVM2.2.03.38/daemons/dmeventd/plugins/snapshot/dmeventd_snapshot.c:144:21: throw: if ‘dm_split_words’ throws an exception...
LVM2.2.03.38/daemons/dmeventd/plugins/snapshot/dmeventd_snapshot.c:148:26: danger: ‘fopen(&procmounts, "r")’ leaks here; was opened at [(1)](sarif:/runs/0/results/3/codeFlows/0/threadFlows/0/locations/0)
#  146|   
#  147|   		/* find the major/minor of the device */
#  148|-> 		if (stat(words[0], &st))
#  149|   			continue; /* can't stat, skip this one */
#  150|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def26]
LVM2.2.03.38/daemons/dmeventd/plugins/snapshot/dmeventd_snapshot.c:148:26: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(&procmounts, "r")’
LVM2.2.03.38/daemons/dmeventd/plugins/snapshot/dmeventd_snapshot.c:132:24: acquire_memory: allocated here
LVM2.2.03.38/daemons/dmeventd/plugins/snapshot/dmeventd_snapshot.c:132:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/daemons/dmeventd/plugins/snapshot/dmeventd_snapshot.c:132:12: branch_false: ...to here
LVM2.2.03.38/daemons/dmeventd/plugins/snapshot/dmeventd_snapshot.c:138:16: branch_true: following ‘true’ branch...
LVM2.2.03.38/daemons/dmeventd/plugins/snapshot/dmeventd_snapshot.c:140:22: branch_true: ...to here
LVM2.2.03.38/daemons/dmeventd/plugins/snapshot/dmeventd_snapshot.c:140:20: branch_false: following ‘false’ branch...
LVM2.2.03.38/daemons/dmeventd/plugins/snapshot/dmeventd_snapshot.c:144:21: branch_false: ...to here
LVM2.2.03.38/daemons/dmeventd/plugins/snapshot/dmeventd_snapshot.c:138:16: branch_true: following ‘true’ branch...
LVM2.2.03.38/daemons/dmeventd/plugins/snapshot/dmeventd_snapshot.c:140:22: branch_true: ...to here
LVM2.2.03.38/daemons/dmeventd/plugins/snapshot/dmeventd_snapshot.c:140:20: branch_false: following ‘false’ branch...
LVM2.2.03.38/daemons/dmeventd/plugins/snapshot/dmeventd_snapshot.c:144:21: branch_false: ...to here
LVM2.2.03.38/daemons/dmeventd/plugins/snapshot/dmeventd_snapshot.c:144:21: throw: if ‘dm_split_words’ throws an exception...
LVM2.2.03.38/daemons/dmeventd/plugins/snapshot/dmeventd_snapshot.c:148:26: danger: ‘fopen(&procmounts, "r")’ leaks here; was allocated at [(1)](sarif:/runs/0/results/4/codeFlows/0/threadFlows/0/locations/0)
#  146|   
#  147|   		/* find the major/minor of the device */
#  148|-> 		if (stat(words[0], &st))
#  149|   			continue; /* can't stat, skip this one */
#  150|   

Error: GCC_ANALYZER_WARNING (CWE-404): [#def27]
LVM2.2.03.38/daemons/dmeventd/plugins/thin/dmeventd_thin.c:63:1: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
LVM2.2.03.38/daemons/dmeventd/plugins/thin/dmeventd_thin.c:63:1: acquire_resource: ‘va_start’ called here
LVM2.2.03.38/daemons/dmeventd/plugins/thin/dmeventd_thin.c:63:1: throw: if ‘dm_event_log’ throws an exception...
LVM2.2.03.38/daemons/dmeventd/plugins/thin/dmeventd_thin.c:63:1: danger: missing call to ‘va_end’ to match ‘va_start’ at [(1)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/0)
#   61|   };
#   62|   
#   63|-> DM_EVENT_LOG_FN("thin")
#   64|   
#   65|   static int _run_command(struct dso_state *state)

Error: GCC_ANALYZER_WARNING (CWE-404): [#def28]
LVM2.2.03.38/daemons/dmeventd/plugins/vdo/dmeventd_vdo.c:57:1: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
LVM2.2.03.38/daemons/dmeventd/plugins/vdo/dmeventd_vdo.c:57:1: acquire_resource: ‘va_start’ called here
LVM2.2.03.38/daemons/dmeventd/plugins/vdo/dmeventd_vdo.c:57:1: throw: if ‘dm_event_log’ throws an exception...
LVM2.2.03.38/daemons/dmeventd/plugins/vdo/dmeventd_vdo.c:57:1: danger: missing call to ‘va_end’ to match ‘va_start’ at [(1)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/0)
#   55|   };
#   56|   
#   57|-> DM_EVENT_LOG_FN("vdo")
#   58|   
#   59|   static int _run_command(struct dso_state *state)

Error: GCC_ANALYZER_WARNING (CWE-686): [#def29]
LVM2.2.03.38/daemons/lvmlockd/lvmlockctl.c:123:38: warning[-Wanalyzer-va-arg-type-mismatch]: ‘va_arg’ expected ‘int *’ but received ‘long unsigned int’ for variadic argument 1 of ‘args’
LVM2.2.03.38/daemons/lvmlockd/lvmlockctl.c:698:12: enter_function: entry to ‘do_dump’
LVM2.2.03.38/daemons/lvmlockd/lvmlockctl.c:705:14: call_function: calling ‘setup_dump_socket’ from ‘do_dump’
LVM2.2.03.38/daemons/lvmlockd/lvmlockctl.c:705:14: return_function: returning to ‘do_dump’ from ‘setup_dump_socket’
LVM2.2.03.38/daemons/lvmlockd/lvmlockctl.c:706:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/daemons/lvmlockd/lvmlockctl.c:711:17: branch_false: ...to here
LVM2.2.03.38/daemons/lvmlockd/lvmlockctl.c:713:12: branch_false: following ‘false’ branch (when ‘<unknown> == 0’)...
LVM2.2.03.38/daemons/lvmlockd/lvmlockctl.c:713:12: branch_false: ...to here
LVM2.2.03.38/daemons/lvmlockd/lvmlockctl.c:729:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/daemons/lvmlockd/lvmlockctl.c:732:9: branch_false: ...to here
LVM2.2.03.38/daemons/lvmlockd/lvmlockctl.c:737:12: branch_false: following ‘false’ branch (when ‘rv >= 0’)...
LVM2.2.03.38/daemons/lvmlockd/lvmlockctl.c:742:9: branch_false: ...to here
LVM2.2.03.38/daemons/lvmlockd/lvmlockctl.c:749:13: branch_false: following ‘false’ branch (when the strings are non-equal)...
LVM2.2.03.38/daemons/lvmlockd/lvmlockctl.c:752:17: branch_false: ...to here
LVM2.2.03.38/daemons/lvmlockd/lvmlockctl.c:752:17: call_function: calling ‘format_info’ from ‘do_dump’
#  121|   				 * read an int (%d)
#  122|   				 */
#  123|-> 				int *dest = va_arg(args, int *);
#  124|   
#  125|   				if (sscanf(in, "%d%n", dest, &n) == 1) {

Error: GCC_ANALYZER_WARNING (CWE-686): [#def30]
LVM2.2.03.38/daemons/lvmlockd/lvmlockctl.c:137:47: warning[-Wanalyzer-va-arg-type-mismatch]: ‘va_arg’ expected ‘unsigned int *’ but received ‘long unsigned int’ for variadic argument 1 of ‘args’
LVM2.2.03.38/daemons/lvmlockd/lvmlockctl.c:698:12: enter_function: entry to ‘do_dump’
LVM2.2.03.38/daemons/lvmlockd/lvmlockctl.c:705:14: call_function: calling ‘setup_dump_socket’ from ‘do_dump’
LVM2.2.03.38/daemons/lvmlockd/lvmlockctl.c:705:14: return_function: returning to ‘do_dump’ from ‘setup_dump_socket’
LVM2.2.03.38/daemons/lvmlockd/lvmlockctl.c:706:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/daemons/lvmlockd/lvmlockctl.c:711:17: branch_false: ...to here
LVM2.2.03.38/daemons/lvmlockd/lvmlockctl.c:713:12: branch_false: following ‘false’ branch (when ‘<unknown> == 0’)...
LVM2.2.03.38/daemons/lvmlockd/lvmlockctl.c:713:12: branch_false: ...to here
LVM2.2.03.38/daemons/lvmlockd/lvmlockctl.c:729:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/daemons/lvmlockd/lvmlockctl.c:732:9: branch_false: ...to here
LVM2.2.03.38/daemons/lvmlockd/lvmlockctl.c:737:12: branch_false: following ‘false’ branch (when ‘rv >= 0’)...
LVM2.2.03.38/daemons/lvmlockd/lvmlockctl.c:742:9: branch_false: ...to here
LVM2.2.03.38/daemons/lvmlockd/lvmlockctl.c:749:13: branch_false: following ‘false’ branch (when the strings are non-equal)...
LVM2.2.03.38/daemons/lvmlockd/lvmlockctl.c:752:17: branch_false: ...to here
LVM2.2.03.38/daemons/lvmlockd/lvmlockctl.c:752:17: call_function: calling ‘format_info’ from ‘do_dump’
#  135|   				 * read an unsigned int (%u)
#  136|   				 */
#  137|-> 				unsigned int *dest = va_arg(args, unsigned int *);
#  138|   
#  139|   				if (sscanf(in, "%u%n", dest, &n) == 1) {

Error: GCC_ANALYZER_WARNING (CWE-404): [#def31]
LVM2.2.03.38/daemons/lvmlockd/lvmlockctl.c:618:9: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
LVM2.2.03.38/daemons/lvmlockd/lvmlockctl.c:759:12: enter_function: entry to ‘do_able’
LVM2.2.03.38/daemons/lvmlockd/lvmlockctl.c:765:17: call_function: calling ‘_lvmlockd_send’ from ‘do_able’
#  616|   
#  617|   	va_start(ap, req_name);
#  618|-> 	daemon_request_extend_v(req, ap);
#  619|   	va_end(ap);
#  620|   

Error: GCC_ANALYZER_WARNING (CWE-775): [#def32]
LVM2.2.03.38/daemons/lvmlockd/lvmlockctl.c:818:24: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘pipefd[(int)pid]’
LVM2.2.03.38/daemons/lvmlockd/lvmlockctl.c:1065:12: enter_function: entry to ‘_run_kill_command’
LVM2.2.03.38/daemons/lvmlockd/lvmlockctl.c:1071:9: call_function: calling ‘_run_command_pipe’ from ‘_run_kill_command’
#  816|   	int r = 0;
#  817|   
#  818|-> 	if ((null_fd = open("/dev/null", O_RDWR)) == -1) {
#  819|   		log_error("open error /dev/null %d", errno);
#  820|   		return 0;

Error: GCC_ANALYZER_WARNING (CWE-775): [#def33]
LVM2.2.03.38/daemons/lvmlockd/lvmlockctl.c:818:24: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘pipefd[0]’
LVM2.2.03.38/daemons/lvmlockd/lvmlockctl.c:846:13: enter_function: entry to ‘_run_command_pipe’
LVM2.2.03.38/daemons/lvmlockd/lvmlockctl.c:859:21: branch_true: following ‘true’ branch (when ‘i != 33’)...
LVM2.2.03.38/daemons/lvmlockd/lvmlockctl.c:860:17: branch_true: ...to here
LVM2.2.03.38/daemons/lvmlockd/lvmlockctl.c:907:12: branch_false: following ‘false’ branch (when ‘arg_len == 0’)...
LVM2.2.03.38/daemons/lvmlockd/lvmlockctl.c:915:13: branch_false: ...to here
LVM2.2.03.38/daemons/lvmlockd/lvmlockctl.c:915:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/daemons/lvmlockd/lvmlockctl.c:920:15: branch_false: ...to here
LVM2.2.03.38/daemons/lvmlockd/lvmlockctl.c:922:12: branch_false: following ‘false’ branch (when ‘pid >= 0’)...
LVM2.2.03.38/daemons/lvmlockd/lvmlockctl.c:928:12: branch_false: ...to here
LVM2.2.03.38/daemons/lvmlockd/lvmlockctl.c:928:12: branch_true: following ‘true’ branch (when ‘pid == 0’)...
LVM2.2.03.38/daemons/lvmlockd/lvmlockctl.c:930:22: branch_true: ...to here
LVM2.2.03.38/daemons/lvmlockd/lvmlockctl.c:930:22: call_function: calling ‘_reopen_fd_to_null’ from ‘_run_command_pipe’
#  816|   	int r = 0;
#  817|   
#  818|-> 	if ((null_fd = open("/dev/null", O_RDWR)) == -1) {
#  819|   		log_error("open error /dev/null %d", errno);
#  820|   		return 0;

Error: GCC_ANALYZER_WARNING (CWE-775): [#def34]
LVM2.2.03.38/daemons/lvmlockd/lvmlockctl.c:818:24: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘pipefd[1]’
LVM2.2.03.38/daemons/lvmlockd/lvmlockctl.c:846:13: enter_function: entry to ‘_run_command_pipe’
LVM2.2.03.38/daemons/lvmlockd/lvmlockctl.c:859:21: branch_true: following ‘true’ branch (when ‘i != 33’)...
LVM2.2.03.38/daemons/lvmlockd/lvmlockctl.c:860:17: branch_true: ...to here
LVM2.2.03.38/daemons/lvmlockd/lvmlockctl.c:907:12: branch_false: following ‘false’ branch (when ‘arg_len == 0’)...
LVM2.2.03.38/daemons/lvmlockd/lvmlockctl.c:915:13: branch_false: ...to here
LVM2.2.03.38/daemons/lvmlockd/lvmlockctl.c:915:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/daemons/lvmlockd/lvmlockctl.c:920:15: branch_false: ...to here
LVM2.2.03.38/daemons/lvmlockd/lvmlockctl.c:922:12: branch_false: following ‘false’ branch (when ‘pid >= 0’)...
LVM2.2.03.38/daemons/lvmlockd/lvmlockctl.c:928:12: branch_false: ...to here
LVM2.2.03.38/daemons/lvmlockd/lvmlockctl.c:928:12: branch_true: following ‘true’ branch (when ‘pid == 0’)...
LVM2.2.03.38/daemons/lvmlockd/lvmlockctl.c:930:22: branch_true: ...to here
LVM2.2.03.38/daemons/lvmlockd/lvmlockctl.c:930:22: call_function: calling ‘_reopen_fd_to_null’ from ‘_run_command_pipe’
#  816|   	int r = 0;
#  817|   
#  818|-> 	if ((null_fd = open("/dev/null", O_RDWR)) == -1) {
#  819|   		log_error("open error /dev/null %d", errno);
#  820|   		return 0;

Error: GCC_ANALYZER_WARNING (CWE-775): [#def35]
LVM2.2.03.38/daemons/lvmlockd/lvmlockctl.c:823:13: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘open("/dev/null", 2)’
LVM2.2.03.38/daemons/lvmlockd/lvmlockctl.c:818:24: acquire_resource: opened here
LVM2.2.03.38/daemons/lvmlockd/lvmlockctl.c:818:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/daemons/lvmlockd/lvmlockctl.c:823:13: branch_false: ...to here
LVM2.2.03.38/daemons/lvmlockd/lvmlockctl.c:823:13: throw: if ‘close’ throws an exception...
LVM2.2.03.38/daemons/lvmlockd/lvmlockctl.c:823:13: danger: ‘open("/dev/null", 2)’ leaks here; was opened at [(1)](sarif:/runs/0/results/11/codeFlows/0/threadFlows/0/locations/0)
#  821|   	}
#  822|   
#  823|-> 	if (close(fd)) {
#  824|   		log_error("close error fd %d %d", fd, errno);
#  825|   		goto out;

Error: GCC_ANALYZER_WARNING (CWE-775): [#def36]
LVM2.2.03.38/daemons/lvmlockd/lvmlockctl.c:823:13: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘pipefd[(int)pid]’
LVM2.2.03.38/daemons/lvmlockd/lvmlockctl.c:1065:12: enter_function: entry to ‘_run_kill_command’
LVM2.2.03.38/daemons/lvmlockd/lvmlockctl.c:1071:9: call_function: calling ‘_run_command_pipe’ from ‘_run_kill_command’
#  821|   	}
#  822|   
#  823|-> 	if (close(fd)) {
#  824|   		log_error("close error fd %d %d", fd, errno);
#  825|   		goto out;

Error: GCC_ANALYZER_WARNING (CWE-775): [#def37]
LVM2.2.03.38/daemons/lvmlockd/lvmlockctl.c:823:13: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘pipefd[0]’
LVM2.2.03.38/daemons/lvmlockd/lvmlockctl.c:846:13: enter_function: entry to ‘_run_command_pipe’
LVM2.2.03.38/daemons/lvmlockd/lvmlockctl.c:859:21: branch_true: following ‘true’ branch (when ‘i != 33’)...
LVM2.2.03.38/daemons/lvmlockd/lvmlockctl.c:860:17: branch_true: ...to here
LVM2.2.03.38/daemons/lvmlockd/lvmlockctl.c:907:12: branch_false: following ‘false’ branch (when ‘arg_len == 0’)...
LVM2.2.03.38/daemons/lvmlockd/lvmlockctl.c:915:13: branch_false: ...to here
LVM2.2.03.38/daemons/lvmlockd/lvmlockctl.c:915:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/daemons/lvmlockd/lvmlockctl.c:920:15: branch_false: ...to here
LVM2.2.03.38/daemons/lvmlockd/lvmlockctl.c:922:12: branch_false: following ‘false’ branch (when ‘pid >= 0’)...
LVM2.2.03.38/daemons/lvmlockd/lvmlockctl.c:928:12: branch_false: ...to here
LVM2.2.03.38/daemons/lvmlockd/lvmlockctl.c:928:12: branch_true: following ‘true’ branch (when ‘pid == 0’)...
LVM2.2.03.38/daemons/lvmlockd/lvmlockctl.c:930:22: branch_true: ...to here
LVM2.2.03.38/daemons/lvmlockd/lvmlockctl.c:930:22: call_function: calling ‘_reopen_fd_to_null’ from ‘_run_command_pipe’
#  821|   	}
#  822|   
#  823|-> 	if (close(fd)) {
#  824|   		log_error("close error fd %d %d", fd, errno);
#  825|   		goto out;

Error: GCC_ANALYZER_WARNING (CWE-775): [#def38]
LVM2.2.03.38/daemons/lvmlockd/lvmlockctl.c:823:13: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘pipefd[1]’
LVM2.2.03.38/daemons/lvmlockd/lvmlockctl.c:846:13: enter_function: entry to ‘_run_command_pipe’
LVM2.2.03.38/daemons/lvmlockd/lvmlockctl.c:859:21: branch_true: following ‘true’ branch (when ‘i != 33’)...
LVM2.2.03.38/daemons/lvmlockd/lvmlockctl.c:860:17: branch_true: ...to here
LVM2.2.03.38/daemons/lvmlockd/lvmlockctl.c:907:12: branch_false: following ‘false’ branch (when ‘arg_len == 0’)...
LVM2.2.03.38/daemons/lvmlockd/lvmlockctl.c:915:13: branch_false: ...to here
LVM2.2.03.38/daemons/lvmlockd/lvmlockctl.c:915:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/daemons/lvmlockd/lvmlockctl.c:920:15: branch_false: ...to here
LVM2.2.03.38/daemons/lvmlockd/lvmlockctl.c:922:12: branch_false: following ‘false’ branch (when ‘pid >= 0’)...
LVM2.2.03.38/daemons/lvmlockd/lvmlockctl.c:928:12: branch_false: ...to here
LVM2.2.03.38/daemons/lvmlockd/lvmlockctl.c:928:12: branch_true: following ‘true’ branch (when ‘pid == 0’)...
LVM2.2.03.38/daemons/lvmlockd/lvmlockctl.c:930:22: branch_true: ...to here
LVM2.2.03.38/daemons/lvmlockd/lvmlockctl.c:930:22: call_function: calling ‘_reopen_fd_to_null’ from ‘_run_command_pipe’
#  821|   	}
#  822|   
#  823|-> 	if (close(fd)) {
#  824|   		log_error("close error fd %d %d", fd, errno);
#  825|   		goto out;

Error: GCC_ANALYZER_WARNING: [#def39]
LVM2.2.03.38/daemons/lvmlockd/lvmlockctl.c:828:13: warning[-Wanalyzer-fd-use-without-check]: ‘dup2’ on possibly invalid file descriptor ‘fd’
LVM2.2.03.38/daemons/lvmlockd/lvmlockctl.c:818:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/daemons/lvmlockd/lvmlockctl.c:823:13: branch_false: ...to here
LVM2.2.03.38/daemons/lvmlockd/lvmlockctl.c:823:13: release_resource: closed here
LVM2.2.03.38/daemons/lvmlockd/lvmlockctl.c:823:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/daemons/lvmlockd/lvmlockctl.c:828:13: branch_false: ...to here
LVM2.2.03.38/daemons/lvmlockd/lvmlockctl.c:828:13: danger: ‘fd’ could be invalid
#  826|   	}
#  827|   
#  828|-> 	if (dup2(null_fd, fd) == -1) {
#  829|   		log_error("dup2 error %d", errno);
#  830|   		goto out;

Error: GCC_ANALYZER_WARNING (CWE-775): [#def40]
LVM2.2.03.38/daemons/lvmlockd/lvmlockctl.c:835:13: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘open("/dev/null", 2)’
LVM2.2.03.38/daemons/lvmlockd/lvmlockctl.c:818:24: acquire_resource: opened here
LVM2.2.03.38/daemons/lvmlockd/lvmlockctl.c:818:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/daemons/lvmlockd/lvmlockctl.c:823:13: branch_false: ...to here
LVM2.2.03.38/daemons/lvmlockd/lvmlockctl.c:835:13: throw: if ‘close’ throws an exception...
LVM2.2.03.38/daemons/lvmlockd/lvmlockctl.c:835:13: danger: ‘open("/dev/null", 2)’ leaks here; was opened at [(1)](sarif:/runs/0/results/17/codeFlows/0/threadFlows/0/locations/0)
#  833|   	r = 1;
#  834|   out:
#  835|-> 	if (close(null_fd)) {
#  836|   		log_error("close error fd %d %d", null_fd, errno);
#  837|   		return 0;

Error: GCC_ANALYZER_WARNING (CWE-775): [#def41]
LVM2.2.03.38/daemons/lvmlockd/lvmlockctl.c:835:13: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘pipefd[(int)pid]’
LVM2.2.03.38/daemons/lvmlockd/lvmlockctl.c:1065:12: enter_function: entry to ‘_run_kill_command’
LVM2.2.03.38/daemons/lvmlockd/lvmlockctl.c:1071:9: call_function: calling ‘_run_command_pipe’ from ‘_run_kill_command’
#  833|   	r = 1;
#  834|   out:
#  835|-> 	if (close(null_fd)) {
#  836|   		log_error("close error fd %d %d", null_fd, errno);
#  837|   		return 0;

Error: GCC_ANALYZER_WARNING (CWE-775): [#def42]
LVM2.2.03.38/daemons/lvmlockd/lvmlockctl.c:835:13: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘pipefd[0]’
LVM2.2.03.38/daemons/lvmlockd/lvmlockctl.c:846:13: enter_function: entry to ‘_run_command_pipe’
LVM2.2.03.38/daemons/lvmlockd/lvmlockctl.c:859:21: branch_true: following ‘true’ branch (when ‘i != 33’)...
LVM2.2.03.38/daemons/lvmlockd/lvmlockctl.c:860:17: branch_true: ...to here
LVM2.2.03.38/daemons/lvmlockd/lvmlockctl.c:907:12: branch_false: following ‘false’ branch (when ‘arg_len == 0’)...
LVM2.2.03.38/daemons/lvmlockd/lvmlockctl.c:915:13: branch_false: ...to here
LVM2.2.03.38/daemons/lvmlockd/lvmlockctl.c:915:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/daemons/lvmlockd/lvmlockctl.c:920:15: branch_false: ...to here
LVM2.2.03.38/daemons/lvmlockd/lvmlockctl.c:922:12: branch_false: following ‘false’ branch (when ‘pid >= 0’)...
LVM2.2.03.38/daemons/lvmlockd/lvmlockctl.c:928:12: branch_false: ...to here
LVM2.2.03.38/daemons/lvmlockd/lvmlockctl.c:928:12: branch_true: following ‘true’ branch (when ‘pid == 0’)...
LVM2.2.03.38/daemons/lvmlockd/lvmlockctl.c:930:22: branch_true: ...to here
LVM2.2.03.38/daemons/lvmlockd/lvmlockctl.c:930:22: call_function: calling ‘_reopen_fd_to_null’ from ‘_run_command_pipe’
#  833|   	r = 1;
#  834|   out:
#  835|-> 	if (close(null_fd)) {
#  836|   		log_error("close error fd %d %d", null_fd, errno);
#  837|   		return 0;

Error: GCC_ANALYZER_WARNING (CWE-775): [#def43]
LVM2.2.03.38/daemons/lvmlockd/lvmlockctl.c:835:13: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘pipefd[1]’
LVM2.2.03.38/daemons/lvmlockd/lvmlockctl.c:846:13: enter_function: entry to ‘_run_command_pipe’
LVM2.2.03.38/daemons/lvmlockd/lvmlockctl.c:859:21: branch_true: following ‘true’ branch (when ‘i != 33’)...
LVM2.2.03.38/daemons/lvmlockd/lvmlockctl.c:860:17: branch_true: ...to here
LVM2.2.03.38/daemons/lvmlockd/lvmlockctl.c:907:12: branch_false: following ‘false’ branch (when ‘arg_len == 0’)...
LVM2.2.03.38/daemons/lvmlockd/lvmlockctl.c:915:13: branch_false: ...to here
LVM2.2.03.38/daemons/lvmlockd/lvmlockctl.c:915:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/daemons/lvmlockd/lvmlockctl.c:920:15: branch_false: ...to here
LVM2.2.03.38/daemons/lvmlockd/lvmlockctl.c:922:12: branch_false: following ‘false’ branch (when ‘pid >= 0’)...
LVM2.2.03.38/daemons/lvmlockd/lvmlockctl.c:928:12: branch_false: ...to here
LVM2.2.03.38/daemons/lvmlockd/lvmlockctl.c:928:12: branch_true: following ‘true’ branch (when ‘pid == 0’)...
LVM2.2.03.38/daemons/lvmlockd/lvmlockctl.c:930:22: branch_true: ...to here
LVM2.2.03.38/daemons/lvmlockd/lvmlockctl.c:930:22: call_function: calling ‘_reopen_fd_to_null’ from ‘_run_command_pipe’
#  833|   	r = 1;
#  834|   out:
#  835|-> 	if (close(null_fd)) {
#  836|   		log_error("close error fd %d %d", null_fd, errno);
#  837|   		return 0;

Error: GCC_ANALYZER_WARNING (CWE-775): [#def44]
LVM2.2.03.38/daemons/lvmlockd/lvmlockctl.c:932:26: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘pipefd[(int)pid]’
LVM2.2.03.38/daemons/lvmlockd/lvmlockctl.c:1065:12: enter_function: entry to ‘_run_kill_command’
LVM2.2.03.38/daemons/lvmlockd/lvmlockctl.c:1071:9: call_function: calling ‘_run_command_pipe’ from ‘_run_kill_command’
#  930|   		if (!_reopen_fd_to_null(STDIN_FILENO))
#  931|   			log_error("reopen STDIN error");
#  932|-> 		else if (close(pipefd[0 /*read*/]))
#  933|   			log_error("close error pipe[0] %d", errno);
#  934|   		else if (close(STDOUT_FILENO))

Error: GCC_ANALYZER_WARNING (CWE-775): [#def45]
LVM2.2.03.38/daemons/lvmlockd/lvmlockctl.c:932:26: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘pipefd[0]’
LVM2.2.03.38/daemons/lvmlockd/lvmlockctl.c:846:13: enter_function: entry to ‘_run_command_pipe’
LVM2.2.03.38/daemons/lvmlockd/lvmlockctl.c:859:21: branch_true: following ‘true’ branch (when ‘i != 33’)...
LVM2.2.03.38/daemons/lvmlockd/lvmlockctl.c:860:17: branch_true: ...to here
LVM2.2.03.38/daemons/lvmlockd/lvmlockctl.c:907:12: branch_false: following ‘false’ branch (when ‘arg_len == 0’)...
LVM2.2.03.38/daemons/lvmlockd/lvmlockctl.c:915:13: branch_false: ...to here
LVM2.2.03.38/daemons/lvmlockd/lvmlockctl.c:915:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/daemons/lvmlockd/lvmlockctl.c:920:15: branch_false: ...to here
LVM2.2.03.38/daemons/lvmlockd/lvmlockctl.c:922:12: branch_false: following ‘false’ branch (when ‘pid >= 0’)...
LVM2.2.03.38/daemons/lvmlockd/lvmlockctl.c:928:12: branch_false: ...to here
LVM2.2.03.38/daemons/lvmlockd/lvmlockctl.c:928:12: branch_true: following ‘true’ branch (when ‘pid == 0’)...
LVM2.2.03.38/daemons/lvmlockd/lvmlockctl.c:930:22: branch_true: ...to here
LVM2.2.03.38/daemons/lvmlockd/lvmlockctl.c:930:22: call_function: calling ‘_reopen_fd_to_null’ from ‘_run_command_pipe’
LVM2.2.03.38/daemons/lvmlockd/lvmlockctl.c:930:22: return_function: returning to ‘_run_command_pipe’ from ‘_reopen_fd_to_null’
LVM2.2.03.38/daemons/lvmlockd/lvmlockctl.c:930:20: branch_false: following ‘false’ branch...
LVM2.2.03.38/daemons/lvmlockd/lvmlockctl.c:932:26: branch_false: ...to here
LVM2.2.03.38/daemons/lvmlockd/lvmlockctl.c:932:26: throw: if ‘close’ throws an exception...
LVM2.2.03.38/daemons/lvmlockd/lvmlockctl.c:932:26: danger: ‘pipefd[0]’ leaks here
#  930|   		if (!_reopen_fd_to_null(STDIN_FILENO))
#  931|   			log_error("reopen STDIN error");
#  932|-> 		else if (close(pipefd[0 /*read*/]))
#  933|   			log_error("close error pipe[0] %d", errno);
#  934|   		else if (close(STDOUT_FILENO))

Error: GCC_ANALYZER_WARNING (CWE-775): [#def46]
LVM2.2.03.38/daemons/lvmlockd/lvmlockctl.c:932:26: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘pipefd[1]’
LVM2.2.03.38/daemons/lvmlockd/lvmlockctl.c:846:13: enter_function: entry to ‘_run_command_pipe’
LVM2.2.03.38/daemons/lvmlockd/lvmlockctl.c:859:21: branch_true: following ‘true’ branch (when ‘i != 33’)...
LVM2.2.03.38/daemons/lvmlockd/lvmlockctl.c:860:17: branch_true: ...to here
LVM2.2.03.38/daemons/lvmlockd/lvmlockctl.c:907:12: branch_false: following ‘false’ branch (when ‘arg_len == 0’)...
LVM2.2.03.38/daemons/lvmlockd/lvmlockctl.c:915:13: branch_false: ...to here
LVM2.2.03.38/daemons/lvmlockd/lvmlockctl.c:915:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/daemons/lvmlockd/lvmlockctl.c:920:15: branch_false: ...to here
LVM2.2.03.38/daemons/lvmlockd/lvmlockctl.c:922:12: branch_false: following ‘false’ branch (when ‘pid >= 0’)...
LVM2.2.03.38/daemons/lvmlockd/lvmlockctl.c:928:12: branch_false: ...to here
LVM2.2.03.38/daemons/lvmlockd/lvmlockctl.c:928:12: branch_true: following ‘true’ branch (when ‘pid == 0’)...
LVM2.2.03.38/daemons/lvmlockd/lvmlockctl.c:930:22: branch_true: ...to here
LVM2.2.03.38/daemons/lvmlockd/lvmlockctl.c:930:22: call_function: calling ‘_reopen_fd_to_null’ from ‘_run_command_pipe’
LVM2.2.03.38/daemons/lvmlockd/lvmlockctl.c:930:22: return_function: returning to ‘_run_command_pipe’ from ‘_reopen_fd_to_null’
LVM2.2.03.38/daemons/lvmlockd/lvmlockctl.c:930:20: branch_false: following ‘false’ branch...
LVM2.2.03.38/daemons/lvmlockd/lvmlockctl.c:932:26: branch_false: ...to here
LVM2.2.03.38/daemons/lvmlockd/lvmlockctl.c:932:26: throw: if ‘close’ throws an exception...
LVM2.2.03.38/daemons/lvmlockd/lvmlockctl.c:932:26: danger: ‘pipefd[1]’ leaks here
#  930|   		if (!_reopen_fd_to_null(STDIN_FILENO))
#  931|   			log_error("reopen STDIN error");
#  932|-> 		else if (close(pipefd[0 /*read*/]))
#  933|   			log_error("close error pipe[0] %d", errno);
#  934|   		else if (close(STDOUT_FILENO))

Error: GCC_ANALYZER_WARNING (CWE-775): [#def47]
LVM2.2.03.38/daemons/lvmlockd/lvmlockctl.c:934:26: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘pipefd[1]’
LVM2.2.03.38/daemons/lvmlockd/lvmlockctl.c:846:13: enter_function: entry to ‘_run_command_pipe’
LVM2.2.03.38/daemons/lvmlockd/lvmlockctl.c:859:21: branch_true: following ‘true’ branch (when ‘i != 33’)...
LVM2.2.03.38/daemons/lvmlockd/lvmlockctl.c:860:17: branch_true: ...to here
LVM2.2.03.38/daemons/lvmlockd/lvmlockctl.c:907:12: branch_false: following ‘false’ branch (when ‘arg_len == 0’)...
LVM2.2.03.38/daemons/lvmlockd/lvmlockctl.c:915:13: branch_false: ...to here
LVM2.2.03.38/daemons/lvmlockd/lvmlockctl.c:915:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/daemons/lvmlockd/lvmlockctl.c:920:15: branch_false: ...to here
LVM2.2.03.38/daemons/lvmlockd/lvmlockctl.c:922:12: branch_false: following ‘false’ branch (when ‘pid >= 0’)...
LVM2.2.03.38/daemons/lvmlockd/lvmlockctl.c:928:12: branch_false: ...to here
LVM2.2.03.38/daemons/lvmlockd/lvmlockctl.c:928:12: branch_true: following ‘true’ branch (when ‘pid == 0’)...
LVM2.2.03.38/daemons/lvmlockd/lvmlockctl.c:930:22: branch_true: ...to here
LVM2.2.03.38/daemons/lvmlockd/lvmlockctl.c:930:22: call_function: calling ‘_reopen_fd_to_null’ from ‘_run_command_pipe’
LVM2.2.03.38/daemons/lvmlockd/lvmlockctl.c:930:22: return_function: returning to ‘_run_command_pipe’ from ‘_reopen_fd_to_null’
LVM2.2.03.38/daemons/lvmlockd/lvmlockctl.c:930:20: branch_false: following ‘false’ branch...
LVM2.2.03.38/daemons/lvmlockd/lvmlockctl.c:932:26: branch_false: ...to here
LVM2.2.03.38/daemons/lvmlockd/lvmlockctl.c:932:25: branch_false: following ‘false’ branch...
LVM2.2.03.38/daemons/lvmlockd/lvmlockctl.c:934:26: branch_false: ...to here
LVM2.2.03.38/daemons/lvmlockd/lvmlockctl.c:934:26: throw: if ‘close’ throws an exception...
LVM2.2.03.38/daemons/lvmlockd/lvmlockctl.c:934:26: danger: ‘pipefd[1]’ leaks here
#  932|   		else if (close(pipefd[0 /*read*/]))
#  933|   			log_error("close error pipe[0] %d", errno);
#  934|-> 		else if (close(STDOUT_FILENO))
#  935|   			log_error("close error STDOUT %d", errno);
#  936|   		else if (dup2(pipefd[1 /*write*/], STDOUT_FILENO) == -1)

Error: GCC_ANALYZER_WARNING: [#def48]
LVM2.2.03.38/daemons/lvmlockd/lvmlockctl.c:936:26: warning[-Wanalyzer-fd-use-without-check]: ‘dup2’ on possibly invalid file descriptor ‘1’
LVM2.2.03.38/daemons/lvmlockd/lvmlockctl.c:846:13: enter_function: entry to ‘_run_command_pipe’
LVM2.2.03.38/daemons/lvmlockd/lvmlockctl.c:859:21: branch_true: following ‘true’ branch (when ‘i != 33’)...
LVM2.2.03.38/daemons/lvmlockd/lvmlockctl.c:860:17: branch_true: ...to here
LVM2.2.03.38/daemons/lvmlockd/lvmlockctl.c:907:12: branch_false: following ‘false’ branch (when ‘arg_len == 0’)...
LVM2.2.03.38/daemons/lvmlockd/lvmlockctl.c:915:13: branch_false: ...to here
LVM2.2.03.38/daemons/lvmlockd/lvmlockctl.c:915:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/daemons/lvmlockd/lvmlockctl.c:920:15: branch_false: ...to here
LVM2.2.03.38/daemons/lvmlockd/lvmlockctl.c:922:12: branch_false: following ‘false’ branch (when ‘pid >= 0’)...
LVM2.2.03.38/daemons/lvmlockd/lvmlockctl.c:928:12: branch_false: ...to here
LVM2.2.03.38/daemons/lvmlockd/lvmlockctl.c:928:12: branch_true: following ‘true’ branch (when ‘pid == 0’)...
LVM2.2.03.38/daemons/lvmlockd/lvmlockctl.c:930:22: branch_true: ...to here
LVM2.2.03.38/daemons/lvmlockd/lvmlockctl.c:930:22: call_function: calling ‘_reopen_fd_to_null’ from ‘_run_command_pipe’
LVM2.2.03.38/daemons/lvmlockd/lvmlockctl.c:930:22: return_function: returning to ‘_run_command_pipe’ from ‘_reopen_fd_to_null’
LVM2.2.03.38/daemons/lvmlockd/lvmlockctl.c:930:20: branch_false: following ‘false’ branch...
LVM2.2.03.38/daemons/lvmlockd/lvmlockctl.c:932:26: branch_false: ...to here
LVM2.2.03.38/daemons/lvmlockd/lvmlockctl.c:932:25: branch_false: following ‘false’ branch...
LVM2.2.03.38/daemons/lvmlockd/lvmlockctl.c:934:26: branch_false: ...to here
LVM2.2.03.38/daemons/lvmlockd/lvmlockctl.c:934:26: release_resource: closed here
LVM2.2.03.38/daemons/lvmlockd/lvmlockctl.c:934:25: branch_false: following ‘false’ branch...
LVM2.2.03.38/daemons/lvmlockd/lvmlockctl.c:936:26: branch_false: ...to here
LVM2.2.03.38/daemons/lvmlockd/lvmlockctl.c:936:26: danger: ‘1’ could be invalid
#  934|   		else if (close(STDOUT_FILENO))
#  935|   			log_error("close error STDOUT %d", errno);
#  936|-> 		else if (dup2(pipefd[1 /*write*/], STDOUT_FILENO) == -1)
#  937|   			log_error("dup2 error STDOUT %d", errno);
#  938|   		else if (close(pipefd[1]))

Error: GCC_ANALYZER_WARNING (CWE-775): [#def49]
LVM2.2.03.38/daemons/lvmlockd/lvmlockctl.c:938:26: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘pipefd[1]’
LVM2.2.03.38/daemons/lvmlockd/lvmlockctl.c:846:13: enter_function: entry to ‘_run_command_pipe’
LVM2.2.03.38/daemons/lvmlockd/lvmlockctl.c:859:21: branch_true: following ‘true’ branch (when ‘i != 33’)...
LVM2.2.03.38/daemons/lvmlockd/lvmlockctl.c:860:17: branch_true: ...to here
LVM2.2.03.38/daemons/lvmlockd/lvmlockctl.c:907:12: branch_false: following ‘false’ branch (when ‘arg_len == 0’)...
LVM2.2.03.38/daemons/lvmlockd/lvmlockctl.c:915:13: branch_false: ...to here
LVM2.2.03.38/daemons/lvmlockd/lvmlockctl.c:915:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/daemons/lvmlockd/lvmlockctl.c:920:15: branch_false: ...to here
LVM2.2.03.38/daemons/lvmlockd/lvmlockctl.c:922:12: branch_false: following ‘false’ branch (when ‘pid >= 0’)...
LVM2.2.03.38/daemons/lvmlockd/lvmlockctl.c:928:12: branch_false: ...to here
LVM2.2.03.38/daemons/lvmlockd/lvmlockctl.c:928:12: branch_true: following ‘true’ branch (when ‘pid == 0’)...
LVM2.2.03.38/daemons/lvmlockd/lvmlockctl.c:930:22: branch_true: ...to here
LVM2.2.03.38/daemons/lvmlockd/lvmlockctl.c:930:22: call_function: calling ‘_reopen_fd_to_null’ from ‘_run_command_pipe’
LVM2.2.03.38/daemons/lvmlockd/lvmlockctl.c:930:22: return_function: returning to ‘_run_command_pipe’ from ‘_reopen_fd_to_null’
LVM2.2.03.38/daemons/lvmlockd/lvmlockctl.c:930:20: branch_false: following ‘false’ branch...
LVM2.2.03.38/daemons/lvmlockd/lvmlockctl.c:932:26: branch_false: ...to here
LVM2.2.03.38/daemons/lvmlockd/lvmlockctl.c:932:25: branch_false: following ‘false’ branch...
LVM2.2.03.38/daemons/lvmlockd/lvmlockctl.c:934:26: branch_false: ...to here
LVM2.2.03.38/daemons/lvmlockd/lvmlockctl.c:934:25: branch_false: following ‘false’ branch...
LVM2.2.03.38/daemons/lvmlockd/lvmlockctl.c:936:26: branch_false: ...to here
LVM2.2.03.38/daemons/lvmlockd/lvmlockctl.c:936:25: branch_false: following ‘false’ branch...
LVM2.2.03.38/daemons/lvmlockd/lvmlockctl.c:938:26: branch_false: ...to here
LVM2.2.03.38/daemons/lvmlockd/lvmlockctl.c:938:26: throw: if ‘close’ throws an exception...
LVM2.2.03.38/daemons/lvmlockd/lvmlockctl.c:938:26: danger: ‘pipefd[1]’ leaks here
#  936|   		else if (dup2(pipefd[1 /*write*/], STDOUT_FILENO) == -1)
#  937|   			log_error("dup2 error STDOUT %d", errno);
#  938|-> 		else if (close(pipefd[1]))
#  939|   			log_error("close error pipe[1] %d", errno);
#  940|   		else {

Error: GCC_ANALYZER_WARNING (CWE-775): [#def50]
LVM2.2.03.38/daemons/lvmlockd/lvmlockctl.c:948:13: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘pipefd[(int)pid]’
LVM2.2.03.38/daemons/lvmlockd/lvmlockctl.c:1065:12: enter_function: entry to ‘_run_kill_command’
LVM2.2.03.38/daemons/lvmlockd/lvmlockctl.c:1071:9: call_function: calling ‘_run_command_pipe’ from ‘_run_kill_command’
#  946|   
#  947|   	/* Parent -> reader */
#  948|-> 	if (close(pipefd[1 /*write*/]))
#  949|   		log_error("close error STDOUT %d", errno);
#  950|   

Error: GCC_ANALYZER_WARNING (CWE-775): [#def51]
LVM2.2.03.38/daemons/lvmlockd/lvmlockctl.c:948:13: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘pipefd[0]’
LVM2.2.03.38/daemons/lvmlockd/lvmlockctl.c:859:21: branch_true: following ‘true’ branch (when ‘i != 33’)...
LVM2.2.03.38/daemons/lvmlockd/lvmlockctl.c:860:17: branch_true: ...to here
LVM2.2.03.38/daemons/lvmlockd/lvmlockctl.c:907:12: branch_false: following ‘false’ branch (when ‘arg_len == 0’)...
LVM2.2.03.38/daemons/lvmlockd/lvmlockctl.c:915:13: branch_false: ...to here
LVM2.2.03.38/daemons/lvmlockd/lvmlockctl.c:915:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/daemons/lvmlockd/lvmlockctl.c:920:15: branch_false: ...to here
LVM2.2.03.38/daemons/lvmlockd/lvmlockctl.c:922:12: branch_false: following ‘false’ branch (when ‘pid >= 0’)...
LVM2.2.03.38/daemons/lvmlockd/lvmlockctl.c:928:12: branch_false: ...to here
LVM2.2.03.38/daemons/lvmlockd/lvmlockctl.c:928:12: branch_false: following ‘false’ branch (when ‘pid != 0’)...
LVM2.2.03.38/daemons/lvmlockd/lvmlockctl.c:948:13: branch_false: ...to here
LVM2.2.03.38/daemons/lvmlockd/lvmlockctl.c:948:13: throw: if ‘close’ throws an exception...
LVM2.2.03.38/daemons/lvmlockd/lvmlockctl.c:948:13: danger: ‘pipefd[0]’ leaks here
#  946|   
#  947|   	/* Parent -> reader */
#  948|-> 	if (close(pipefd[1 /*write*/]))
#  949|   		log_error("close error STDOUT %d", errno);
#  950|   

Error: GCC_ANALYZER_WARNING (CWE-775): [#def52]
LVM2.2.03.38/daemons/lvmlockd/lvmlockctl.c:948:13: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘pipefd[1]’
LVM2.2.03.38/daemons/lvmlockd/lvmlockctl.c:859:21: branch_true: following ‘true’ branch (when ‘i != 33’)...
LVM2.2.03.38/daemons/lvmlockd/lvmlockctl.c:860:17: branch_true: ...to here
LVM2.2.03.38/daemons/lvmlockd/lvmlockctl.c:907:12: branch_false: following ‘false’ branch (when ‘arg_len == 0’)...
LVM2.2.03.38/daemons/lvmlockd/lvmlockctl.c:915:13: branch_false: ...to here
LVM2.2.03.38/daemons/lvmlockd/lvmlockctl.c:915:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/daemons/lvmlockd/lvmlockctl.c:920:15: branch_false: ...to here
LVM2.2.03.38/daemons/lvmlockd/lvmlockctl.c:922:12: branch_false: following ‘false’ branch (when ‘pid >= 0’)...
LVM2.2.03.38/daemons/lvmlockd/lvmlockctl.c:928:12: branch_false: ...to here
LVM2.2.03.38/daemons/lvmlockd/lvmlockctl.c:928:12: branch_false: following ‘false’ branch (when ‘pid != 0’)...
LVM2.2.03.38/daemons/lvmlockd/lvmlockctl.c:948:13: branch_false: ...to here
LVM2.2.03.38/daemons/lvmlockd/lvmlockctl.c:948:13: throw: if ‘close’ throws an exception...
LVM2.2.03.38/daemons/lvmlockd/lvmlockctl.c:948:13: danger: ‘pipefd[1]’ leaks here
#  946|   
#  947|   	/* Parent -> reader */
#  948|-> 	if (close(pipefd[1 /*write*/]))
#  949|   		log_error("close error STDOUT %d", errno);
#  950|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def53]
LVM2.2.03.38/daemons/lvmlockd/lvmlockd-core.c:616:13: warning[-Wanalyzer-malloc-leak]: leak of ‘alloc_action()’
LVM2.2.03.38/daemons/lvmlockd/lvmlockd-core.c:7249:13: enter_function: entry to ‘process_fence_result’
LVM2.2.03.38/daemons/lvmlockd/lvmlockd-core.c:7258:21: call_function: calling ‘alloc_action’ from ‘process_fence_result’
LVM2.2.03.38/daemons/lvmlockd/lvmlockd-core.c:7258:21: return_function: returning to ‘process_fence_result’ from ‘alloc_action’
LVM2.2.03.38/daemons/lvmlockd/lvmlockd-core.c:7258:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/daemons/lvmlockd/lvmlockd-core.c:7265:9: branch_false: ...to here
LVM2.2.03.38/daemons/lvmlockd/lvmlockd-core.c:7266:14: call_function: calling ‘find_lockspace_name’ from ‘process_fence_result’
LVM2.2.03.38/daemons/lvmlockd/lvmlockd-core.c:7266:14: return_function: returning to ‘process_fence_result’ from ‘find_lockspace_name’
LVM2.2.03.38/daemons/lvmlockd/lvmlockd-core.c:7267:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/daemons/lvmlockd/lvmlockd-core.c:7274:9: branch_false: ...to here
LVM2.2.03.38/daemons/lvmlockd/lvmlockd-core.c:7275:9: branch_true: following ‘true’ branch...
LVM2.2.03.38/daemons/lvmlockd/lvmlockd-core.c:7276:21: branch_true: ...to here
LVM2.2.03.38/daemons/lvmlockd/lvmlockd-core.c:7279:20: branch_true: following ‘true’ branch...
LVM2.2.03.38/daemons/lvmlockd/lvmlockd-core.c:7281:25: branch_true: ...to here
LVM2.2.03.38/daemons/lvmlockd/lvmlockd-core.c:7281:25: call_function: calling ‘log_level’ from ‘process_fence_result’
#  614|   
#  615|   	pthread_mutex_lock(&unused_struct_mutex);
#  616|-> 	if (!unused_action_count || alloc_new_structs) {
#  617|   		act = malloc(sizeof(struct action));
#  618|   	} else {

Error: GCC_ANALYZER_WARNING (CWE-401): [#def54]
LVM2.2.03.38/daemons/lvmlockd/lvmlockd-core.c:636:13: warning[-Wanalyzer-malloc-leak]: leak of ‘alloc_client()’
LVM2.2.03.38/daemons/lvmlockd/lvmlockd-core.c:6935:13: enter_function: entry to ‘process_listener’
LVM2.2.03.38/daemons/lvmlockd/lvmlockd-core.c:6943:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/daemons/lvmlockd/lvmlockd-core.c:6946:20: branch_false: ...to here
LVM2.2.03.38/daemons/lvmlockd/lvmlockd-core.c:6946:20: call_function: calling ‘alloc_client’ from ‘process_listener’
LVM2.2.03.38/daemons/lvmlockd/lvmlockd-core.c:6946:20: return_function: returning to ‘process_listener’ from ‘alloc_client’
LVM2.2.03.38/daemons/lvmlockd/lvmlockd-core.c:6946:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/daemons/lvmlockd/lvmlockd-core.c:6952:14: branch_false: ...to here
LVM2.2.03.38/daemons/lvmlockd/lvmlockd-core.c:6952:14: call_function: calling ‘add_pollfd’ from ‘process_listener’
#  634|   
#  635|   	pthread_mutex_lock(&unused_struct_mutex);
#  636|-> 	if (!unused_client_count || alloc_new_structs) {
#  637|   		cl = malloc(sizeof(struct client));
#  638|   	} else {

Error: GCC_ANALYZER_WARNING (CWE-775): [#def55]
LVM2.2.03.38/daemons/lvmlockd/lvmlockd-core.c:1085:21: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(adopt_file, "r")’
LVM2.2.03.38/daemons/lvmlockd/lvmlockd-core.c:6342:13: enter_function: entry to ‘adopt_locks’
LVM2.2.03.38/daemons/lvmlockd/lvmlockd-core.c:6362:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/daemons/lvmlockd/lvmlockd-core.c:6371:33: branch_false: ...to here
LVM2.2.03.38/daemons/lvmlockd/lvmlockd-core.c:6373:20: branch_false: following ‘false’ branch...
LVM2.2.03.38/daemons/lvmlockd/lvmlockd-core.c:6377:37: branch_false: ...to here
LVM2.2.03.38/daemons/lvmlockd/lvmlockd-core.c:6383:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/daemons/lvmlockd/lvmlockd-core.c:6392:14: branch_false: ...to here
LVM2.2.03.38/daemons/lvmlockd/lvmlockd-core.c:6392:14: call_function: calling ‘read_adopt_file’ from ‘adopt_locks’
# 1083|   
# 1084|   	while (fgets(adopt_line, sizeof(adopt_line), fp)) {
# 1085|-> 		if (adopt_line[0] == '#')
# 1086|   			continue;
# 1087|   		else if (!strncmp(adopt_line, "lvmlockd", 8)) {

Error: GCC_ANALYZER_WARNING (CWE-401): [#def56]
LVM2.2.03.38/daemons/lvmlockd/lvmlockd-core.c:1085:21: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(adopt_file, "r")’
LVM2.2.03.38/daemons/lvmlockd/lvmlockd-core.c:6342:13: enter_function: entry to ‘adopt_locks’
LVM2.2.03.38/daemons/lvmlockd/lvmlockd-core.c:6362:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/daemons/lvmlockd/lvmlockd-core.c:6371:33: branch_false: ...to here
LVM2.2.03.38/daemons/lvmlockd/lvmlockd-core.c:6373:20: branch_false: following ‘false’ branch...
LVM2.2.03.38/daemons/lvmlockd/lvmlockd-core.c:6377:37: branch_false: ...to here
LVM2.2.03.38/daemons/lvmlockd/lvmlockd-core.c:6383:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/daemons/lvmlockd/lvmlockd-core.c:6392:14: branch_false: ...to here
LVM2.2.03.38/daemons/lvmlockd/lvmlockd-core.c:6392:14: call_function: calling ‘read_adopt_file’ from ‘adopt_locks’
# 1083|   
# 1084|   	while (fgets(adopt_line, sizeof(adopt_line), fp)) {
# 1085|-> 		if (adopt_line[0] == '#')
# 1086|   			continue;
# 1087|   		else if (!strncmp(adopt_line, "lvmlockd", 8)) {

Error: COMPILER_WARNING: [#def57]
LVM2.2.03.38/daemons/lvmlockd/lvmlockd-core.c: scope_hint: In function ‘clear_locks’
LVM2.2.03.38/daemons/lvmlockd/lvmlockd-core.c:2548:13: warning[-Wunused-but-set-variable=]: variable ‘lk_count’ set but not used
# 2548 |         int lk_count = 0;
#      |             ^~~~~~~~
# 2546|   	uint32_t lk_version;
# 2547|   	uint32_t r_version;
# 2548|-> 	int lk_count = 0;
# 2549|   	int rv;
# 2550|   

Error: COMPILER_WARNING: [#def58]
LVM2.2.03.38/daemons/lvmlockd/lvmlockd-core.c: scope_hint: In function ‘lockspace_thread_main’
LVM2.2.03.38/daemons/lvmlockd/lvmlockd-core.c:3374:9: warning[-Wstringop-truncation]: ‘strncpy’ specified bound 65 equals destination size
# 3374 |         strncpy(tmp_name+4, ls->name, sizeof(tmp_name)-4);
#      |         ^
# 3372|   	memset(tmp_name, 0, sizeof(tmp_name));
# 3373|   	memcpy(tmp_name, "REM:", 4);
# 3374|-> 	strncpy(tmp_name+4, ls->name, sizeof(tmp_name)-4);
# 3375|   	memcpy(ls->name, tmp_name, sizeof(ls->name));
# 3376|   	pthread_mutex_unlock(&lockspaces_mutex);

Error: GCC_ANALYZER_WARNING (CWE-126): [#def59]
LVM2.2.03.38/daemons/lvmlockd/lvmlockd-core.c:6912:17: warning[-Wanalyzer-out-of-bounds]: stack-based buffer over-read
LVM2.2.03.38/daemons/lvmlockd/lvmlockd-core.c:6362:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/daemons/lvmlockd/lvmlockd-core.c:6371:33: branch_false: ...to here
LVM2.2.03.38/daemons/lvmlockd/lvmlockd-core.c:6911:9: branch_true: following ‘true’ branch...
LVM2.2.03.38/daemons/lvmlockd/lvmlockd-core.c:6912:17: branch_true: ...to here
LVM2.2.03.38/daemons/lvmlockd/lvmlockd-core.c:6912:17: danger: out-of-bounds read from byte 456 till byte 463 but ‘vg_lockd’ ends at byte 16
# 6910|   fail:
# 6911|   	list_for_each_entry_safe(ls, lsafe, &vg_lockd, list) {
# 6912|-> 		list_for_each_entry_safe(r, rsafe, &ls->resources, list) {
# 6913|   			list_del(&r->list);
# 6914|   			free_resource(r);

Error: COMPILER_WARNING: [#def60]
LVM2.2.03.38/daemons/lvmlockd/lvmlockd-core.c: scope_hint: In function ‘worker_thread_main’
LVM2.2.03.38/daemons/lvmlockd/lvmlockd-core.c:7072:17: warning[-Wstringop-truncation]: ‘strncpy’ output may be truncated copying 64 bytes from a string of length 64
# 7072 |                 strncpy(msg.ls_name, ls_name, MAX_NAME);
#      |                 ^
# 7070|   
# 7071|   	if (act->op == LD_OP_FENCE) {
# 7072|-> 		strncpy(msg.ls_name, ls_name, MAX_NAME);
# 7073|   		msg.type = HELPER_COMMAND;
# 7074|   		msg.act = LD_OP_FENCE;

Error: GCC_ANALYZER_WARNING (CWE-775): [#def61]
LVM2.2.03.38/daemons/lvmlockd/lvmlockd-core.c:7168:17: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘cr_fd’
LVM2.2.03.38/daemons/lvmlockd/lvmlockd-core.c:7159:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/daemons/lvmlockd/lvmlockd-core.c:7164:9: branch_false: ...to here
LVM2.2.03.38/daemons/lvmlockd/lvmlockd-core.c:7167:12: branch_true: following ‘true’ branch...
LVM2.2.03.38/daemons/lvmlockd/lvmlockd-core.c:7168:17: branch_true: ...to here
LVM2.2.03.38/daemons/lvmlockd/lvmlockd-core.c:7168:17: throw: if ‘close’ throws an exception...
LVM2.2.03.38/daemons/lvmlockd/lvmlockd-core.c:7168:17: danger: ‘cr_fd’ leaks here
# 7166|   
# 7167|   	if (pipe2(pfd, O_NONBLOCK | O_CLOEXEC)) {
# 7168|-> 		close(cr_fd);
# 7169|   		close(pw_fd);
# 7170|   		return -errno;

Error: GCC_ANALYZER_WARNING (CWE-775): [#def62]
LVM2.2.03.38/daemons/lvmlockd/lvmlockd-core.c:7168:17: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘pw_fd’
LVM2.2.03.38/daemons/lvmlockd/lvmlockd-core.c:7159:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/daemons/lvmlockd/lvmlockd-core.c:7164:9: branch_false: ...to here
LVM2.2.03.38/daemons/lvmlockd/lvmlockd-core.c:7167:12: branch_true: following ‘true’ branch...
LVM2.2.03.38/daemons/lvmlockd/lvmlockd-core.c:7168:17: branch_true: ...to here
LVM2.2.03.38/daemons/lvmlockd/lvmlockd-core.c:7168:17: throw: if ‘close’ throws an exception...
LVM2.2.03.38/daemons/lvmlockd/lvmlockd-core.c:7168:17: danger: ‘pw_fd’ leaks here
# 7166|   
# 7167|   	if (pipe2(pfd, O_NONBLOCK | O_CLOEXEC)) {
# 7168|-> 		close(cr_fd);
# 7169|   		close(pw_fd);
# 7170|   		return -errno;

Error: GCC_ANALYZER_WARNING (CWE-775): [#def63]
LVM2.2.03.38/daemons/lvmlockd/lvmlockd-core.c:7169:17: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘pw_fd’
LVM2.2.03.38/daemons/lvmlockd/lvmlockd-core.c:7159:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/daemons/lvmlockd/lvmlockd-core.c:7164:9: branch_false: ...to here
LVM2.2.03.38/daemons/lvmlockd/lvmlockd-core.c:7167:12: branch_true: following ‘true’ branch...
LVM2.2.03.38/daemons/lvmlockd/lvmlockd-core.c:7168:17: branch_true: ...to here
LVM2.2.03.38/daemons/lvmlockd/lvmlockd-core.c:7169:17: throw: if ‘close’ throws an exception...
LVM2.2.03.38/daemons/lvmlockd/lvmlockd-core.c:7169:17: danger: ‘pw_fd’ leaks here
# 7167|   	if (pipe2(pfd, O_NONBLOCK | O_CLOEXEC)) {
# 7168|   		close(cr_fd);
# 7169|-> 		close(pw_fd);
# 7170|   		return -errno;
# 7171|   	}

Error: GCC_ANALYZER_WARNING (CWE-775): [#def64]
LVM2.2.03.38/daemons/lvmlockd/lvmlockd-core.c:7178:17: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘cr_fd’
LVM2.2.03.38/daemons/lvmlockd/lvmlockd-core.c:7159:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/daemons/lvmlockd/lvmlockd-core.c:7164:9: branch_false: ...to here
LVM2.2.03.38/daemons/lvmlockd/lvmlockd-core.c:7167:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/daemons/lvmlockd/lvmlockd-core.c:7173:9: branch_false: ...to here
LVM2.2.03.38/daemons/lvmlockd/lvmlockd-core.c:7177:12: branch_true: following ‘true’ branch (when ‘pid < 0’)...
LVM2.2.03.38/daemons/lvmlockd/lvmlockd-core.c:7178:17: branch_true: ...to here
LVM2.2.03.38/daemons/lvmlockd/lvmlockd-core.c:7178:17: throw: if ‘close’ throws an exception...
LVM2.2.03.38/daemons/lvmlockd/lvmlockd-core.c:7178:17: danger: ‘cr_fd’ leaks here
# 7176|   	pid = fork();
# 7177|   	if (pid < 0) {
# 7178|-> 		close(cr_fd);
# 7179|   		close(pw_fd);
# 7180|   		close(pr_fd);

Error: GCC_ANALYZER_WARNING (CWE-775): [#def65]
LVM2.2.03.38/daemons/lvmlockd/lvmlockd-core.c:7178:17: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘cw_fd’
LVM2.2.03.38/daemons/lvmlockd/lvmlockd-core.c:7159:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/daemons/lvmlockd/lvmlockd-core.c:7164:9: branch_false: ...to here
LVM2.2.03.38/daemons/lvmlockd/lvmlockd-core.c:7167:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/daemons/lvmlockd/lvmlockd-core.c:7173:9: branch_false: ...to here
LVM2.2.03.38/daemons/lvmlockd/lvmlockd-core.c:7177:12: branch_true: following ‘true’ branch (when ‘pid < 0’)...
LVM2.2.03.38/daemons/lvmlockd/lvmlockd-core.c:7178:17: branch_true: ...to here
LVM2.2.03.38/daemons/lvmlockd/lvmlockd-core.c:7178:17: throw: if ‘close’ throws an exception...
LVM2.2.03.38/daemons/lvmlockd/lvmlockd-core.c:7178:17: danger: ‘cw_fd’ leaks here
# 7176|   	pid = fork();
# 7177|   	if (pid < 0) {
# 7178|-> 		close(cr_fd);
# 7179|   		close(pw_fd);
# 7180|   		close(pr_fd);

Error: GCC_ANALYZER_WARNING (CWE-775): [#def66]
LVM2.2.03.38/daemons/lvmlockd/lvmlockd-core.c:7178:17: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘pr_fd’
LVM2.2.03.38/daemons/lvmlockd/lvmlockd-core.c:7159:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/daemons/lvmlockd/lvmlockd-core.c:7164:9: branch_false: ...to here
LVM2.2.03.38/daemons/lvmlockd/lvmlockd-core.c:7167:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/daemons/lvmlockd/lvmlockd-core.c:7173:9: branch_false: ...to here
LVM2.2.03.38/daemons/lvmlockd/lvmlockd-core.c:7177:12: branch_true: following ‘true’ branch (when ‘pid < 0’)...
LVM2.2.03.38/daemons/lvmlockd/lvmlockd-core.c:7178:17: branch_true: ...to here
LVM2.2.03.38/daemons/lvmlockd/lvmlockd-core.c:7178:17: throw: if ‘close’ throws an exception...
LVM2.2.03.38/daemons/lvmlockd/lvmlockd-core.c:7178:17: danger: ‘pr_fd’ leaks here
# 7176|   	pid = fork();
# 7177|   	if (pid < 0) {
# 7178|-> 		close(cr_fd);
# 7179|   		close(pw_fd);
# 7180|   		close(pr_fd);

Error: GCC_ANALYZER_WARNING (CWE-775): [#def67]
LVM2.2.03.38/daemons/lvmlockd/lvmlockd-core.c:7178:17: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘pw_fd’
LVM2.2.03.38/daemons/lvmlockd/lvmlockd-core.c:7159:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/daemons/lvmlockd/lvmlockd-core.c:7164:9: branch_false: ...to here
LVM2.2.03.38/daemons/lvmlockd/lvmlockd-core.c:7167:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/daemons/lvmlockd/lvmlockd-core.c:7173:9: branch_false: ...to here
LVM2.2.03.38/daemons/lvmlockd/lvmlockd-core.c:7177:12: branch_true: following ‘true’ branch (when ‘pid < 0’)...
LVM2.2.03.38/daemons/lvmlockd/lvmlockd-core.c:7178:17: branch_true: ...to here
LVM2.2.03.38/daemons/lvmlockd/lvmlockd-core.c:7178:17: throw: if ‘close’ throws an exception...
LVM2.2.03.38/daemons/lvmlockd/lvmlockd-core.c:7178:17: danger: ‘pw_fd’ leaks here
# 7176|   	pid = fork();
# 7177|   	if (pid < 0) {
# 7178|-> 		close(cr_fd);
# 7179|   		close(pw_fd);
# 7180|   		close(pr_fd);

Error: GCC_ANALYZER_WARNING (CWE-775): [#def68]
LVM2.2.03.38/daemons/lvmlockd/lvmlockd-core.c:7179:17: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘cw_fd’
LVM2.2.03.38/daemons/lvmlockd/lvmlockd-core.c:7159:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/daemons/lvmlockd/lvmlockd-core.c:7164:9: branch_false: ...to here
LVM2.2.03.38/daemons/lvmlockd/lvmlockd-core.c:7167:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/daemons/lvmlockd/lvmlockd-core.c:7173:9: branch_false: ...to here
LVM2.2.03.38/daemons/lvmlockd/lvmlockd-core.c:7177:12: branch_true: following ‘true’ branch (when ‘pid < 0’)...
LVM2.2.03.38/daemons/lvmlockd/lvmlockd-core.c:7178:17: branch_true: ...to here
LVM2.2.03.38/daemons/lvmlockd/lvmlockd-core.c:7179:17: throw: if ‘close’ throws an exception...
LVM2.2.03.38/daemons/lvmlockd/lvmlockd-core.c:7179:17: danger: ‘cw_fd’ leaks here
# 7177|   	if (pid < 0) {
# 7178|   		close(cr_fd);
# 7179|-> 		close(pw_fd);
# 7180|   		close(pr_fd);
# 7181|   		close(cw_fd);

Error: GCC_ANALYZER_WARNING (CWE-775): [#def69]
LVM2.2.03.38/daemons/lvmlockd/lvmlockd-core.c:7179:17: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘pr_fd’
LVM2.2.03.38/daemons/lvmlockd/lvmlockd-core.c:7159:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/daemons/lvmlockd/lvmlockd-core.c:7164:9: branch_false: ...to here
LVM2.2.03.38/daemons/lvmlockd/lvmlockd-core.c:7167:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/daemons/lvmlockd/lvmlockd-core.c:7173:9: branch_false: ...to here
LVM2.2.03.38/daemons/lvmlockd/lvmlockd-core.c:7177:12: branch_true: following ‘true’ branch (when ‘pid < 0’)...
LVM2.2.03.38/daemons/lvmlockd/lvmlockd-core.c:7178:17: branch_true: ...to here
LVM2.2.03.38/daemons/lvmlockd/lvmlockd-core.c:7179:17: throw: if ‘close’ throws an exception...
LVM2.2.03.38/daemons/lvmlockd/lvmlockd-core.c:7179:17: danger: ‘pr_fd’ leaks here
# 7177|   	if (pid < 0) {
# 7178|   		close(cr_fd);
# 7179|-> 		close(pw_fd);
# 7180|   		close(pr_fd);
# 7181|   		close(cw_fd);

Error: GCC_ANALYZER_WARNING (CWE-775): [#def70]
LVM2.2.03.38/daemons/lvmlockd/lvmlockd-core.c:7179:17: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘pw_fd’
LVM2.2.03.38/daemons/lvmlockd/lvmlockd-core.c:7159:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/daemons/lvmlockd/lvmlockd-core.c:7164:9: branch_false: ...to here
LVM2.2.03.38/daemons/lvmlockd/lvmlockd-core.c:7167:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/daemons/lvmlockd/lvmlockd-core.c:7173:9: branch_false: ...to here
LVM2.2.03.38/daemons/lvmlockd/lvmlockd-core.c:7177:12: branch_true: following ‘true’ branch (when ‘pid < 0’)...
LVM2.2.03.38/daemons/lvmlockd/lvmlockd-core.c:7178:17: branch_true: ...to here
LVM2.2.03.38/daemons/lvmlockd/lvmlockd-core.c:7179:17: throw: if ‘close’ throws an exception...
LVM2.2.03.38/daemons/lvmlockd/lvmlockd-core.c:7179:17: danger: ‘pw_fd’ leaks here
# 7177|   	if (pid < 0) {
# 7178|   		close(cr_fd);
# 7179|-> 		close(pw_fd);
# 7180|   		close(pr_fd);
# 7181|   		close(cw_fd);

Error: GCC_ANALYZER_WARNING (CWE-775): [#def71]
LVM2.2.03.38/daemons/lvmlockd/lvmlockd-core.c:7180:17: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘cw_fd’
LVM2.2.03.38/daemons/lvmlockd/lvmlockd-core.c:7159:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/daemons/lvmlockd/lvmlockd-core.c:7164:9: branch_false: ...to here
LVM2.2.03.38/daemons/lvmlockd/lvmlockd-core.c:7167:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/daemons/lvmlockd/lvmlockd-core.c:7173:9: branch_false: ...to here
LVM2.2.03.38/daemons/lvmlockd/lvmlockd-core.c:7177:12: branch_true: following ‘true’ branch (when ‘pid < 0’)...
LVM2.2.03.38/daemons/lvmlockd/lvmlockd-core.c:7178:17: branch_true: ...to here
LVM2.2.03.38/daemons/lvmlockd/lvmlockd-core.c:7180:17: throw: if ‘close’ throws an exception...
LVM2.2.03.38/daemons/lvmlockd/lvmlockd-core.c:7180:17: danger: ‘cw_fd’ leaks here
# 7178|   		close(cr_fd);
# 7179|   		close(pw_fd);
# 7180|-> 		close(pr_fd);
# 7181|   		close(cw_fd);
# 7182|   		return -errno;

Error: GCC_ANALYZER_WARNING (CWE-775): [#def72]
LVM2.2.03.38/daemons/lvmlockd/lvmlockd-core.c:7180:17: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘pr_fd’
LVM2.2.03.38/daemons/lvmlockd/lvmlockd-core.c:7159:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/daemons/lvmlockd/lvmlockd-core.c:7164:9: branch_false: ...to here
LVM2.2.03.38/daemons/lvmlockd/lvmlockd-core.c:7167:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/daemons/lvmlockd/lvmlockd-core.c:7173:9: branch_false: ...to here
LVM2.2.03.38/daemons/lvmlockd/lvmlockd-core.c:7177:12: branch_true: following ‘true’ branch (when ‘pid < 0’)...
LVM2.2.03.38/daemons/lvmlockd/lvmlockd-core.c:7178:17: branch_true: ...to here
LVM2.2.03.38/daemons/lvmlockd/lvmlockd-core.c:7180:17: throw: if ‘close’ throws an exception...
LVM2.2.03.38/daemons/lvmlockd/lvmlockd-core.c:7180:17: danger: ‘pr_fd’ leaks here
# 7178|   		close(cr_fd);
# 7179|   		close(pw_fd);
# 7180|-> 		close(pr_fd);
# 7181|   		close(cw_fd);
# 7182|   		return -errno;

Error: GCC_ANALYZER_WARNING (CWE-775): [#def73]
LVM2.2.03.38/daemons/lvmlockd/lvmlockd-core.c:7181:17: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘cw_fd’
LVM2.2.03.38/daemons/lvmlockd/lvmlockd-core.c:7159:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/daemons/lvmlockd/lvmlockd-core.c:7164:9: branch_false: ...to here
LVM2.2.03.38/daemons/lvmlockd/lvmlockd-core.c:7167:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/daemons/lvmlockd/lvmlockd-core.c:7173:9: branch_false: ...to here
LVM2.2.03.38/daemons/lvmlockd/lvmlockd-core.c:7177:12: branch_true: following ‘true’ branch (when ‘pid < 0’)...
LVM2.2.03.38/daemons/lvmlockd/lvmlockd-core.c:7178:17: branch_true: ...to here
LVM2.2.03.38/daemons/lvmlockd/lvmlockd-core.c:7181:17: throw: if ‘close’ throws an exception...
LVM2.2.03.38/daemons/lvmlockd/lvmlockd-core.c:7181:17: danger: ‘cw_fd’ leaks here
# 7179|   		close(pw_fd);
# 7180|   		close(pr_fd);
# 7181|-> 		close(cw_fd);
# 7182|   		return -errno;
# 7183|   	}

Error: GCC_ANALYZER_WARNING (CWE-775): [#def74]
LVM2.2.03.38/daemons/lvmlockd/lvmlockd-core.c:7186:17: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘cr_fd’
LVM2.2.03.38/daemons/lvmlockd/lvmlockd-core.c:7159:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/daemons/lvmlockd/lvmlockd-core.c:7164:9: branch_false: ...to here
LVM2.2.03.38/daemons/lvmlockd/lvmlockd-core.c:7167:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/daemons/lvmlockd/lvmlockd-core.c:7173:9: branch_false: ...to here
LVM2.2.03.38/daemons/lvmlockd/lvmlockd-core.c:7177:12: branch_false: following ‘false’ branch (when ‘pid >= 0’)...
LVM2.2.03.38/daemons/lvmlockd/lvmlockd-core.c:7185:12: branch_false: ...to here
LVM2.2.03.38/daemons/lvmlockd/lvmlockd-core.c:7185:12: branch_true: following ‘true’ branch (when ‘pid != 0’)...
LVM2.2.03.38/daemons/lvmlockd/lvmlockd-core.c:7186:17: branch_true: ...to here
LVM2.2.03.38/daemons/lvmlockd/lvmlockd-core.c:7186:17: throw: if ‘close’ throws an exception...
LVM2.2.03.38/daemons/lvmlockd/lvmlockd-core.c:7186:17: danger: ‘cr_fd’ leaks here
# 7184|   
# 7185|   	if (pid) {
# 7186|-> 		close(cr_fd);
# 7187|   		close(cw_fd);
# 7188|   		helper_send_fd = pw_fd;

Error: GCC_ANALYZER_WARNING (CWE-775): [#def75]
LVM2.2.03.38/daemons/lvmlockd/lvmlockd-core.c:7186:17: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘cw_fd’
LVM2.2.03.38/daemons/lvmlockd/lvmlockd-core.c:7159:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/daemons/lvmlockd/lvmlockd-core.c:7164:9: branch_false: ...to here
LVM2.2.03.38/daemons/lvmlockd/lvmlockd-core.c:7167:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/daemons/lvmlockd/lvmlockd-core.c:7173:9: branch_false: ...to here
LVM2.2.03.38/daemons/lvmlockd/lvmlockd-core.c:7177:12: branch_false: following ‘false’ branch (when ‘pid >= 0’)...
LVM2.2.03.38/daemons/lvmlockd/lvmlockd-core.c:7185:12: branch_false: ...to here
LVM2.2.03.38/daemons/lvmlockd/lvmlockd-core.c:7185:12: branch_true: following ‘true’ branch (when ‘pid != 0’)...
LVM2.2.03.38/daemons/lvmlockd/lvmlockd-core.c:7186:17: branch_true: ...to here
LVM2.2.03.38/daemons/lvmlockd/lvmlockd-core.c:7186:17: throw: if ‘close’ throws an exception...
LVM2.2.03.38/daemons/lvmlockd/lvmlockd-core.c:7186:17: danger: ‘cw_fd’ leaks here
# 7184|   
# 7185|   	if (pid) {
# 7186|-> 		close(cr_fd);
# 7187|   		close(cw_fd);
# 7188|   		helper_send_fd = pw_fd;

Error: GCC_ANALYZER_WARNING (CWE-775): [#def76]
LVM2.2.03.38/daemons/lvmlockd/lvmlockd-core.c:7186:17: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘pr_fd’
LVM2.2.03.38/daemons/lvmlockd/lvmlockd-core.c:7159:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/daemons/lvmlockd/lvmlockd-core.c:7164:9: branch_false: ...to here
LVM2.2.03.38/daemons/lvmlockd/lvmlockd-core.c:7167:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/daemons/lvmlockd/lvmlockd-core.c:7173:9: branch_false: ...to here
LVM2.2.03.38/daemons/lvmlockd/lvmlockd-core.c:7177:12: branch_false: following ‘false’ branch (when ‘pid >= 0’)...
LVM2.2.03.38/daemons/lvmlockd/lvmlockd-core.c:7185:12: branch_false: ...to here
LVM2.2.03.38/daemons/lvmlockd/lvmlockd-core.c:7185:12: branch_true: following ‘true’ branch (when ‘pid != 0’)...
LVM2.2.03.38/daemons/lvmlockd/lvmlockd-core.c:7186:17: branch_true: ...to here
LVM2.2.03.38/daemons/lvmlockd/lvmlockd-core.c:7186:17: throw: if ‘close’ throws an exception...
LVM2.2.03.38/daemons/lvmlockd/lvmlockd-core.c:7186:17: danger: ‘pr_fd’ leaks here
# 7184|   
# 7185|   	if (pid) {
# 7186|-> 		close(cr_fd);
# 7187|   		close(cw_fd);
# 7188|   		helper_send_fd = pw_fd;

Error: GCC_ANALYZER_WARNING (CWE-775): [#def77]
LVM2.2.03.38/daemons/lvmlockd/lvmlockd-core.c:7186:17: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘pw_fd’
LVM2.2.03.38/daemons/lvmlockd/lvmlockd-core.c:7159:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/daemons/lvmlockd/lvmlockd-core.c:7164:9: branch_false: ...to here
LVM2.2.03.38/daemons/lvmlockd/lvmlockd-core.c:7167:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/daemons/lvmlockd/lvmlockd-core.c:7173:9: branch_false: ...to here
LVM2.2.03.38/daemons/lvmlockd/lvmlockd-core.c:7177:12: branch_false: following ‘false’ branch (when ‘pid >= 0’)...
LVM2.2.03.38/daemons/lvmlockd/lvmlockd-core.c:7185:12: branch_false: ...to here
LVM2.2.03.38/daemons/lvmlockd/lvmlockd-core.c:7185:12: branch_true: following ‘true’ branch (when ‘pid != 0’)...
LVM2.2.03.38/daemons/lvmlockd/lvmlockd-core.c:7186:17: branch_true: ...to here
LVM2.2.03.38/daemons/lvmlockd/lvmlockd-core.c:7186:17: throw: if ‘close’ throws an exception...
LVM2.2.03.38/daemons/lvmlockd/lvmlockd-core.c:7186:17: danger: ‘pw_fd’ leaks here
# 7184|   
# 7185|   	if (pid) {
# 7186|-> 		close(cr_fd);
# 7187|   		close(cw_fd);
# 7188|   		helper_send_fd = pw_fd;

Error: GCC_ANALYZER_WARNING (CWE-775): [#def78]
LVM2.2.03.38/daemons/lvmlockd/lvmlockd-core.c:7187:17: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘cw_fd’
LVM2.2.03.38/daemons/lvmlockd/lvmlockd-core.c:7159:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/daemons/lvmlockd/lvmlockd-core.c:7164:9: branch_false: ...to here
LVM2.2.03.38/daemons/lvmlockd/lvmlockd-core.c:7167:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/daemons/lvmlockd/lvmlockd-core.c:7173:9: branch_false: ...to here
LVM2.2.03.38/daemons/lvmlockd/lvmlockd-core.c:7177:12: branch_false: following ‘false’ branch (when ‘pid >= 0’)...
LVM2.2.03.38/daemons/lvmlockd/lvmlockd-core.c:7185:12: branch_false: ...to here
LVM2.2.03.38/daemons/lvmlockd/lvmlockd-core.c:7185:12: branch_true: following ‘true’ branch (when ‘pid != 0’)...
LVM2.2.03.38/daemons/lvmlockd/lvmlockd-core.c:7186:17: branch_true: ...to here
LVM2.2.03.38/daemons/lvmlockd/lvmlockd-core.c:7187:17: throw: if ‘close’ throws an exception...
LVM2.2.03.38/daemons/lvmlockd/lvmlockd-core.c:7187:17: danger: ‘cw_fd’ leaks here
# 7185|   	if (pid) {
# 7186|   		close(cr_fd);
# 7187|-> 		close(cw_fd);
# 7188|   		helper_send_fd = pw_fd;
# 7189|   		helper_recv_fd = pr_fd;

Error: GCC_ANALYZER_WARNING (CWE-775): [#def79]
LVM2.2.03.38/daemons/lvmlockd/lvmlockd-core.c:7187:17: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘pr_fd’
LVM2.2.03.38/daemons/lvmlockd/lvmlockd-core.c:7159:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/daemons/lvmlockd/lvmlockd-core.c:7164:9: branch_false: ...to here
LVM2.2.03.38/daemons/lvmlockd/lvmlockd-core.c:7167:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/daemons/lvmlockd/lvmlockd-core.c:7173:9: branch_false: ...to here
LVM2.2.03.38/daemons/lvmlockd/lvmlockd-core.c:7177:12: branch_false: following ‘false’ branch (when ‘pid >= 0’)...
LVM2.2.03.38/daemons/lvmlockd/lvmlockd-core.c:7185:12: branch_false: ...to here
LVM2.2.03.38/daemons/lvmlockd/lvmlockd-core.c:7185:12: branch_true: following ‘true’ branch (when ‘pid != 0’)...
LVM2.2.03.38/daemons/lvmlockd/lvmlockd-core.c:7186:17: branch_true: ...to here
LVM2.2.03.38/daemons/lvmlockd/lvmlockd-core.c:7187:17: throw: if ‘close’ throws an exception...
LVM2.2.03.38/daemons/lvmlockd/lvmlockd-core.c:7187:17: danger: ‘pr_fd’ leaks here
# 7185|   	if (pid) {
# 7186|   		close(cr_fd);
# 7187|-> 		close(cw_fd);
# 7188|   		helper_send_fd = pw_fd;
# 7189|   		helper_recv_fd = pr_fd;

Error: GCC_ANALYZER_WARNING (CWE-775): [#def80]
LVM2.2.03.38/daemons/lvmlockd/lvmlockd-core.c:7187:17: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘pw_fd’
LVM2.2.03.38/daemons/lvmlockd/lvmlockd-core.c:7159:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/daemons/lvmlockd/lvmlockd-core.c:7164:9: branch_false: ...to here
LVM2.2.03.38/daemons/lvmlockd/lvmlockd-core.c:7167:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/daemons/lvmlockd/lvmlockd-core.c:7173:9: branch_false: ...to here
LVM2.2.03.38/daemons/lvmlockd/lvmlockd-core.c:7177:12: branch_false: following ‘false’ branch (when ‘pid >= 0’)...
LVM2.2.03.38/daemons/lvmlockd/lvmlockd-core.c:7185:12: branch_false: ...to here
LVM2.2.03.38/daemons/lvmlockd/lvmlockd-core.c:7185:12: branch_true: following ‘true’ branch (when ‘pid != 0’)...
LVM2.2.03.38/daemons/lvmlockd/lvmlockd-core.c:7186:17: branch_true: ...to here
LVM2.2.03.38/daemons/lvmlockd/lvmlockd-core.c:7187:17: throw: if ‘close’ throws an exception...
LVM2.2.03.38/daemons/lvmlockd/lvmlockd-core.c:7187:17: danger: ‘pw_fd’ leaks here
# 7185|   	if (pid) {
# 7186|   		close(cr_fd);
# 7187|-> 		close(cw_fd);
# 7188|   		helper_send_fd = pw_fd;
# 7189|   		helper_recv_fd = pr_fd;

Error: GCC_ANALYZER_WARNING (CWE-775): [#def81]
LVM2.2.03.38/daemons/lvmlockd/lvmlockd-core.c:7193:17: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘cr_fd’
LVM2.2.03.38/daemons/lvmlockd/lvmlockd-core.c:7159:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/daemons/lvmlockd/lvmlockd-core.c:7164:9: branch_false: ...to here
LVM2.2.03.38/daemons/lvmlockd/lvmlockd-core.c:7167:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/daemons/lvmlockd/lvmlockd-core.c:7173:9: branch_false: ...to here
LVM2.2.03.38/daemons/lvmlockd/lvmlockd-core.c:7177:12: branch_false: following ‘false’ branch (when ‘pid >= 0’)...
LVM2.2.03.38/daemons/lvmlockd/lvmlockd-core.c:7185:12: branch_false: ...to here
LVM2.2.03.38/daemons/lvmlockd/lvmlockd-core.c:7185:12: branch_false: following ‘false’ branch (when ‘pid == 0’)...
LVM2.2.03.38/daemons/lvmlockd/lvmlockd-core.c:7193:17: branch_false: ...to here
LVM2.2.03.38/daemons/lvmlockd/lvmlockd-core.c:7193:17: throw: if ‘close’ throws an exception...
LVM2.2.03.38/daemons/lvmlockd/lvmlockd-core.c:7193:17: danger: ‘cr_fd’ leaks here
# 7191|   		return 0;
# 7192|   	} else {
# 7193|-> 		close(pr_fd);
# 7194|   		close(pw_fd);
# 7195|   		helper_main(cr_fd, cw_fd, daemon_debug);

Error: GCC_ANALYZER_WARNING (CWE-775): [#def82]
LVM2.2.03.38/daemons/lvmlockd/lvmlockd-core.c:7193:17: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘cw_fd’
LVM2.2.03.38/daemons/lvmlockd/lvmlockd-core.c:7159:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/daemons/lvmlockd/lvmlockd-core.c:7164:9: branch_false: ...to here
LVM2.2.03.38/daemons/lvmlockd/lvmlockd-core.c:7167:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/daemons/lvmlockd/lvmlockd-core.c:7173:9: branch_false: ...to here
LVM2.2.03.38/daemons/lvmlockd/lvmlockd-core.c:7177:12: branch_false: following ‘false’ branch (when ‘pid >= 0’)...
LVM2.2.03.38/daemons/lvmlockd/lvmlockd-core.c:7185:12: branch_false: ...to here
LVM2.2.03.38/daemons/lvmlockd/lvmlockd-core.c:7185:12: branch_false: following ‘false’ branch (when ‘pid == 0’)...
LVM2.2.03.38/daemons/lvmlockd/lvmlockd-core.c:7193:17: branch_false: ...to here
LVM2.2.03.38/daemons/lvmlockd/lvmlockd-core.c:7193:17: throw: if ‘close’ throws an exception...
LVM2.2.03.38/daemons/lvmlockd/lvmlockd-core.c:7193:17: danger: ‘cw_fd’ leaks here
# 7191|   		return 0;
# 7192|   	} else {
# 7193|-> 		close(pr_fd);
# 7194|   		close(pw_fd);
# 7195|   		helper_main(cr_fd, cw_fd, daemon_debug);

Error: GCC_ANALYZER_WARNING (CWE-775): [#def83]
LVM2.2.03.38/daemons/lvmlockd/lvmlockd-core.c:7193:17: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘pr_fd’
LVM2.2.03.38/daemons/lvmlockd/lvmlockd-core.c:7159:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/daemons/lvmlockd/lvmlockd-core.c:7164:9: branch_false: ...to here
LVM2.2.03.38/daemons/lvmlockd/lvmlockd-core.c:7167:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/daemons/lvmlockd/lvmlockd-core.c:7173:9: branch_false: ...to here
LVM2.2.03.38/daemons/lvmlockd/lvmlockd-core.c:7177:12: branch_false: following ‘false’ branch (when ‘pid >= 0’)...
LVM2.2.03.38/daemons/lvmlockd/lvmlockd-core.c:7185:12: branch_false: ...to here
LVM2.2.03.38/daemons/lvmlockd/lvmlockd-core.c:7185:12: branch_false: following ‘false’ branch (when ‘pid == 0’)...
LVM2.2.03.38/daemons/lvmlockd/lvmlockd-core.c:7193:17: branch_false: ...to here
LVM2.2.03.38/daemons/lvmlockd/lvmlockd-core.c:7193:17: throw: if ‘close’ throws an exception...
LVM2.2.03.38/daemons/lvmlockd/lvmlockd-core.c:7193:17: danger: ‘pr_fd’ leaks here
# 7191|   		return 0;
# 7192|   	} else {
# 7193|-> 		close(pr_fd);
# 7194|   		close(pw_fd);
# 7195|   		helper_main(cr_fd, cw_fd, daemon_debug);

Error: GCC_ANALYZER_WARNING (CWE-775): [#def84]
LVM2.2.03.38/daemons/lvmlockd/lvmlockd-core.c:7193:17: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘pw_fd’
LVM2.2.03.38/daemons/lvmlockd/lvmlockd-core.c:7159:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/daemons/lvmlockd/lvmlockd-core.c:7164:9: branch_false: ...to here
LVM2.2.03.38/daemons/lvmlockd/lvmlockd-core.c:7167:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/daemons/lvmlockd/lvmlockd-core.c:7173:9: branch_false: ...to here
LVM2.2.03.38/daemons/lvmlockd/lvmlockd-core.c:7177:12: branch_false: following ‘false’ branch (when ‘pid >= 0’)...
LVM2.2.03.38/daemons/lvmlockd/lvmlockd-core.c:7185:12: branch_false: ...to here
LVM2.2.03.38/daemons/lvmlockd/lvmlockd-core.c:7185:12: branch_false: following ‘false’ branch (when ‘pid == 0’)...
LVM2.2.03.38/daemons/lvmlockd/lvmlockd-core.c:7193:17: branch_false: ...to here
LVM2.2.03.38/daemons/lvmlockd/lvmlockd-core.c:7193:17: throw: if ‘close’ throws an exception...
LVM2.2.03.38/daemons/lvmlockd/lvmlockd-core.c:7193:17: danger: ‘pw_fd’ leaks here
# 7191|   		return 0;
# 7192|   	} else {
# 7193|-> 		close(pr_fd);
# 7194|   		close(pw_fd);
# 7195|   		helper_main(cr_fd, cw_fd, daemon_debug);

Error: GCC_ANALYZER_WARNING (CWE-775): [#def85]
LVM2.2.03.38/daemons/lvmlockd/lvmlockd-core.c:7194:17: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘cr_fd’
LVM2.2.03.38/daemons/lvmlockd/lvmlockd-core.c:7159:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/daemons/lvmlockd/lvmlockd-core.c:7164:9: branch_false: ...to here
LVM2.2.03.38/daemons/lvmlockd/lvmlockd-core.c:7167:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/daemons/lvmlockd/lvmlockd-core.c:7173:9: branch_false: ...to here
LVM2.2.03.38/daemons/lvmlockd/lvmlockd-core.c:7177:12: branch_false: following ‘false’ branch (when ‘pid >= 0’)...
LVM2.2.03.38/daemons/lvmlockd/lvmlockd-core.c:7185:12: branch_false: ...to here
LVM2.2.03.38/daemons/lvmlockd/lvmlockd-core.c:7185:12: branch_false: following ‘false’ branch (when ‘pid == 0’)...
LVM2.2.03.38/daemons/lvmlockd/lvmlockd-core.c:7193:17: branch_false: ...to here
LVM2.2.03.38/daemons/lvmlockd/lvmlockd-core.c:7194:17: throw: if ‘close’ throws an exception...
LVM2.2.03.38/daemons/lvmlockd/lvmlockd-core.c:7194:17: danger: ‘cr_fd’ leaks here
# 7192|   	} else {
# 7193|   		close(pr_fd);
# 7194|-> 		close(pw_fd);
# 7195|   		helper_main(cr_fd, cw_fd, daemon_debug);
# 7196|   		exit(0);

Error: GCC_ANALYZER_WARNING (CWE-775): [#def86]
LVM2.2.03.38/daemons/lvmlockd/lvmlockd-core.c:7194:17: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘cw_fd’
LVM2.2.03.38/daemons/lvmlockd/lvmlockd-core.c:7159:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/daemons/lvmlockd/lvmlockd-core.c:7164:9: branch_false: ...to here
LVM2.2.03.38/daemons/lvmlockd/lvmlockd-core.c:7167:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/daemons/lvmlockd/lvmlockd-core.c:7173:9: branch_false: ...to here
LVM2.2.03.38/daemons/lvmlockd/lvmlockd-core.c:7177:12: branch_false: following ‘false’ branch (when ‘pid >= 0’)...
LVM2.2.03.38/daemons/lvmlockd/lvmlockd-core.c:7185:12: branch_false: ...to here
LVM2.2.03.38/daemons/lvmlockd/lvmlockd-core.c:7185:12: branch_false: following ‘false’ branch (when ‘pid == 0’)...
LVM2.2.03.38/daemons/lvmlockd/lvmlockd-core.c:7193:17: branch_false: ...to here
LVM2.2.03.38/daemons/lvmlockd/lvmlockd-core.c:7194:17: throw: if ‘close’ throws an exception...
LVM2.2.03.38/daemons/lvmlockd/lvmlockd-core.c:7194:17: danger: ‘cw_fd’ leaks here
# 7192|   	} else {
# 7193|   		close(pr_fd);
# 7194|-> 		close(pw_fd);
# 7195|   		helper_main(cr_fd, cw_fd, daemon_debug);
# 7196|   		exit(0);

Error: GCC_ANALYZER_WARNING (CWE-775): [#def87]
LVM2.2.03.38/daemons/lvmlockd/lvmlockd-core.c:7194:17: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘pw_fd’
LVM2.2.03.38/daemons/lvmlockd/lvmlockd-core.c:7159:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/daemons/lvmlockd/lvmlockd-core.c:7164:9: branch_false: ...to here
LVM2.2.03.38/daemons/lvmlockd/lvmlockd-core.c:7167:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/daemons/lvmlockd/lvmlockd-core.c:7173:9: branch_false: ...to here
LVM2.2.03.38/daemons/lvmlockd/lvmlockd-core.c:7177:12: branch_false: following ‘false’ branch (when ‘pid >= 0’)...
LVM2.2.03.38/daemons/lvmlockd/lvmlockd-core.c:7185:12: branch_false: ...to here
LVM2.2.03.38/daemons/lvmlockd/lvmlockd-core.c:7185:12: branch_false: following ‘false’ branch (when ‘pid == 0’)...
LVM2.2.03.38/daemons/lvmlockd/lvmlockd-core.c:7193:17: branch_false: ...to here
LVM2.2.03.38/daemons/lvmlockd/lvmlockd-core.c:7194:17: throw: if ‘close’ throws an exception...
LVM2.2.03.38/daemons/lvmlockd/lvmlockd-core.c:7194:17: danger: ‘pw_fd’ leaks here
# 7192|   	} else {
# 7193|   		close(pr_fd);
# 7194|-> 		close(pw_fd);
# 7195|   		helper_main(cr_fd, cw_fd, daemon_debug);
# 7196|   		exit(0);

Error: GCC_ANALYZER_WARNING (CWE-775): [#def88]
LVM2.2.03.38/daemons/lvmlockd/lvmlockd-core.c:7195:17: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘cr_fd’
LVM2.2.03.38/daemons/lvmlockd/lvmlockd-core.c:7159:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/daemons/lvmlockd/lvmlockd-core.c:7164:9: branch_false: ...to here
LVM2.2.03.38/daemons/lvmlockd/lvmlockd-core.c:7167:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/daemons/lvmlockd/lvmlockd-core.c:7173:9: branch_false: ...to here
LVM2.2.03.38/daemons/lvmlockd/lvmlockd-core.c:7177:12: branch_false: following ‘false’ branch (when ‘pid >= 0’)...
LVM2.2.03.38/daemons/lvmlockd/lvmlockd-core.c:7185:12: branch_false: ...to here
LVM2.2.03.38/daemons/lvmlockd/lvmlockd-core.c:7185:12: branch_false: following ‘false’ branch (when ‘pid == 0’)...
LVM2.2.03.38/daemons/lvmlockd/lvmlockd-core.c:7193:17: branch_false: ...to here
LVM2.2.03.38/daemons/lvmlockd/lvmlockd-core.c:7195:17: throw: if ‘helper_main’ throws an exception...
LVM2.2.03.38/daemons/lvmlockd/lvmlockd-core.c:7195:17: danger: ‘cr_fd’ leaks here
# 7193|   		close(pr_fd);
# 7194|   		close(pw_fd);
# 7195|-> 		helper_main(cr_fd, cw_fd, daemon_debug);
# 7196|   		exit(0);
# 7197|   	}

Error: GCC_ANALYZER_WARNING (CWE-775): [#def89]
LVM2.2.03.38/daemons/lvmlockd/lvmlockd-core.c:7195:17: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘cw_fd’
LVM2.2.03.38/daemons/lvmlockd/lvmlockd-core.c:7159:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/daemons/lvmlockd/lvmlockd-core.c:7164:9: branch_false: ...to here
LVM2.2.03.38/daemons/lvmlockd/lvmlockd-core.c:7167:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/daemons/lvmlockd/lvmlockd-core.c:7173:9: branch_false: ...to here
LVM2.2.03.38/daemons/lvmlockd/lvmlockd-core.c:7177:12: branch_false: following ‘false’ branch (when ‘pid >= 0’)...
LVM2.2.03.38/daemons/lvmlockd/lvmlockd-core.c:7185:12: branch_false: ...to here
LVM2.2.03.38/daemons/lvmlockd/lvmlockd-core.c:7185:12: branch_false: following ‘false’ branch (when ‘pid == 0’)...
LVM2.2.03.38/daemons/lvmlockd/lvmlockd-core.c:7193:17: branch_false: ...to here
LVM2.2.03.38/daemons/lvmlockd/lvmlockd-core.c:7195:17: throw: if ‘helper_main’ throws an exception...
LVM2.2.03.38/daemons/lvmlockd/lvmlockd-core.c:7195:17: danger: ‘cw_fd’ leaks here
# 7193|   		close(pr_fd);
# 7194|   		close(pw_fd);
# 7195|-> 		helper_main(cr_fd, cw_fd, daemon_debug);
# 7196|   		exit(0);
# 7197|   	}

Error: GCC_ANALYZER_WARNING (CWE-775): [#def90]
LVM2.2.03.38/daemons/lvmlockd/lvmlockd-dlm.c:115:17: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘open("/sys/kernel/config/dlm/cluster/cluster_name", 0)’
LVM2.2.03.38/daemons/lvmlockd/lvmlockd-dlm.c:107:14: acquire_resource: opened here
LVM2.2.03.38/daemons/lvmlockd/lvmlockd-dlm.c:108:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/daemons/lvmlockd/lvmlockd-dlm.c:113:14: branch_false: ...to here
LVM2.2.03.38/daemons/lvmlockd/lvmlockd-dlm.c:114:12: branch_true: following ‘true’ branch (when ‘rv < 0’)...
LVM2.2.03.38/daemons/lvmlockd/lvmlockd-dlm.c:115:17: branch_true: ...to here
LVM2.2.03.38/daemons/lvmlockd/lvmlockd-dlm.c:115:17: throw: if ‘log_level’ throws an exception...
LVM2.2.03.38/daemons/lvmlockd/lvmlockd-dlm.c:115:17: danger: ‘open("/sys/kernel/config/dlm/cluster/cluster_name", 0)’ leaks here; was opened at [(1)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/0)
#  113|   	rv = read(fd, clustername, MAX_ARGS);
#  114|   	if (rv < 0) {
#  115|-> 		log_error("read_cluster_name: cluster name read error %d, check dlm_controld", fd);
#  116|   		goto out;
#  117|   	}

Error: GCC_ANALYZER_WARNING (CWE-775): [#def91]
LVM2.2.03.38/daemons/lvmlockd/lvmlockd-dlm.c:118:20: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘open("/sys/kernel/config/dlm/cluster/cluster_name", 0)’
LVM2.2.03.38/daemons/lvmlockd/lvmlockd-dlm.c:107:14: acquire_resource: opened here
LVM2.2.03.38/daemons/lvmlockd/lvmlockd-dlm.c:108:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/daemons/lvmlockd/lvmlockd-dlm.c:113:14: branch_false: ...to here
LVM2.2.03.38/daemons/lvmlockd/lvmlockd-dlm.c:114:12: branch_false: following ‘false’ branch (when ‘rv >= 0’)...
LVM2.2.03.38/daemons/lvmlockd/lvmlockd-dlm.c:118:20: branch_false: ...to here
LVM2.2.03.38/daemons/lvmlockd/lvmlockd-dlm.c:121:12: branch_false: following ‘false’ branch (when ‘n’ is NULL)...
LVM2.2.03.38/daemons/lvmlockd/lvmlockd-dlm.c:124:1: branch_false: ...to here
LVM2.2.03.38/daemons/lvmlockd/lvmlockd-dlm.c:125:13: throw: if ‘close’ throws an exception...
LVM2.2.03.38/daemons/lvmlockd/lvmlockd-dlm.c:118:20: danger: ‘open("/sys/kernel/config/dlm/cluster/cluster_name", 0)’ leaks here; was opened at [(1)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/0)
#  116|   		goto out;
#  117|   	}
#  118|-> 	clustername[rv] = 0;
#  119|   
#  120|   	n = strstr(clustername, "\n");

Error: GCC_ANALYZER_WARNING (CWE-401): [#def92]
LVM2.2.03.38/daemons/lvmlockd/lvmlockd-dlm.c:242:22: warning[-Wanalyzer-malloc-leak]: leak of ‘opendir(&ls_comms_path)’
LVM2.2.03.38/daemons/lvmlockd/lvmlockd-dlm.c:239:24: acquire_memory: allocated here
LVM2.2.03.38/daemons/lvmlockd/lvmlockd-dlm.c:239:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/daemons/lvmlockd/lvmlockd-dlm.c:239:12: branch_false: ...to here
LVM2.2.03.38/daemons/lvmlockd/lvmlockd-dlm.c:242:22: throw: if ‘readdir’ throws an exception...
LVM2.2.03.38/daemons/lvmlockd/lvmlockd-dlm.c:242:22: danger: ‘opendir(&ls_comms_path)’ leaks here; was allocated at [(1)](sarif:/runs/0/results/2/codeFlows/0/threadFlows/0/locations/0)
#  240|   		return -ECONNREFUSED;
#  241|   
#  242|-> 	while ((de = readdir(ls_dir))) {
#  243|   		if (de->d_name[0] == '.')
#  244|   			continue;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def93]
LVM2.2.03.38/daemons/lvmlockd/lvmlockd-dlm.c:826:22: warning[-Wanalyzer-malloc-leak]: leak of ‘opendir(&ls_nodes_path)’
LVM2.2.03.38/daemons/lvmlockd/lvmlockd-dlm.c:816:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/daemons/lvmlockd/lvmlockd-dlm.c:819:9: branch_false: ...to here
LVM2.2.03.38/daemons/lvmlockd/lvmlockd-dlm.c:823:24: acquire_memory: allocated here
LVM2.2.03.38/daemons/lvmlockd/lvmlockd-dlm.c:823:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/daemons/lvmlockd/lvmlockd-dlm.c:823:12: branch_false: ...to here
LVM2.2.03.38/daemons/lvmlockd/lvmlockd-dlm.c:826:22: throw: if ‘readdir’ throws an exception...
LVM2.2.03.38/daemons/lvmlockd/lvmlockd-dlm.c:826:22: danger: ‘opendir(&ls_nodes_path)’ leaks here; was allocated at [(3)](sarif:/runs/0/results/3/codeFlows/0/threadFlows/0/locations/2)
#  824|   		return -ECONNREFUSED;
#  825|   
#  826|-> 	while ((de = readdir(ls_dir))) {
#  827|   		if (de->d_name[0] == '.')
#  828|   			continue;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def94]
LVM2.2.03.38/daemons/lvmlockd/lvmlockd-dlm.c:858:22: warning[-Wanalyzer-malloc-leak]: leak of ‘opendir("/sys/kernel/config/dlm/cluster/spaces")’
LVM2.2.03.38/daemons/lvmlockd/lvmlockd-dlm.c:855:24: acquire_memory: allocated here
LVM2.2.03.38/daemons/lvmlockd/lvmlockd-dlm.c:855:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/daemons/lvmlockd/lvmlockd-dlm.c:855:12: branch_false: ...to here
LVM2.2.03.38/daemons/lvmlockd/lvmlockd-dlm.c:858:22: throw: if ‘readdir’ throws an exception...
LVM2.2.03.38/daemons/lvmlockd/lvmlockd-dlm.c:858:22: danger: ‘opendir("/sys/kernel/config/dlm/cluster/spaces")’ leaks here; was allocated at [(1)](sarif:/runs/0/results/4/codeFlows/0/threadFlows/0/locations/0)
#  856|   		return -ECONNREFUSED;
#  857|   
#  858|-> 	while ((de = readdir(ls_dir))) {
#  859|   		if (de->d_name[0] == '.')
#  860|   			continue;

Error: GCC_ANALYZER_WARNING (CWE-688): [#def95]
LVM2.2.03.38/daemons/lvmlockd/lvmlockd-helper.c:140:9: warning[-Wanalyzer-possible-null-argument]: use of possibly-NULL ‘av[0]’ where non-null expected
LVM2.2.03.38/daemons/lvmlockd/lvmlockd-helper.c:86:21: branch_true: following ‘true’ branch (when ‘i != 33’)...
LVM2.2.03.38/daemons/lvmlockd/lvmlockd-helper.c:87:17: branch_true: ...to here
LVM2.2.03.38/daemons/lvmlockd/lvmlockd-helper.c:89:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/daemons/lvmlockd/lvmlockd-helper.c:93:9: branch_false: ...to here
LVM2.2.03.38/daemons/lvmlockd/lvmlockd-helper.c:99:21: branch_true: following ‘true’ branch (when ‘i < cmd_len’)...
LVM2.2.03.38/daemons/lvmlockd/lvmlockd-helper.c:100:29: branch_true: ...to here
LVM2.2.03.38/daemons/lvmlockd/lvmlockd-helper.c:100:20: branch_false: following ‘false’ branch...
LVM2.2.03.38/daemons/lvmlockd/lvmlockd-helper.c:103:20: branch_false: ...to here
LVM2.2.03.38/daemons/lvmlockd/lvmlockd-helper.c:103:20: branch_false: following ‘false’ branch (when ‘av_count != 32’)...
LVM2.2.03.38/daemons/lvmlockd/lvmlockd-helper.c:106:20: branch_false: ...to here
LVM2.2.03.38/daemons/lvmlockd/lvmlockd-helper.c:136:12: branch_true: following ‘true’ branch...
LVM2.2.03.38/daemons/lvmlockd/lvmlockd-helper.c:137:34: branch_true: ...to here
LVM2.2.03.38/daemons/lvmlockd/lvmlockd-helper.c:137:34: acquire_memory: this call could return NULL
LVM2.2.03.38/daemons/lvmlockd/lvmlockd-helper.c:140:9: danger: argument 1 (‘av[0]’) from [(13)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/12) could be NULL where non-null expected
#  138|   	}
#  139|   
#  140|-> 	execvp(av[0], av);
#  141|   }
#  142|   

Error: GCC_ANALYZER_WARNING (CWE-121): [#def96]
LVM2.2.03.38/daemons/lvmlockd/lvmlockd-internal.h:304:9: warning[-Wanalyzer-out-of-bounds]: stack-based buffer overflow
LVM2.2.03.38/daemons/lvmlockd/lvmlockd-core.c:6342:13: enter_function: entry to ‘adopt_locks’
LVM2.2.03.38/daemons/lvmlockd/lvmlockd-core.c:6362:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/daemons/lvmlockd/lvmlockd-core.c:6371:33: branch_false: ...to here
LVM2.2.03.38/daemons/lvmlockd/lvmlockd-core.c:6379:20: branch_false: following ‘false’ branch...
LVM2.2.03.38/daemons/lvmlockd/lvmlockd-core.c:6383:13: call_function: inlined call to ‘list_empty’ from ‘adopt_locks’
LVM2.2.03.38/daemons/lvmlockd/lvmlockd-core.c:6383:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/daemons/lvmlockd/lvmlockd-core.c:6392:14: branch_false: ...to here
LVM2.2.03.38/daemons/lvmlockd/lvmlockd-core.c:6392:14: call_function: calling ‘read_adopt_file’ from ‘adopt_locks’
#  302|   	new->next = next;
#  303|   	new->prev = prev;
#  304|-> 	prev->next = new;
#  305|   }
#  306|   

Error: GCC_ANALYZER_WARNING (CWE-126): [#def97]
LVM2.2.03.38/daemons/lvmlockd/lvmlockd-internal.h:315:9: warning[-Wanalyzer-out-of-bounds]: stack-based buffer over-read
LVM2.2.03.38/daemons/lvmlockd/lvmlockd-core.c:6342:13: enter_function: entry to ‘adopt_locks’
LVM2.2.03.38/daemons/lvmlockd/lvmlockd-core.c:6362:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/daemons/lvmlockd/lvmlockd-core.c:6371:33: branch_false: ...to here
LVM2.2.03.38/daemons/lvmlockd/lvmlockd-core.c:6379:20: branch_false: following ‘false’ branch...
LVM2.2.03.38/daemons/lvmlockd/lvmlockd-core.c:6383:13: call_function: inlined call to ‘list_empty’ from ‘adopt_locks’
LVM2.2.03.38/daemons/lvmlockd/lvmlockd-core.c:6383:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/daemons/lvmlockd/lvmlockd-core.c:6392:14: branch_false: ...to here
LVM2.2.03.38/daemons/lvmlockd/lvmlockd-core.c:6392:14: call_function: calling ‘read_adopt_file’ from ‘adopt_locks’
#  313|   static inline void list_add(struct list_head *new, struct list_head *head)
#  314|   {
#  315|-> 	__list_add(new, head, head->next);
#  316|   }
#  317|   

Error: GCC_ANALYZER_WARNING (CWE-775): [#def98]
LVM2.2.03.38/daemons/lvmlockd/lvmlockd-sanlock.c:429:13: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(&path, "w")’
LVM2.2.03.38/daemons/lvmlockd/lvmlockd-sanlock.c:414:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/daemons/lvmlockd/lvmlockd-sanlock.c:417:20: branch_false: ...to here
LVM2.2.03.38/daemons/lvmlockd/lvmlockd-sanlock.c:417:20: acquire_resource: opened here
LVM2.2.03.38/daemons/lvmlockd/lvmlockd-sanlock.c:417:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/daemons/lvmlockd/lvmlockd-sanlock.c:422:9: branch_false: ...to here
LVM2.2.03.38/daemons/lvmlockd/lvmlockd-sanlock.c:429:13: throw: if ‘fflush’ throws an exception...
LVM2.2.03.38/daemons/lvmlockd/lvmlockd-sanlock.c:429:13: danger: ‘fopen(&path, "w")’ leaks here; was opened at [(3)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/2)
#  427|   	fprintf(fp, "no_timeout %d\n", no_timeout);
#  428|   
#  429|-> 	if (fflush(fp))
#  430|   		log_warn("Failed to write/flush %s", path);
#  431|   	_fclose(fp, path);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def99]
LVM2.2.03.38/daemons/lvmlockd/lvmlockd-sanlock.c:429:13: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(&path, "w")’
LVM2.2.03.38/daemons/lvmlockd/lvmlockd-sanlock.c:414:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/daemons/lvmlockd/lvmlockd-sanlock.c:417:20: branch_false: ...to here
LVM2.2.03.38/daemons/lvmlockd/lvmlockd-sanlock.c:417:20: acquire_memory: allocated here
LVM2.2.03.38/daemons/lvmlockd/lvmlockd-sanlock.c:417:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/daemons/lvmlockd/lvmlockd-sanlock.c:422:9: branch_false: ...to here
LVM2.2.03.38/daemons/lvmlockd/lvmlockd-sanlock.c:429:13: throw: if ‘fflush’ throws an exception...
LVM2.2.03.38/daemons/lvmlockd/lvmlockd-sanlock.c:429:13: danger: ‘fopen(&path, "w")’ leaks here; was allocated at [(3)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/2)
#  427|   	fprintf(fp, "no_timeout %d\n", no_timeout);
#  428|   
#  429|-> 	if (fflush(fp))
#  430|   		log_warn("Failed to write/flush %s", path);
#  431|   	_fclose(fp, path);

Error: GCC_ANALYZER_WARNING (CWE-775): [#def100]
LVM2.2.03.38/daemons/lvmlockd/lvmlockd-sanlock.c:430:17: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(&path, "w")’
LVM2.2.03.38/daemons/lvmlockd/lvmlockd-sanlock.c:414:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/daemons/lvmlockd/lvmlockd-sanlock.c:417:20: branch_false: ...to here
LVM2.2.03.38/daemons/lvmlockd/lvmlockd-sanlock.c:417:20: acquire_resource: opened here
LVM2.2.03.38/daemons/lvmlockd/lvmlockd-sanlock.c:417:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/daemons/lvmlockd/lvmlockd-sanlock.c:422:9: branch_false: ...to here
LVM2.2.03.38/daemons/lvmlockd/lvmlockd-sanlock.c:429:12: branch_true: following ‘true’ branch...
LVM2.2.03.38/daemons/lvmlockd/lvmlockd-sanlock.c:430:17: branch_true: ...to here
LVM2.2.03.38/daemons/lvmlockd/lvmlockd-sanlock.c:430:17: throw: if ‘log_level’ throws an exception...
LVM2.2.03.38/daemons/lvmlockd/lvmlockd-sanlock.c:430:17: danger: ‘fopen(&path, "w")’ leaks here; was opened at [(3)](sarif:/runs/0/results/2/codeFlows/0/threadFlows/0/locations/2)
#  428|   
#  429|   	if (fflush(fp))
#  430|-> 		log_warn("Failed to write/flush %s", path);
#  431|   	_fclose(fp, path);
#  432|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def101]
LVM2.2.03.38/daemons/lvmlockd/lvmlockd-sanlock.c:430:17: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(&path, "w")’
LVM2.2.03.38/daemons/lvmlockd/lvmlockd-sanlock.c:414:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/daemons/lvmlockd/lvmlockd-sanlock.c:417:20: branch_false: ...to here
LVM2.2.03.38/daemons/lvmlockd/lvmlockd-sanlock.c:417:20: acquire_memory: allocated here
LVM2.2.03.38/daemons/lvmlockd/lvmlockd-sanlock.c:417:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/daemons/lvmlockd/lvmlockd-sanlock.c:422:9: branch_false: ...to here
LVM2.2.03.38/daemons/lvmlockd/lvmlockd-sanlock.c:429:12: branch_true: following ‘true’ branch...
LVM2.2.03.38/daemons/lvmlockd/lvmlockd-sanlock.c:430:17: branch_true: ...to here
LVM2.2.03.38/daemons/lvmlockd/lvmlockd-sanlock.c:430:17: throw: if ‘log_level’ throws an exception...
LVM2.2.03.38/daemons/lvmlockd/lvmlockd-sanlock.c:430:17: danger: ‘fopen(&path, "w")’ leaks here; was allocated at [(3)](sarif:/runs/0/results/3/codeFlows/0/threadFlows/0/locations/2)
#  428|   
#  429|   	if (fflush(fp))
#  430|-> 		log_warn("Failed to write/flush %s", path);
#  431|   	_fclose(fp, path);
#  432|   

Error: COMPILER_WARNING: [#def102]
LVM2.2.03.38/daemons/lvmlockd/lvmlockd-sanlock.c: scope_hint: In function ‘lm_init_vg_sanlock’
LVM2.2.03.38/daemons/lvmlockd/lvmlockd-sanlock.c:723:13: warning[-Wunused-but-set-variable=]: variable ‘i’ set but not used
#  723 |         int i, rv;
#      |             ^
#  721|   	int align_size = 0;
#  722|   	int align_mb = 0;
#  723|-> 	int i, rv;
#  724|   
#  725|   	if (other_args && (lockd_lockargs_get_user_flags(other_args, &lock_args_flags) < 0)) {

Error: COMPILER_WARNING: [#def103]
LVM2.2.03.38/daemons/lvmlockd/lvmlockd-sanlock.c: scope_hint: In function ‘lm_rename_vg_sanlock’
LVM2.2.03.38/daemons/lvmlockd/lvmlockd-sanlock.c:1108:13: warning[-Wunused-but-set-variable=]: variable ‘i’ set but not used
# 1108 |         int i, rv;
#      |             ^
# 1106|   	int sector_size = 0;
# 1107|   	int align_size = 0;
# 1108|-> 	int i, rv;
# 1109|   
# 1110|   	memset(&disk, 0, sizeof(disk));

Error: GCC_ANALYZER_WARNING (CWE-401): [#def104]
LVM2.2.03.38/daemons/lvmlockd/lvmlockd-sanlock.c:1347:14: warning[-Wanalyzer-malloc-leak]: leak of ‘rs_args’
LVM2.2.03.38/daemons/lvmlockd/lvmlockd-sanlock.c:1321:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/daemons/lvmlockd/lvmlockd-sanlock.c:1324:19: branch_false: ...to here
LVM2.2.03.38/daemons/lvmlockd/lvmlockd-sanlock.c:1324:19: acquire_memory: allocated here
LVM2.2.03.38/daemons/lvmlockd/lvmlockd-sanlock.c:1325:12: branch_false: following ‘false’ branch (when ‘rs_args’ is non-NULL)...
LVM2.2.03.38/daemons/lvmlockd/lvmlockd-sanlock.c:1328:9: branch_false: ...to here
LVM2.2.03.38/daemons/lvmlockd/lvmlockd-sanlock.c:1347:14: throw: if ‘sanlock_acquire’ throws an exception...
LVM2.2.03.38/daemons/lvmlockd/lvmlockd-sanlock.c:1347:14: danger: ‘rs_args’ leaks here; was allocated at [(3)](sarif:/runs/0/results/4/codeFlows/0/threadFlows/0/locations/2)
# 1345|   	rd2.rs.flags = lms->rs_flags;
# 1346|   
# 1347|-> 	rv = sanlock_acquire(lms->sock, -1, 0, 1, &rs1, NULL);
# 1348|   	if (rv < 0) {
# 1349|   		log_error("S %s ex_disable_gl_san acquire error %d",

Error: GCC_ANALYZER_WARNING (CWE-401): [#def105]
LVM2.2.03.38/daemons/lvmlockd/lvmlockd-sanlock.c:1349:17: warning[-Wanalyzer-malloc-leak]: leak of ‘rs_args’
LVM2.2.03.38/daemons/lvmlockd/lvmlockd-sanlock.c:1321:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/daemons/lvmlockd/lvmlockd-sanlock.c:1324:19: branch_false: ...to here
LVM2.2.03.38/daemons/lvmlockd/lvmlockd-sanlock.c:1324:19: acquire_memory: allocated here
LVM2.2.03.38/daemons/lvmlockd/lvmlockd-sanlock.c:1325:12: branch_false: following ‘false’ branch (when ‘rs_args’ is non-NULL)...
LVM2.2.03.38/daemons/lvmlockd/lvmlockd-sanlock.c:1328:9: branch_false: ...to here
LVM2.2.03.38/daemons/lvmlockd/lvmlockd-sanlock.c:1348:12: branch_true: following ‘true’ branch...
LVM2.2.03.38/daemons/lvmlockd/lvmlockd-sanlock.c:1349:17: branch_true: ...to here
LVM2.2.03.38/daemons/lvmlockd/lvmlockd-sanlock.c:1349:17: throw: if ‘log_level’ throws an exception...
LVM2.2.03.38/daemons/lvmlockd/lvmlockd-sanlock.c:1349:17: danger: ‘rs_args’ leaks here; was allocated at [(3)](sarif:/runs/0/results/5/codeFlows/0/threadFlows/0/locations/2)
# 1347|   	rv = sanlock_acquire(lms->sock, -1, 0, 1, &rs1, NULL);
# 1348|   	if (rv < 0) {
# 1349|-> 		log_error("S %s ex_disable_gl_san acquire error %d",
# 1350|   			  ls->name, rv);
# 1351|   		goto out;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def106]
LVM2.2.03.38/daemons/lvmlockd/lvmlockd-sanlock.c:1357:14: warning[-Wanalyzer-malloc-leak]: leak of ‘rs_args’
LVM2.2.03.38/daemons/lvmlockd/lvmlockd-sanlock.c:1321:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/daemons/lvmlockd/lvmlockd-sanlock.c:1324:19: branch_false: ...to here
LVM2.2.03.38/daemons/lvmlockd/lvmlockd-sanlock.c:1324:19: acquire_memory: allocated here
LVM2.2.03.38/daemons/lvmlockd/lvmlockd-sanlock.c:1325:12: branch_false: following ‘false’ branch (when ‘rs_args’ is non-NULL)...
LVM2.2.03.38/daemons/lvmlockd/lvmlockd-sanlock.c:1328:9: branch_false: ...to here
LVM2.2.03.38/daemons/lvmlockd/lvmlockd-sanlock.c:1348:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/daemons/lvmlockd/lvmlockd-sanlock.c:1354:9: branch_false: ...to here
LVM2.2.03.38/daemons/lvmlockd/lvmlockd-sanlock.c:1357:14: throw: if ‘sanlock_release’ throws an exception...
LVM2.2.03.38/daemons/lvmlockd/lvmlockd-sanlock.c:1357:14: danger: ‘rs_args’ leaks here; was allocated at [(3)](sarif:/runs/0/results/6/codeFlows/0/threadFlows/0/locations/2)
# 1355|   	rs_args[1] = rs2;
# 1356|   
# 1357|-> 	rv = sanlock_release(lms->sock, -1, SANLK_REL_RENAME, 2, rs_args);
# 1358|   	if (rv < 0) {
# 1359|   		log_error("S %s ex_disable_gl_san release_rename error %d",

Error: GCC_ANALYZER_WARNING (CWE-401): [#def107]
LVM2.2.03.38/daemons/lvmlockd/lvmlockd-sanlock.c:2521:17: warning[-Wanalyzer-malloc-leak]: leak of ‘res_args’
LVM2.2.03.38/daemons/lvmlockd/lvmlockd-sanlock.c:2510:20: acquire_memory: allocated here
LVM2.2.03.38/daemons/lvmlockd/lvmlockd-sanlock.c:2511:12: branch_false: following ‘false’ branch (when ‘res_args’ is non-NULL)...
LVM2.2.03.38/daemons/lvmlockd/lvmlockd-sanlock.c:2514:9: branch_false: ...to here
LVM2.2.03.38/daemons/lvmlockd/lvmlockd-sanlock.c:2520:12: branch_true: following ‘true’ branch...
LVM2.2.03.38/daemons/lvmlockd/lvmlockd-sanlock.c:2521:17: branch_true: ...to here
LVM2.2.03.38/daemons/lvmlockd/lvmlockd-sanlock.c:2521:17: throw: if ‘log_level’ throws an exception...
LVM2.2.03.38/daemons/lvmlockd/lvmlockd-sanlock.c:2521:17: danger: ‘res_args’ leaks here; was allocated at [(1)](sarif:/runs/0/results/7/codeFlows/0/threadFlows/0/locations/0)
# 2519|   
# 2520|   	if (memcmp(res1->name, r->name, SANLK_NAME_LEN))
# 2521|-> 		log_error("%s:%s unlock_san release rename bad name %.48s", ls->name, r->name, res1->name);
# 2522|   
# 2523|   	strcpy_name_len(res2->name, "invalid_removed", SANLK_NAME_LEN);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def108]
LVM2.2.03.38/daemons/lvmlockd/lvmlockd-sanlock.c:2528:14: warning[-Wanalyzer-malloc-leak]: leak of ‘res_args’
LVM2.2.03.38/daemons/lvmlockd/lvmlockd-sanlock.c:2510:20: acquire_memory: allocated here
LVM2.2.03.38/daemons/lvmlockd/lvmlockd-sanlock.c:2511:12: branch_false: following ‘false’ branch (when ‘res_args’ is non-NULL)...
LVM2.2.03.38/daemons/lvmlockd/lvmlockd-sanlock.c:2514:9: branch_false: ...to here
LVM2.2.03.38/daemons/lvmlockd/lvmlockd-sanlock.c:2528:14: throw: if ‘sanlock_release’ throws an exception...
LVM2.2.03.38/daemons/lvmlockd/lvmlockd-sanlock.c:2528:14: danger: ‘res_args’ leaks here; was allocated at [(1)](sarif:/runs/0/results/8/codeFlows/0/threadFlows/0/locations/0)
# 2526|   	res_args[1] = res2;
# 2527|   
# 2528|-> 	rv = sanlock_release(lms->sock, -1, SANLK_REL_RENAME, 2, res_args);
# 2529|   	if (rv < 0) {
# 2530|   		log_error("%s:%s unlock_san release rename error %d", ls->name, r->name, rv);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def109]
LVM2.2.03.38/daemons/lvmpolld/lvmpolld-core.c:239:21: warning[-Wanalyzer-malloc-leak]: leak of ‘<unknown>’
LVM2.2.03.38/daemons/lvmpolld/lvmpolld-core.c:373:14: enter_function: entry to ‘fork_and_poll’
LVM2.2.03.38/daemons/lvmpolld/lvmpolld-core.c:388:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/daemons/lvmpolld/lvmpolld-core.c:393:14: branch_false: ...to here
LVM2.2.03.38/daemons/lvmpolld/lvmpolld-core.c:393:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/daemons/lvmpolld/lvmpolld-core.c:410:12: branch_false: following ‘false’ branch (when ‘r != 0’)...
LVM2.2.03.38/daemons/lvmpolld/lvmpolld-core.c:423:20: branch_false: ...to here
LVM2.2.03.38/daemons/lvmpolld/lvmpolld-core.c:423:20: branch_false: following ‘false’ branch (when ‘r != -1’)...
LVM2.2.03.38/daemons/lvmpolld/lvmpolld-core.c:429:17: branch_false: ...to here
LVM2.2.03.38/daemons/lvmpolld/lvmpolld-core.c:434:20: branch_false: following ‘false’ branch...
LVM2.2.03.38/daemons/lvmpolld/lvmpolld-core.c:439:17: branch_false: ...to here
LVM2.2.03.38/daemons/lvmpolld/lvmpolld-core.c:441:20: branch_false: following ‘false’ branch...
LVM2.2.03.38/daemons/lvmpolld/lvmpolld-core.c:446:17: branch_false: ...to here
LVM2.2.03.38/daemons/lvmpolld/lvmpolld-core.c:448:25: call_function: calling ‘poll_for_output’ from ‘fork_and_poll’
#  237|   
#  238|   	while (1) {
#  239|-> 		r = poll(fds, 2, pdlv_get_timeout(pdlv) * 1000);
#  240|   
#  241|   		DEBUGLOG(pdlv->ls, "%s: %s %d", PD_LOG_PREFIX, "poll() returned", r);

Error: GCC_ANALYZER_WARNING (CWE-775): [#def110]
LVM2.2.03.38/daemons/lvmpolld/lvmpolld-core.c:414:20: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘dup2(outfd, 1)’
LVM2.2.03.38/daemons/lvmpolld/lvmpolld-core.c:388:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/daemons/lvmpolld/lvmpolld-core.c:393:14: branch_false: ...to here
LVM2.2.03.38/daemons/lvmpolld/lvmpolld-core.c:393:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/daemons/lvmpolld/lvmpolld-core.c:410:12: branch_true: following ‘true’ branch (when ‘r == 0’)...
LVM2.2.03.38/daemons/lvmpolld/lvmpolld-core.c:414:22: branch_true: ...to here
LVM2.2.03.38/daemons/lvmpolld/lvmpolld-core.c:414:22: acquire_resource: opened here
LVM2.2.03.38/daemons/lvmpolld/lvmpolld-core.c:414:20: danger: ‘dup2(outfd, 1)’ leaks here; was opened at [(7)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/6)
#  412|   		/* !!! Do not touch any posix thread primitives !!! */
#  413|   
#  414|-> 		if ((dup2(outfd, STDOUT_FILENO ) != STDOUT_FILENO) ||
#  415|   		    (dup2(errfd, STDERR_FILENO ) != STDERR_FILENO))
#  416|   			_exit(LVMPD_RET_DUP_FAILED);

Error: GCC_ANALYZER_WARNING (CWE-775): [#def111]
LVM2.2.03.38/daemons/lvmpolld/lvmpolld-core.c:414:21: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘dup2(errfd, 2)’
LVM2.2.03.38/daemons/lvmpolld/lvmpolld-core.c:388:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/daemons/lvmpolld/lvmpolld-core.c:393:14: branch_false: ...to here
LVM2.2.03.38/daemons/lvmpolld/lvmpolld-core.c:393:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/daemons/lvmpolld/lvmpolld-core.c:410:12: branch_true: following ‘true’ branch (when ‘r == 0’)...
LVM2.2.03.38/daemons/lvmpolld/lvmpolld-core.c:414:22: branch_true: ...to here
LVM2.2.03.38/daemons/lvmpolld/lvmpolld-core.c:414:20: branch_false: following ‘false’ branch...
LVM2.2.03.38/daemons/lvmpolld/lvmpolld-core.c:415:22: branch_false: ...to here
LVM2.2.03.38/daemons/lvmpolld/lvmpolld-core.c:415:22: acquire_resource: opened here
LVM2.2.03.38/daemons/lvmpolld/lvmpolld-core.c:414:21: danger: ‘dup2(errfd, 2)’ leaks here; was opened at [(9)](sarif:/runs/0/results/2/codeFlows/0/threadFlows/0/locations/8)
#  412|   		/* !!! Do not touch any posix thread primitives !!! */
#  413|   
#  414|-> 		if ((dup2(outfd, STDOUT_FILENO ) != STDOUT_FILENO) ||
#  415|   		    (dup2(errfd, STDERR_FILENO ) != STDERR_FILENO))
#  416|   			_exit(LVMPD_RET_DUP_FAILED);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def112]
LVM2.2.03.38/daemons/lvmpolld/lvmpolld-data-utils.c:34:13: warning[-Wanalyzer-malloc-leak]: leak of ‘name’
LVM2.2.03.38/daemons/lvmpolld/lvmpolld-data-utils.c:30:25: acquire_memory: allocated here
LVM2.2.03.38/daemons/lvmpolld/lvmpolld-data-utils.c:31:12: branch_false: following ‘false’ branch (when ‘name’ is non-NULL)...
LVM2.2.03.38/daemons/lvmpolld/lvmpolld-data-utils.c:34:13: branch_false: ...to here
LVM2.2.03.38/daemons/lvmpolld/lvmpolld-data-utils.c:34:13: throw: if ‘dm_snprintf’ throws an exception...
LVM2.2.03.38/daemons/lvmpolld/lvmpolld-data-utils.c:34:13: danger: ‘name’ leaks here; was allocated at [(1)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/0)
#   32|   		return NULL;
#   33|   
#   34|-> 	if (dm_snprintf(name, l, "%s/%s", vgname, lvname) < 0) {
#   35|   		free(name);
#   36|   		name = NULL;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def113]
LVM2.2.03.38/daemons/lvmpolld/lvmpolld-data-utils.c:34:13: warning[-Wanalyzer-malloc-leak]: leak of ‘tmp.devicesfile’
LVM2.2.03.38/daemons/lvmpolld/lvmpolld-data-utils.c:103:21: enter_function: entry to ‘pdlv_create’
LVM2.2.03.38/daemons/lvmpolld/lvmpolld-data-utils.c:115:32: branch_true: following ‘true’ branch (when ‘devicesfile’ is non-NULL)...
LVM2.2.03.38/daemons/lvmpolld/lvmpolld-data-utils.c:115:46: branch_true: ...to here
LVM2.2.03.38/daemons/lvmpolld/lvmpolld-data-utils.c:115:46: acquire_memory: allocated here
LVM2.2.03.38/daemons/lvmpolld/lvmpolld-data-utils.c:114:27: call_function: calling ‘_construct_full_lvname’ from ‘pdlv_create’
#   32|   		return NULL;
#   33|   
#   34|-> 	if (dm_snprintf(name, l, "%s/%s", vgname, lvname) < 0) {
#   35|   		free(name);
#   36|   		name = NULL;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def114]
LVM2.2.03.38/daemons/lvmpolld/lvmpolld-data-utils.c:34:13: warning[-Wanalyzer-malloc-leak]: leak of ‘tmp.lvmpolld_id’
LVM2.2.03.38/daemons/lvmpolld/lvmpolld-data-utils.c:103:21: enter_function: entry to ‘pdlv_create’
LVM2.2.03.38/daemons/lvmpolld/lvmpolld-data-utils.c:113:32: acquire_memory: allocated here
LVM2.2.03.38/daemons/lvmpolld/lvmpolld-data-utils.c:115:32: branch_false: following ‘false’ branch (when ‘devicesfile’ is NULL)...
LVM2.2.03.38/daemons/lvmpolld/lvmpolld-data-utils.c:110:28: branch_false: ...to here
LVM2.2.03.38/daemons/lvmpolld/lvmpolld-data-utils.c:114:27: call_function: calling ‘_construct_full_lvname’ from ‘pdlv_create’
#   32|   		return NULL;
#   33|   
#   34|-> 	if (dm_snprintf(name, l, "%s/%s", vgname, lvname) < 0) {
#   35|   		free(name);
#   36|   		name = NULL;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def115]
LVM2.2.03.38/daemons/lvmpolld/lvmpolld-data-utils.c:57:23: warning[-Wanalyzer-malloc-leak]: leak of ‘env’
LVM2.2.03.38/daemons/lvmpolld/lvmpolld-data-utils.c:50:30: acquire_memory: allocated here
LVM2.2.03.38/daemons/lvmpolld/lvmpolld-data-utils.c:52:12: branch_false: following ‘false’ branch (when ‘env’ is non-NULL)...
LVM2.2.03.38/daemons/lvmpolld/lvmpolld-data-utils.c:55:9: branch_false: ...to here
LVM2.2.03.38/daemons/lvmpolld/lvmpolld-data-utils.c:57:12: branch_true: following ‘true’ branch (when ‘sysdir’ is non-NULL)...
LVM2.2.03.38/daemons/lvmpolld/lvmpolld-data-utils.c:57:23: branch_true: ...to here
LVM2.2.03.38/daemons/lvmpolld/lvmpolld-data-utils.c:57:23: throw: if ‘dm_snprintf’ throws an exception...
LVM2.2.03.38/daemons/lvmpolld/lvmpolld-data-utils.c:57:23: danger: ‘env’ leaks here; was allocated at [(1)](sarif:/runs/0/results/3/codeFlows/0/threadFlows/0/locations/0)
#   55|   	*env = '\0';
#   56|   
#   57|-> 	if (sysdir && dm_snprintf(env, l, "%s%s", LVM_SYSTEM_DIR, sysdir) < 0) {
#   58|   		free(env);
#   59|   		env = NULL;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def116]
LVM2.2.03.38/daemons/lvmpolld/lvmpolld-data-utils.c:57:23: warning[-Wanalyzer-malloc-leak]: leak of ‘tmp.devicesfile’
LVM2.2.03.38/daemons/lvmpolld/lvmpolld-data-utils.c:103:21: enter_function: entry to ‘pdlv_create’
LVM2.2.03.38/daemons/lvmpolld/lvmpolld-data-utils.c:115:32: branch_true: following ‘true’ branch (when ‘devicesfile’ is non-NULL)...
LVM2.2.03.38/daemons/lvmpolld/lvmpolld-data-utils.c:115:46: branch_true: ...to here
LVM2.2.03.38/daemons/lvmpolld/lvmpolld-data-utils.c:115:46: acquire_memory: allocated here
LVM2.2.03.38/daemons/lvmpolld/lvmpolld-data-utils.c:116:39: call_function: calling ‘_construct_lvm_system_dir_env’ from ‘pdlv_create’
#   55|   	*env = '\0';
#   56|   
#   57|-> 	if (sysdir && dm_snprintf(env, l, "%s%s", LVM_SYSTEM_DIR, sysdir) < 0) {
#   58|   		free(env);
#   59|   		env = NULL;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def117]
LVM2.2.03.38/daemons/lvmpolld/lvmpolld-data-utils.c:57:23: warning[-Wanalyzer-malloc-leak]: leak of ‘tmp.lvmpolld_id’
LVM2.2.03.38/daemons/lvmpolld/lvmpolld-data-utils.c:103:21: enter_function: entry to ‘pdlv_create’
LVM2.2.03.38/daemons/lvmpolld/lvmpolld-data-utils.c:113:32: acquire_memory: allocated here
LVM2.2.03.38/daemons/lvmpolld/lvmpolld-data-utils.c:115:32: branch_false: following ‘false’ branch (when ‘devicesfile’ is NULL)...
LVM2.2.03.38/daemons/lvmpolld/lvmpolld-data-utils.c:110:28: branch_false: ...to here
LVM2.2.03.38/daemons/lvmpolld/lvmpolld-data-utils.c:116:39: call_function: calling ‘_construct_lvm_system_dir_env’ from ‘pdlv_create’
#   55|   	*env = '\0';
#   56|   
#   57|-> 	if (sysdir && dm_snprintf(env, l, "%s%s", LVM_SYSTEM_DIR, sysdir) < 0) {
#   58|   		free(env);
#   59|   		env = NULL;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def118]
LVM2.2.03.38/daemons/lvmpolld/lvmpolld-data-utils.c:57:23: warning[-Wanalyzer-malloc-leak]: leak of ‘tmp.sinterval’
LVM2.2.03.38/daemons/lvmpolld/lvmpolld-data-utils.c:103:21: enter_function: entry to ‘pdlv_create’
LVM2.2.03.38/daemons/lvmpolld/lvmpolld-data-utils.c:115:32: branch_false: following ‘false’ branch (when ‘devicesfile’ is NULL)...
LVM2.2.03.38/daemons/lvmpolld/lvmpolld-data-utils.c:110:28: branch_false: ...to here
LVM2.2.03.38/daemons/lvmpolld/lvmpolld-data-utils.c:114:27: call_function: calling ‘_construct_full_lvname’ from ‘pdlv_create’
LVM2.2.03.38/daemons/lvmpolld/lvmpolld-data-utils.c:114:27: return_function: returning to ‘pdlv_create’ from ‘_construct_full_lvname’
LVM2.2.03.38/daemons/lvmpolld/lvmpolld-data-utils.c:117:30: acquire_memory: allocated here
LVM2.2.03.38/daemons/lvmpolld/lvmpolld-data-utils.c:116:39: call_function: calling ‘_construct_lvm_system_dir_env’ from ‘pdlv_create’
#   55|   	*env = '\0';
#   56|   
#   57|-> 	if (sysdir && dm_snprintf(env, l, "%s%s", LVM_SYSTEM_DIR, sysdir) < 0) {
#   58|   		free(env);
#   59|   		env = NULL;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def119]
LVM2.2.03.38/daemons/lvmpolld/lvmpolld-data-utils.c:81:22: warning[-Wanalyzer-malloc-leak]: leak of ‘id’
LVM2.2.03.38/daemons/lvmpolld/lvmpolld-data-utils.c:77:23: acquire_memory: allocated here
LVM2.2.03.38/daemons/lvmpolld/lvmpolld-data-utils.c:78:12: branch_false: following ‘false’ branch (when ‘id’ is non-NULL)...
LVM2.2.03.38/daemons/lvmpolld/lvmpolld-data-utils.c:81:13: branch_false: ...to here
LVM2.2.03.38/daemons/lvmpolld/lvmpolld-data-utils.c:81:13: branch_true: following ‘true’ branch (when ‘sysdir’ is non-NULL)...
LVM2.2.03.38/daemons/lvmpolld/lvmpolld-data-utils.c:81:22: branch_true: ...to here
LVM2.2.03.38/daemons/lvmpolld/lvmpolld-data-utils.c:81:22: throw: if ‘dm_snprintf’ throws an exception...
LVM2.2.03.38/daemons/lvmpolld/lvmpolld-data-utils.c:81:22: danger: ‘id’ leaks here; was allocated at [(1)](sarif:/runs/0/results/7/codeFlows/0/threadFlows/0/locations/0)
#   79|   		return NULL;
#   80|   
#   81|-> 	r = sysdir ? dm_snprintf(id, l, "%s%s", sysdir, uuid) :
#   82|   		     dm_snprintf(id, l, "%s", uuid);
#   83|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def120]
LVM2.2.03.38/daemons/lvmpolld/lvmpolld-data-utils.c:82:22: warning[-Wanalyzer-malloc-leak]: leak of ‘id’
LVM2.2.03.38/daemons/lvmpolld/lvmpolld-data-utils.c:77:23: acquire_memory: allocated here
LVM2.2.03.38/daemons/lvmpolld/lvmpolld-data-utils.c:78:12: branch_false: following ‘false’ branch (when ‘id’ is non-NULL)...
LVM2.2.03.38/daemons/lvmpolld/lvmpolld-data-utils.c:81:13: branch_false: ...to here
LVM2.2.03.38/daemons/lvmpolld/lvmpolld-data-utils.c:81:13: branch_false: following ‘false’ branch (when ‘sysdir’ is NULL)...
LVM2.2.03.38/daemons/lvmpolld/lvmpolld-data-utils.c:82:22: branch_false: ...to here
LVM2.2.03.38/daemons/lvmpolld/lvmpolld-data-utils.c:82:22: throw: if ‘dm_snprintf’ throws an exception...
LVM2.2.03.38/daemons/lvmpolld/lvmpolld-data-utils.c:82:22: danger: ‘id’ leaks here; was allocated at [(1)](sarif:/runs/0/results/8/codeFlows/0/threadFlows/0/locations/0)
#   80|   
#   81|   	r = sysdir ? dm_snprintf(id, l, "%s%s", sysdir, uuid) :
#   82|-> 		     dm_snprintf(id, l, "%s", uuid);
#   83|   
#   84|   	if (r < 0) {

Error: GCC_ANALYZER_WARNING (CWE-401): [#def121]
LVM2.2.03.38/daemons/lvmpolld/lvmpolld-data-utils.c:204:23: warning[-Wanalyzer-malloc-leak]: leak of ‘pdst’
LVM2.2.03.38/daemons/lvmpolld/lvmpolld-data-utils.c:200:65: acquire_memory: allocated here
LVM2.2.03.38/daemons/lvmpolld/lvmpolld-data-utils.c:201:12: branch_false: following ‘false’ branch (when ‘pdst’ is non-NULL)...
LVM2.2.03.38/daemons/lvmpolld/lvmpolld-data-utils.c:204:23: branch_false: ...to here
LVM2.2.03.38/daemons/lvmpolld/lvmpolld-data-utils.c:204:23: throw: if ‘dm_hash_create’ throws an exception...
LVM2.2.03.38/daemons/lvmpolld/lvmpolld-data-utils.c:204:23: danger: ‘pdst’ leaks here; was allocated at [(1)](sarif:/runs/0/results/9/codeFlows/0/threadFlows/0/locations/0)
#  202|   		return NULL;
#  203|   
#  204|-> 	pdst->store = dm_hash_create(32);
#  205|   	if (!pdst->store)
#  206|   		goto err_hash;

Error: GCC_ANALYZER_WARNING (CWE-775): [#def122]
LVM2.2.03.38/daemons/lvmpolld/lvmpolld-data-utils.c:348:13: warning[-Wanalyzer-fd-leak]: leak of file descriptor
LVM2.2.03.38/daemons/lvmpolld/lvmpolld-data-utils.c:334:12: branch_false: following ‘false’ branch (when ‘data’ is non-NULL)...
LVM2.2.03.38/daemons/lvmpolld/lvmpolld-data-utils.c:337:9: branch_false: ...to here
LVM2.2.03.38/daemons/lvmpolld/lvmpolld-data-utils.c:343:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/daemons/lvmpolld/lvmpolld-data-utils.c:343:41: branch_false: ...to here
LVM2.2.03.38/daemons/lvmpolld/lvmpolld-data-utils.c:343:13: branch_false: following ‘false’ branch...
LVM2.2.03.38/daemons/lvmpolld/lvmpolld-data-utils.c:348:13: branch_false: ...to here
LVM2.2.03.38/daemons/lvmpolld/lvmpolld-data-utils.c:348:13: throw: if ‘fcntl’ throws an exception...
LVM2.2.03.38/daemons/lvmpolld/lvmpolld-data-utils.c:348:13: danger: leaks here
#  346|   	}
#  347|   
#  348|-> 	if (fcntl(data->outpipe[0], F_SETFD, FD_CLOEXEC) ||
#  349|   	    fcntl(data->outpipe[1], F_SETFD, FD_CLOEXEC) ||
#  350|   	    fcntl(data->errpipe[0], F_SETFD, FD_CLOEXEC) ||

Error: GCC_ANALYZER_WARNING (CWE-401): [#def123]
LVM2.2.03.38/daemons/lvmpolld/lvmpolld-data-utils.c:348:13: warning[-Wanalyzer-malloc-leak]: leak of ‘data’
LVM2.2.03.38/daemons/lvmpolld/lvmpolld-data-utils.c:333:77: acquire_memory: allocated here
LVM2.2.03.38/daemons/lvmpolld/lvmpolld-data-utils.c:334:12: branch_false: following ‘false’ branch (when ‘data’ is non-NULL)...
LVM2.2.03.38/daemons/lvmpolld/lvmpolld-data-utils.c:337:9: branch_false: ...to here
LVM2.2.03.38/daemons/lvmpolld/lvmpolld-data-utils.c:343:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/daemons/lvmpolld/lvmpolld-data-utils.c:343:41: branch_false: ...to here
LVM2.2.03.38/daemons/lvmpolld/lvmpolld-data-utils.c:343:13: branch_false: following ‘false’ branch...
LVM2.2.03.38/daemons/lvmpolld/lvmpolld-data-utils.c:348:13: branch_false: ...to here
LVM2.2.03.38/daemons/lvmpolld/lvmpolld-data-utils.c:348:13: throw: if ‘fcntl’ throws an exception...
LVM2.2.03.38/daemons/lvmpolld/lvmpolld-data-utils.c:348:13: danger: ‘data’ leaks here; was allocated at [(1)](sarif:/runs/0/results/11/codeFlows/0/threadFlows/0/locations/0)
#  346|   	}
#  347|   
#  348|-> 	if (fcntl(data->outpipe[0], F_SETFD, FD_CLOEXEC) ||
#  349|   	    fcntl(data->outpipe[1], F_SETFD, FD_CLOEXEC) ||
#  350|   	    fcntl(data->errpipe[0], F_SETFD, FD_CLOEXEC) ||

Error: GCC_ANALYZER_WARNING (CWE-775): [#def124]
LVM2.2.03.38/daemons/lvmpolld/lvmpolld-data-utils.c:349:13: warning[-Wanalyzer-fd-leak]: leak of file descriptor
LVM2.2.03.38/daemons/lvmpolld/lvmpolld-data-utils.c:334:12: branch_false: following ‘false’ branch (when ‘data’ is non-NULL)...
LVM2.2.03.38/daemons/lvmpolld/lvmpolld-data-utils.c:337:9: branch_false: ...to here
LVM2.2.03.38/daemons/lvmpolld/lvmpolld-data-utils.c:343:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/daemons/lvmpolld/lvmpolld-data-utils.c:343:41: branch_false: ...to here
LVM2.2.03.38/daemons/lvmpolld/lvmpolld-data-utils.c:343:13: branch_false: following ‘false’ branch...
LVM2.2.03.38/daemons/lvmpolld/lvmpolld-data-utils.c:348:13: branch_false: ...to here
LVM2.2.03.38/daemons/lvmpolld/lvmpolld-data-utils.c:348:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/daemons/lvmpolld/lvmpolld-data-utils.c:349:13: branch_false: ...to here
LVM2.2.03.38/daemons/lvmpolld/lvmpolld-data-utils.c:349:13: throw: if ‘fcntl’ throws an exception...
LVM2.2.03.38/daemons/lvmpolld/lvmpolld-data-utils.c:349:13: danger: leaks here
#  347|   
#  348|   	if (fcntl(data->outpipe[0], F_SETFD, FD_CLOEXEC) ||
#  349|-> 	    fcntl(data->outpipe[1], F_SETFD, FD_CLOEXEC) ||
#  350|   	    fcntl(data->errpipe[0], F_SETFD, FD_CLOEXEC) ||
#  351|   	    fcntl(data->errpipe[1], F_SETFD, FD_CLOEXEC)) {

Error: GCC_ANALYZER_WARNING (CWE-401): [#def125]
LVM2.2.03.38/daemons/lvmpolld/lvmpolld-data-utils.c:349:13: warning[-Wanalyzer-malloc-leak]: leak of ‘data’
LVM2.2.03.38/daemons/lvmpolld/lvmpolld-data-utils.c:333:77: acquire_memory: allocated here
LVM2.2.03.38/daemons/lvmpolld/lvmpolld-data-utils.c:334:12: branch_false: following ‘false’ branch (when ‘data’ is non-NULL)...
LVM2.2.03.38/daemons/lvmpolld/lvmpolld-data-utils.c:337:9: branch_false: ...to here
LVM2.2.03.38/daemons/lvmpolld/lvmpolld-data-utils.c:343:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/daemons/lvmpolld/lvmpolld-data-utils.c:343:41: branch_false: ...to here
LVM2.2.03.38/daemons/lvmpolld/lvmpolld-data-utils.c:343:13: branch_false: following ‘false’ branch...
LVM2.2.03.38/daemons/lvmpolld/lvmpolld-data-utils.c:348:13: branch_false: ...to here
LVM2.2.03.38/daemons/lvmpolld/lvmpolld-data-utils.c:348:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/daemons/lvmpolld/lvmpolld-data-utils.c:349:13: branch_false: ...to here
LVM2.2.03.38/daemons/lvmpolld/lvmpolld-data-utils.c:349:13: throw: if ‘fcntl’ throws an exception...
LVM2.2.03.38/daemons/lvmpolld/lvmpolld-data-utils.c:349:13: danger: ‘data’ leaks here; was allocated at [(1)](sarif:/runs/0/results/13/codeFlows/0/threadFlows/0/locations/0)
#  347|   
#  348|   	if (fcntl(data->outpipe[0], F_SETFD, FD_CLOEXEC) ||
#  349|-> 	    fcntl(data->outpipe[1], F_SETFD, FD_CLOEXEC) ||
#  350|   	    fcntl(data->errpipe[0], F_SETFD, FD_CLOEXEC) ||
#  351|   	    fcntl(data->errpipe[1], F_SETFD, FD_CLOEXEC)) {

Error: GCC_ANALYZER_WARNING (CWE-775): [#def126]
LVM2.2.03.38/daemons/lvmpolld/lvmpolld-data-utils.c:350:13: warning[-Wanalyzer-fd-leak]: leak of file descriptor
LVM2.2.03.38/daemons/lvmpolld/lvmpolld-data-utils.c:334:12: branch_false: following ‘false’ branch (when ‘data’ is non-NULL)...
LVM2.2.03.38/daemons/lvmpolld/lvmpolld-data-utils.c:337:9: branch_false: ...to here
LVM2.2.03.38/daemons/lvmpolld/lvmpolld-data-utils.c:343:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/daemons/lvmpolld/lvmpolld-data-utils.c:343:41: branch_false: ...to here
LVM2.2.03.38/daemons/lvmpolld/lvmpolld-data-utils.c:343:13: branch_false: following ‘false’ branch...
LVM2.2.03.38/daemons/lvmpolld/lvmpolld-data-utils.c:348:13: branch_false: ...to here
LVM2.2.03.38/daemons/lvmpolld/lvmpolld-data-utils.c:348:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/daemons/lvmpolld/lvmpolld-data-utils.c:349:13: branch_false: ...to here
LVM2.2.03.38/daemons/lvmpolld/lvmpolld-data-utils.c:348:13: branch_false: following ‘false’ branch...
LVM2.2.03.38/daemons/lvmpolld/lvmpolld-data-utils.c:350:13: branch_false: ...to here
LVM2.2.03.38/daemons/lvmpolld/lvmpolld-data-utils.c:350:13: throw: if ‘fcntl’ throws an exception...
LVM2.2.03.38/daemons/lvmpolld/lvmpolld-data-utils.c:350:13: danger: leaks here
#  348|   	if (fcntl(data->outpipe[0], F_SETFD, FD_CLOEXEC) ||
#  349|   	    fcntl(data->outpipe[1], F_SETFD, FD_CLOEXEC) ||
#  350|-> 	    fcntl(data->errpipe[0], F_SETFD, FD_CLOEXEC) ||
#  351|   	    fcntl(data->errpipe[1], F_SETFD, FD_CLOEXEC)) {
#  352|   		lvmpolld_thread_data_destroy(data);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def127]
LVM2.2.03.38/daemons/lvmpolld/lvmpolld-data-utils.c:350:13: warning[-Wanalyzer-malloc-leak]: leak of ‘data’
LVM2.2.03.38/daemons/lvmpolld/lvmpolld-data-utils.c:333:77: acquire_memory: allocated here
LVM2.2.03.38/daemons/lvmpolld/lvmpolld-data-utils.c:334:12: branch_false: following ‘false’ branch (when ‘data’ is non-NULL)...
LVM2.2.03.38/daemons/lvmpolld/lvmpolld-data-utils.c:337:9: branch_false: ...to here
LVM2.2.03.38/daemons/lvmpolld/lvmpolld-data-utils.c:343:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/daemons/lvmpolld/lvmpolld-data-utils.c:343:41: branch_false: ...to here
LVM2.2.03.38/daemons/lvmpolld/lvmpolld-data-utils.c:343:13: branch_false: following ‘false’ branch...
LVM2.2.03.38/daemons/lvmpolld/lvmpolld-data-utils.c:348:13: branch_false: ...to here
LVM2.2.03.38/daemons/lvmpolld/lvmpolld-data-utils.c:348:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/daemons/lvmpolld/lvmpolld-data-utils.c:349:13: branch_false: ...to here
LVM2.2.03.38/daemons/lvmpolld/lvmpolld-data-utils.c:348:13: branch_false: following ‘false’ branch...
LVM2.2.03.38/daemons/lvmpolld/lvmpolld-data-utils.c:350:13: branch_false: ...to here
LVM2.2.03.38/daemons/lvmpolld/lvmpolld-data-utils.c:350:13: throw: if ‘fcntl’ throws an exception...
LVM2.2.03.38/daemons/lvmpolld/lvmpolld-data-utils.c:350:13: danger: ‘data’ leaks here; was allocated at [(1)](sarif:/runs/0/results/15/codeFlows/0/threadFlows/0/locations/0)
#  348|   	if (fcntl(data->outpipe[0], F_SETFD, FD_CLOEXEC) ||
#  349|   	    fcntl(data->outpipe[1], F_SETFD, FD_CLOEXEC) ||
#  350|-> 	    fcntl(data->errpipe[0], F_SETFD, FD_CLOEXEC) ||
#  351|   	    fcntl(data->errpipe[1], F_SETFD, FD_CLOEXEC)) {
#  352|   		lvmpolld_thread_data_destroy(data);

Error: GCC_ANALYZER_WARNING (CWE-775): [#def128]
LVM2.2.03.38/daemons/lvmpolld/lvmpolld-data-utils.c:351:13: warning[-Wanalyzer-fd-leak]: leak of file descriptor
LVM2.2.03.38/daemons/lvmpolld/lvmpolld-data-utils.c:334:12: branch_false: following ‘false’ branch (when ‘data’ is non-NULL)...
LVM2.2.03.38/daemons/lvmpolld/lvmpolld-data-utils.c:337:9: branch_false: ...to here
LVM2.2.03.38/daemons/lvmpolld/lvmpolld-data-utils.c:343:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/daemons/lvmpolld/lvmpolld-data-utils.c:343:41: branch_false: ...to here
LVM2.2.03.38/daemons/lvmpolld/lvmpolld-data-utils.c:343:13: branch_false: following ‘false’ branch...
LVM2.2.03.38/daemons/lvmpolld/lvmpolld-data-utils.c:348:13: branch_false: ...to here
LVM2.2.03.38/daemons/lvmpolld/lvmpolld-data-utils.c:348:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/daemons/lvmpolld/lvmpolld-data-utils.c:349:13: branch_false: ...to here
LVM2.2.03.38/daemons/lvmpolld/lvmpolld-data-utils.c:348:13: branch_false: following ‘false’ branch...
LVM2.2.03.38/daemons/lvmpolld/lvmpolld-data-utils.c:350:13: branch_false: ...to here
LVM2.2.03.38/daemons/lvmpolld/lvmpolld-data-utils.c:348:13: branch_false: following ‘false’ branch...
LVM2.2.03.38/daemons/lvmpolld/lvmpolld-data-utils.c:351:13: branch_false: ...to here
LVM2.2.03.38/daemons/lvmpolld/lvmpolld-data-utils.c:351:13: throw: if ‘fcntl’ throws an exception...
LVM2.2.03.38/daemons/lvmpolld/lvmpolld-data-utils.c:351:13: danger: leaks here
#  349|   	    fcntl(data->outpipe[1], F_SETFD, FD_CLOEXEC) ||
#  350|   	    fcntl(data->errpipe[0], F_SETFD, FD_CLOEXEC) ||
#  351|-> 	    fcntl(data->errpipe[1], F_SETFD, FD_CLOEXEC)) {
#  352|   		lvmpolld_thread_data_destroy(data);
#  353|   		return NULL;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def129]
LVM2.2.03.38/daemons/lvmpolld/lvmpolld-data-utils.c:351:13: warning[-Wanalyzer-malloc-leak]: leak of ‘data’
LVM2.2.03.38/daemons/lvmpolld/lvmpolld-data-utils.c:333:77: acquire_memory: allocated here
LVM2.2.03.38/daemons/lvmpolld/lvmpolld-data-utils.c:334:12: branch_false: following ‘false’ branch (when ‘data’ is non-NULL)...
LVM2.2.03.38/daemons/lvmpolld/lvmpolld-data-utils.c:337:9: branch_false: ...to here
LVM2.2.03.38/daemons/lvmpolld/lvmpolld-data-utils.c:343:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/daemons/lvmpolld/lvmpolld-data-utils.c:343:41: branch_false: ...to here
LVM2.2.03.38/daemons/lvmpolld/lvmpolld-data-utils.c:343:13: branch_false: following ‘false’ branch...
LVM2.2.03.38/daemons/lvmpolld/lvmpolld-data-utils.c:348:13: branch_false: ...to here
LVM2.2.03.38/daemons/lvmpolld/lvmpolld-data-utils.c:348:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/daemons/lvmpolld/lvmpolld-data-utils.c:349:13: branch_false: ...to here
LVM2.2.03.38/daemons/lvmpolld/lvmpolld-data-utils.c:348:13: branch_false: following ‘false’ branch...
LVM2.2.03.38/daemons/lvmpolld/lvmpolld-data-utils.c:350:13: branch_false: ...to here
LVM2.2.03.38/daemons/lvmpolld/lvmpolld-data-utils.c:348:13: branch_false: following ‘false’ branch...
LVM2.2.03.38/daemons/lvmpolld/lvmpolld-data-utils.c:351:13: branch_false: ...to here
LVM2.2.03.38/daemons/lvmpolld/lvmpolld-data-utils.c:351:13: throw: if ‘fcntl’ throws an exception...
LVM2.2.03.38/daemons/lvmpolld/lvmpolld-data-utils.c:351:13: danger: ‘data’ leaks here; was allocated at [(1)](sarif:/runs/0/results/17/codeFlows/0/threadFlows/0/locations/0)
#  349|   	    fcntl(data->outpipe[1], F_SETFD, FD_CLOEXEC) ||
#  350|   	    fcntl(data->errpipe[0], F_SETFD, FD_CLOEXEC) ||
#  351|-> 	    fcntl(data->errpipe[1], F_SETFD, FD_CLOEXEC)) {
#  352|   		lvmpolld_thread_data_destroy(data);
#  353|   		return NULL;

Error: GCC_ANALYZER_WARNING (CWE-775): [#def130]
LVM2.2.03.38/daemons/lvmpolld/lvmpolld-data-utils.c:390:24: warning[-Wanalyzer-fd-leak]: leak of file descriptor
LVM2.2.03.38/daemons/lvmpolld/lvmpolld-data-utils.c:331:30: enter_function: entry to ‘lvmpolld_thread_data_constructor’
LVM2.2.03.38/daemons/lvmpolld/lvmpolld-data-utils.c:334:12: branch_false: following ‘false’ branch (when ‘data’ is non-NULL)...
LVM2.2.03.38/daemons/lvmpolld/lvmpolld-data-utils.c:337:9: branch_false: ...to here
LVM2.2.03.38/daemons/lvmpolld/lvmpolld-data-utils.c:343:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/daemons/lvmpolld/lvmpolld-data-utils.c:343:41: branch_false: ...to here
LVM2.2.03.38/daemons/lvmpolld/lvmpolld-data-utils.c:343:13: branch_true: following ‘true’ branch...
LVM2.2.03.38/daemons/lvmpolld/lvmpolld-data-utils.c:344:17: branch_true: ...to here
LVM2.2.03.38/daemons/lvmpolld/lvmpolld-data-utils.c:344:17: call_function: calling ‘lvmpolld_thread_data_destroy’ from ‘lvmpolld_thread_data_constructor’
#  388|   
#  389|   	if (data->outpipe[0] >= 0)
#  390|-> 		(void) close(data->outpipe[0]);
#  391|   
#  392|   	if (data->outpipe[1] >= 0)

Error: GCC_ANALYZER_WARNING (CWE-401): [#def131]
LVM2.2.03.38/daemons/lvmpolld/lvmpolld-data-utils.c:390:24: warning[-Wanalyzer-malloc-leak]: leak of ‘data’
LVM2.2.03.38/daemons/lvmpolld/lvmpolld-data-utils.c:331:30: enter_function: entry to ‘lvmpolld_thread_data_constructor’
LVM2.2.03.38/daemons/lvmpolld/lvmpolld-data-utils.c:333:77: acquire_memory: allocated here
LVM2.2.03.38/daemons/lvmpolld/lvmpolld-data-utils.c:334:12: branch_false: following ‘false’ branch (when ‘data’ is non-NULL)...
LVM2.2.03.38/daemons/lvmpolld/lvmpolld-data-utils.c:337:9: branch_false: ...to here
LVM2.2.03.38/daemons/lvmpolld/lvmpolld-data-utils.c:343:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/daemons/lvmpolld/lvmpolld-data-utils.c:343:41: branch_false: ...to here
LVM2.2.03.38/daemons/lvmpolld/lvmpolld-data-utils.c:343:13: branch_true: following ‘true’ branch...
LVM2.2.03.38/daemons/lvmpolld/lvmpolld-data-utils.c:344:17: branch_true: ...to here
LVM2.2.03.38/daemons/lvmpolld/lvmpolld-data-utils.c:344:17: call_function: calling ‘lvmpolld_thread_data_destroy’ from ‘lvmpolld_thread_data_constructor’
#  388|   
#  389|   	if (data->outpipe[0] >= 0)
#  390|-> 		(void) close(data->outpipe[0]);
#  391|   
#  392|   	if (data->outpipe[1] >= 0)

Error: GCC_ANALYZER_WARNING (CWE-775): [#def132]
LVM2.2.03.38/daemons/lvmpolld/lvmpolld-data-utils.c:393:24: warning[-Wanalyzer-fd-leak]: leak of file descriptor
LVM2.2.03.38/daemons/lvmpolld/lvmpolld-data-utils.c:331:30: enter_function: entry to ‘lvmpolld_thread_data_constructor’
LVM2.2.03.38/daemons/lvmpolld/lvmpolld-data-utils.c:334:12: branch_false: following ‘false’ branch (when ‘data’ is non-NULL)...
LVM2.2.03.38/daemons/lvmpolld/lvmpolld-data-utils.c:337:9: branch_false: ...to here
LVM2.2.03.38/daemons/lvmpolld/lvmpolld-data-utils.c:343:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/daemons/lvmpolld/lvmpolld-data-utils.c:343:41: branch_false: ...to here
LVM2.2.03.38/daemons/lvmpolld/lvmpolld-data-utils.c:343:13: branch_true: following ‘true’ branch...
LVM2.2.03.38/daemons/lvmpolld/lvmpolld-data-utils.c:344:17: branch_true: ...to here
LVM2.2.03.38/daemons/lvmpolld/lvmpolld-data-utils.c:344:17: call_function: calling ‘lvmpolld_thread_data_destroy’ from ‘lvmpolld_thread_data_constructor’
#  391|   
#  392|   	if (data->outpipe[1] >= 0)
#  393|-> 		(void) close(data->outpipe[1]);
#  394|   
#  395|   	if (data->errpipe[0] >= 0)

Error: GCC_ANALYZER_WARNING (CWE-401): [#def133]
LVM2.2.03.38/daemons/lvmpolld/lvmpolld-data-utils.c:393:24: warning[-Wanalyzer-malloc-leak]: leak of ‘data’
LVM2.2.03.38/daemons/lvmpolld/lvmpolld-data-utils.c:331:30: enter_function: entry to ‘lvmpolld_thread_data_constructor’
LVM2.2.03.38/daemons/lvmpolld/lvmpolld-data-utils.c:333:77: acquire_memory: allocated here
LVM2.2.03.38/daemons/lvmpolld/lvmpolld-data-utils.c:334:12: branch_false: following ‘false’ branch (when ‘data’ is non-NULL)...
LVM2.2.03.38/daemons/lvmpolld/lvmpolld-data-utils.c:337:9: branch_false: ...to here
LVM2.2.03.38/daemons/lvmpolld/lvmpolld-data-utils.c:343:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/daemons/lvmpolld/lvmpolld-data-utils.c:343:41: branch_false: ...to here
LVM2.2.03.38/daemons/lvmpolld/lvmpolld-data-utils.c:343:13: branch_true: following ‘true’ branch...
LVM2.2.03.38/daemons/lvmpolld/lvmpolld-data-utils.c:344:17: branch_true: ...to here
LVM2.2.03.38/daemons/lvmpolld/lvmpolld-data-utils.c:344:17: call_function: calling ‘lvmpolld_thread_data_destroy’ from ‘lvmpolld_thread_data_constructor’
#  391|   
#  392|   	if (data->outpipe[1] >= 0)
#  393|-> 		(void) close(data->outpipe[1]);
#  394|   
#  395|   	if (data->errpipe[0] >= 0)

Error: GCC_ANALYZER_WARNING (CWE-401): [#def134]
LVM2.2.03.38/daemons/lvmpolld/lvmpolld-data-utils.c:396:24: warning[-Wanalyzer-malloc-leak]: leak of ‘data’
LVM2.2.03.38/daemons/lvmpolld/lvmpolld-data-utils.c:331:30: enter_function: entry to ‘lvmpolld_thread_data_constructor’
LVM2.2.03.38/daemons/lvmpolld/lvmpolld-data-utils.c:333:77: acquire_memory: allocated here
LVM2.2.03.38/daemons/lvmpolld/lvmpolld-data-utils.c:334:12: branch_false: following ‘false’ branch (when ‘data’ is non-NULL)...
LVM2.2.03.38/daemons/lvmpolld/lvmpolld-data-utils.c:337:9: branch_false: ...to here
LVM2.2.03.38/daemons/lvmpolld/lvmpolld-data-utils.c:343:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/daemons/lvmpolld/lvmpolld-data-utils.c:343:41: branch_false: ...to here
LVM2.2.03.38/daemons/lvmpolld/lvmpolld-data-utils.c:343:13: branch_false: following ‘false’ branch...
LVM2.2.03.38/daemons/lvmpolld/lvmpolld-data-utils.c:348:13: branch_false: ...to here
LVM2.2.03.38/daemons/lvmpolld/lvmpolld-data-utils.c:348:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/daemons/lvmpolld/lvmpolld-data-utils.c:349:13: branch_false: ...to here
LVM2.2.03.38/daemons/lvmpolld/lvmpolld-data-utils.c:348:13: branch_false: following ‘false’ branch...
LVM2.2.03.38/daemons/lvmpolld/lvmpolld-data-utils.c:350:13: branch_false: ...to here
LVM2.2.03.38/daemons/lvmpolld/lvmpolld-data-utils.c:348:13: branch_false: following ‘false’ branch...
LVM2.2.03.38/daemons/lvmpolld/lvmpolld-data-utils.c:351:13: branch_false: ...to here
LVM2.2.03.38/daemons/lvmpolld/lvmpolld-data-utils.c:348:13: branch_true: following ‘true’ branch...
LVM2.2.03.38/daemons/lvmpolld/lvmpolld-data-utils.c:352:17: branch_true: ...to here
LVM2.2.03.38/daemons/lvmpolld/lvmpolld-data-utils.c:352:17: call_function: calling ‘lvmpolld_thread_data_destroy’ from ‘lvmpolld_thread_data_constructor’
#  394|   
#  395|   	if (data->errpipe[0] >= 0)
#  396|-> 		(void) close(data->errpipe[0]);
#  397|   
#  398|   	if (data->errpipe[1] >= 0)

Error: GCC_ANALYZER_WARNING (CWE-401): [#def135]
LVM2.2.03.38/daemons/lvmpolld/lvmpolld-data-utils.c:399:24: warning[-Wanalyzer-malloc-leak]: leak of ‘data’
LVM2.2.03.38/daemons/lvmpolld/lvmpolld-data-utils.c:331:30: enter_function: entry to ‘lvmpolld_thread_data_constructor’
LVM2.2.03.38/daemons/lvmpolld/lvmpolld-data-utils.c:333:77: acquire_memory: allocated here
LVM2.2.03.38/daemons/lvmpolld/lvmpolld-data-utils.c:334:12: branch_false: following ‘false’ branch (when ‘data’ is non-NULL)...
LVM2.2.03.38/daemons/lvmpolld/lvmpolld-data-utils.c:337:9: branch_false: ...to here
LVM2.2.03.38/daemons/lvmpolld/lvmpolld-data-utils.c:343:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/daemons/lvmpolld/lvmpolld-data-utils.c:343:41: branch_false: ...to here
LVM2.2.03.38/daemons/lvmpolld/lvmpolld-data-utils.c:343:13: branch_false: following ‘false’ branch...
LVM2.2.03.38/daemons/lvmpolld/lvmpolld-data-utils.c:348:13: branch_false: ...to here
LVM2.2.03.38/daemons/lvmpolld/lvmpolld-data-utils.c:348:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/daemons/lvmpolld/lvmpolld-data-utils.c:349:13: branch_false: ...to here
LVM2.2.03.38/daemons/lvmpolld/lvmpolld-data-utils.c:348:13: branch_false: following ‘false’ branch...
LVM2.2.03.38/daemons/lvmpolld/lvmpolld-data-utils.c:350:13: branch_false: ...to here
LVM2.2.03.38/daemons/lvmpolld/lvmpolld-data-utils.c:348:13: branch_false: following ‘false’ branch...
LVM2.2.03.38/daemons/lvmpolld/lvmpolld-data-utils.c:351:13: branch_false: ...to here
LVM2.2.03.38/daemons/lvmpolld/lvmpolld-data-utils.c:348:13: branch_true: following ‘true’ branch...
LVM2.2.03.38/daemons/lvmpolld/lvmpolld-data-utils.c:352:17: branch_true: ...to here
LVM2.2.03.38/daemons/lvmpolld/lvmpolld-data-utils.c:352:17: call_function: calling ‘lvmpolld_thread_data_destroy’ from ‘lvmpolld_thread_data_constructor’
#  397|   
#  398|   	if (data->errpipe[1] >= 0)
#  399|-> 		(void) close(data->errpipe[1]);
#  400|   
#  401|   	free(data);

Error: GCC_ANALYZER_WARNING (CWE-775): [#def136]
LVM2.2.03.38/daemons/lvmpolld/lvmpolld-data-utils.c:401:9: warning[-Wanalyzer-fd-leak]: leak of file descriptor
LVM2.2.03.38/daemons/lvmpolld/lvmpolld-data-utils.c:331:30: enter_function: entry to ‘lvmpolld_thread_data_constructor’
LVM2.2.03.38/daemons/lvmpolld/lvmpolld-data-utils.c:334:12: branch_false: following ‘false’ branch (when ‘data’ is non-NULL)...
LVM2.2.03.38/daemons/lvmpolld/lvmpolld-data-utils.c:337:9: branch_false: ...to here
LVM2.2.03.38/daemons/lvmpolld/lvmpolld-data-utils.c:343:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/daemons/lvmpolld/lvmpolld-data-utils.c:343:41: branch_false: ...to here
LVM2.2.03.38/daemons/lvmpolld/lvmpolld-data-utils.c:343:13: branch_true: following ‘true’ branch...
LVM2.2.03.38/daemons/lvmpolld/lvmpolld-data-utils.c:344:17: branch_true: ...to here
LVM2.2.03.38/daemons/lvmpolld/lvmpolld-data-utils.c:344:17: call_function: calling ‘lvmpolld_thread_data_destroy’ from ‘lvmpolld_thread_data_constructor’
#  399|   		(void) close(data->errpipe[1]);
#  400|   
#  401|-> 	free(data);
#  402|   }

Error: GCC_ANALYZER_WARNING (CWE-401): [#def137]
LVM2.2.03.38/device_mapper/datastruct/bitset.c:195:41: warning[-Wanalyzer-malloc-leak]: leak of ‘mask’
LVM2.2.03.38/device_mapper/datastruct/bitset.c:149:13: enter_function: entry to ‘dm_bitset_parse_list’
LVM2.2.03.38/device_mapper/datastruct/bitset.c:171:24: branch_true: following ‘true’ branch (when ‘len != 0’)...
LVM2.2.03.38/device_mapper/datastruct/bitset.c:173:30: branch_true: ...to here
LVM2.2.03.38/device_mapper/datastruct/bitset.c:175:28: branch_false: following ‘false’ branch...
LVM2.2.03.38/device_mapper/datastruct/bitset.c:179:29: branch_false: ...to here
LVM2.2.03.38/device_mapper/datastruct/bitset.c:179:28: branch_true: following ‘true’ branch...
LVM2.2.03.38/device_mapper/datastruct/bitset.c:211:20: branch_true: ...to here
LVM2.2.03.38/device_mapper/datastruct/bitset.c:211:20: branch_true: following ‘true’ branch (when ‘totaldigits == totaldigits’)...
LVM2.2.03.38/device_mapper/datastruct/bitset.c:211:20: branch_true: ...to here
LVM2.2.03.38/device_mapper/datastruct/bitset.c:226:12: branch_true: following ‘true’ branch (when ‘mask’ is NULL)...
LVM2.2.03.38/device_mapper/datastruct/bitset.c:227:20: branch_true: ...to here
LVM2.2.03.38/device_mapper/datastruct/bitset.c:230:30: call_function: calling ‘dm_bitset_create’ from ‘dm_bitset_parse_list’
LVM2.2.03.38/device_mapper/datastruct/bitset.c:230:30: return_function: returning to ‘dm_bitset_parse_list’ from ‘dm_bitset_create’
LVM2.2.03.38/device_mapper/datastruct/bitset.c:230:20: branch_false: following ‘false’ branch...
LVM2.2.03.38/device_mapper/datastruct/bitset.c:233:17: branch_false: ...to here
LVM2.2.03.38/device_mapper/datastruct/bitset.c:175:28: branch_false: following ‘false’ branch...
LVM2.2.03.38/device_mapper/datastruct/bitset.c:179:29: branch_false: ...to here
LVM2.2.03.38/device_mapper/datastruct/bitset.c:179:28: branch_true: following ‘true’ branch...
LVM2.2.03.38/device_mapper/datastruct/bitset.c:211:20: branch_true: ...to here
LVM2.2.03.38/device_mapper/datastruct/bitset.c:211:20: branch_true: following ‘true’ branch (when ‘totaldigits == totaldigits’)...
LVM2.2.03.38/device_mapper/datastruct/bitset.c:211:20: branch_true: ...to here
LVM2.2.03.38/device_mapper/datastruct/bitset.c:224:18: branch_true: following ‘true’ branch...
LVM2.2.03.38/device_mapper/datastruct/bitset.c:224:18: branch_true: ...to here
LVM2.2.03.38/device_mapper/datastruct/bitset.c:190:28: branch_false: following ‘false’ branch (when ‘totaldigits == totaldigits’)...
LVM2.2.03.38/device_mapper/datastruct/bitset.c:193:28: branch_false: ...to here
LVM2.2.03.38/device_mapper/datastruct/bitset.c:193:28: branch_true: following ‘true’ branch (when ‘c == 45’)...
LVM2.2.03.38/device_mapper/datastruct/bitset.c:194:37: branch_true: ...to here
LVM2.2.03.38/device_mapper/datastruct/bitset.c:194:36: branch_true: following ‘true’ branch...
LVM2.2.03.38/device_mapper/datastruct/bitset.c:195:41: branch_true: ...to here
LVM2.2.03.38/device_mapper/datastruct/bitset.c:195:41: throw: if the called function throws an exception...
LVM2.2.03.38/device_mapper/datastruct/bitset.c:195:41: danger: ‘mask’ leaks here; was allocated at [(17)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/16)
#  193|   			if (c == '-') {
#  194|   				if (at_start || in_range)
#  195|-> 					goto_bad;
#  196|   				b = 0;
#  197|   				in_range = 1;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def138]
LVM2.2.03.38/device_mapper/datastruct/bitset.c:203:33: warning[-Wanalyzer-malloc-leak]: leak of ‘mask’
LVM2.2.03.38/device_mapper/datastruct/bitset.c:149:13: enter_function: entry to ‘dm_bitset_parse_list’
LVM2.2.03.38/device_mapper/datastruct/bitset.c:171:24: branch_true: following ‘true’ branch (when ‘len != 0’)...
LVM2.2.03.38/device_mapper/datastruct/bitset.c:173:30: branch_true: ...to here
LVM2.2.03.38/device_mapper/datastruct/bitset.c:175:28: branch_false: following ‘false’ branch...
LVM2.2.03.38/device_mapper/datastruct/bitset.c:179:29: branch_false: ...to here
LVM2.2.03.38/device_mapper/datastruct/bitset.c:179:28: branch_true: following ‘true’ branch...
LVM2.2.03.38/device_mapper/datastruct/bitset.c:211:20: branch_true: ...to here
LVM2.2.03.38/device_mapper/datastruct/bitset.c:211:20: branch_true: following ‘true’ branch (when ‘totaldigits == totaldigits’)...
LVM2.2.03.38/device_mapper/datastruct/bitset.c:211:20: branch_true: ...to here
LVM2.2.03.38/device_mapper/datastruct/bitset.c:226:12: branch_true: following ‘true’ branch (when ‘mask’ is NULL)...
LVM2.2.03.38/device_mapper/datastruct/bitset.c:227:20: branch_true: ...to here
LVM2.2.03.38/device_mapper/datastruct/bitset.c:230:30: call_function: calling ‘dm_bitset_create’ from ‘dm_bitset_parse_list’
LVM2.2.03.38/device_mapper/datastruct/bitset.c:230:30: return_function: returning to ‘dm_bitset_parse_list’ from ‘dm_bitset_create’
LVM2.2.03.38/device_mapper/datastruct/bitset.c:230:20: branch_false: following ‘false’ branch...
LVM2.2.03.38/device_mapper/datastruct/bitset.c:233:17: branch_false: ...to here
LVM2.2.03.38/device_mapper/datastruct/bitset.c:175:28: branch_false: following ‘false’ branch...
LVM2.2.03.38/device_mapper/datastruct/bitset.c:179:29: branch_false: ...to here
LVM2.2.03.38/device_mapper/datastruct/bitset.c:179:28: branch_true: following ‘true’ branch...
LVM2.2.03.38/device_mapper/datastruct/bitset.c:211:20: branch_true: ...to here
LVM2.2.03.38/device_mapper/datastruct/bitset.c:211:20: branch_true: following ‘true’ branch (when ‘totaldigits == totaldigits’)...
LVM2.2.03.38/device_mapper/datastruct/bitset.c:211:20: branch_true: ...to here
LVM2.2.03.38/device_mapper/datastruct/bitset.c:224:18: branch_true: following ‘true’ branch...
LVM2.2.03.38/device_mapper/datastruct/bitset.c:224:18: branch_true: ...to here
LVM2.2.03.38/device_mapper/datastruct/bitset.c:190:28: branch_false: following ‘false’ branch (when ‘totaldigits == totaldigits’)...
LVM2.2.03.38/device_mapper/datastruct/bitset.c:193:28: branch_false: ...to here
LVM2.2.03.38/device_mapper/datastruct/bitset.c:193:28: branch_false: following ‘false’ branch (when ‘c != 45’)...
LVM2.2.03.38/device_mapper/datastruct/bitset.c:193:28: branch_false: ...to here
LVM2.2.03.38/device_mapper/datastruct/bitset.c:202:28: branch_true: following ‘true’ branch...
LVM2.2.03.38/device_mapper/datastruct/bitset.c:203:33: branch_true: ...to here
LVM2.2.03.38/device_mapper/datastruct/bitset.c:203:33: throw: if the called function throws an exception...
LVM2.2.03.38/device_mapper/datastruct/bitset.c:203:33: danger: ‘mask’ leaks here; was allocated at [(17)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/16)
#  201|   
#  202|   			if (!isdigit(c))
#  203|-> 				goto_bad;
#  204|   
#  205|   			b = b * 10 + (c - '0');

Error: CPPCHECK_WARNING (CWE-457): [#def139]
LVM2.2.03.38/device_mapper/ioctl/libdm-iface.c:814: error[legacyUninitvar]: Uninitialized variable: names1
#  812|   	/* buffer for devs +  sorted ptrs + dm_devs + aligned strings */
#  813|   	if (!(devs = malloc(sizeof(*devs) + cnt * (2 * sizeof(void*) + sizeof(*dm_dev)) +
#  814|-> 			    (cnt ? (char*)names1 - (char*)names + 256 : 0))))
#  815|   		return_0;
#  816|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def140]
LVM2.2.03.38/device_mapper/libdm-common.c:320:14: warning[-Wanalyzer-malloc-leak]: leak of ‘calloc(1, 216)’
LVM2.2.03.38/device_mapper/libdm-common.c:2276:5: enter_function: entry to ‘dm_driver_version’
LVM2.2.03.38/device_mapper/libdm-common.c:2281:21: call_function: calling ‘dm_task_create’ from ‘dm_driver_version’
#  318|   	}
#  319|   
#  320|-> 	if (!dm_check_version()) {
#  321|   		free(dmt);
#  322|   		return_NULL;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def141]
LVM2.2.03.38/device_mapper/libdm-common.c:363:26: warning[-Wanalyzer-malloc-leak]: leak of ‘opendir(&_dm_dir)’
LVM2.2.03.38/device_mapper/libdm-common.c:2255:5: enter_function: entry to ‘dm_mknodes’
LVM2.2.03.38/device_mapper/libdm-common.c:2260:21: call_function: calling ‘dm_task_create’ from ‘dm_mknodes’
LVM2.2.03.38/device_mapper/libdm-common.c:2260:21: return_function: returning to ‘dm_mknodes’ from ‘dm_task_create’
LVM2.2.03.38/device_mapper/libdm-common.c:2260:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/device_mapper/libdm-common.c:2263:12: branch_false: ...to here
LVM2.2.03.38/device_mapper/libdm-common.c:2263:12: branch_true: following ‘true’ branch (when ‘name’ is non-NULL)...
LVM2.2.03.38/device_mapper/libdm-common.c:2263:22: branch_true: ...to here
LVM2.2.03.38/device_mapper/libdm-common.c:2263:22: call_function: calling ‘dm_task_set_name’ from ‘dm_mknodes’
#  361|   	}
#  362|   
#  363|-> 	while ((dirent = readdir(d))) {
#  364|   		name = dirent->d_name;
#  365|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def142]
LVM2.2.03.38/device_mapper/libdm-common.c:675:24: warning[-Wanalyzer-malloc-leak]: leak of ‘dm_task_create(15)’
LVM2.2.03.38/device_mapper/libdm-common.c:2255:5: enter_function: entry to ‘dm_mknodes’
LVM2.2.03.38/device_mapper/libdm-common.c:2260:21: call_function: calling ‘dm_task_create’ from ‘dm_mknodes’
LVM2.2.03.38/device_mapper/libdm-common.c:2260:21: return_function: returning to ‘dm_mknodes’ from ‘dm_task_create’
LVM2.2.03.38/device_mapper/libdm-common.c:2260:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/device_mapper/libdm-common.c:2263:12: branch_false: ...to here
LVM2.2.03.38/device_mapper/libdm-common.c:2263:12: branch_true: following ‘true’ branch (when ‘name’ is non-NULL)...
LVM2.2.03.38/device_mapper/libdm-common.c:2263:22: branch_true: ...to here
LVM2.2.03.38/device_mapper/libdm-common.c:2263:22: call_function: calling ‘dm_task_set_name’ from ‘dm_mknodes’
#  673|   	/* Path supplied for existing device? */
#  674|   	if ((pos = strrchr(name, '/')))
#  675|-> 		return _dm_task_set_name_from_path(dmt, name, pos + 1);
#  676|   
#  677|   	return _dm_task_set_name(dmt, name, dm_get_name_mangling_mode());

Error: GCC_ANALYZER_WARNING (CWE-401): [#def143]
LVM2.2.03.38/device_mapper/libdm-common.c:1656:9: warning[-Wanalyzer-malloc-leak]: leak of ‘nop’
LVM2.2.03.38/device_mapper/libdm-common.c:1701:5: enter_function: entry to ‘set_dev_node_read_ahead’
LVM2.2.03.38/device_mapper/libdm-common.c:1705:12: branch_false: following ‘false’ branch (when ‘read_ahead != 4294967295’)...
LVM2.2.03.38/device_mapper/libdm-common.c:1708:16: branch_false: ...to here
LVM2.2.03.38/device_mapper/libdm-common.c:1708:16: call_function: calling ‘_stack_node_op’ from ‘set_dev_node_read_ahead’
# 1654|   
# 1655|   	_count_node_ops[type]++;
# 1656|-> 	dm_list_add(&_node_ops, &nop->list);
# 1657|   
# 1658|   	_log_node_op("Stacking", nop);

Error: GCC_ANALYZER_WARNING (CWE-775): [#def144]
LVM2.2.03.38/device_mapper/libdm-common.c:1825:17: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(&_mountinfo, "r")’
LVM2.2.03.38/device_mapper/libdm-common.c:1864:5: enter_function: entry to ‘dm_mountinfo_read’
LVM2.2.03.38/device_mapper/libdm-common.c:1872:23: acquire_resource: opened here
LVM2.2.03.38/device_mapper/libdm-common.c:1872:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/device_mapper/libdm-common.c:1872:12: branch_false: ...to here
LVM2.2.03.38/device_mapper/libdm-common.c:1880:16: branch_true: following ‘true’ branch...
LVM2.2.03.38/device_mapper/libdm-common.c:1882:22: call_function: calling ‘_mountinfo_parse_line’ from ‘dm_mountinfo_read’
# 1823|   		   "s %" DM_TO_STRING(PATH_MAX) "s",
# 1824|   		   maj, min, root, target) < 4) {
# 1825|-> 		log_error("Failed to parse mountinfo line.");
# 1826|   		return 0;
# 1827|   	}

Error: GCC_ANALYZER_WARNING (CWE-401): [#def145]
LVM2.2.03.38/device_mapper/libdm-common.c:1825:17: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(&_mountinfo, "r")’
LVM2.2.03.38/device_mapper/libdm-common.c:1864:5: enter_function: entry to ‘dm_mountinfo_read’
LVM2.2.03.38/device_mapper/libdm-common.c:1872:23: acquire_memory: allocated here
LVM2.2.03.38/device_mapper/libdm-common.c:1872:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/device_mapper/libdm-common.c:1872:12: branch_false: ...to here
LVM2.2.03.38/device_mapper/libdm-common.c:1880:16: branch_true: following ‘true’ branch...
LVM2.2.03.38/device_mapper/libdm-common.c:1882:22: call_function: calling ‘_mountinfo_parse_line’ from ‘dm_mountinfo_read’
# 1823|   		   "s %" DM_TO_STRING(PATH_MAX) "s",
# 1824|   		   maj, min, root, target) < 4) {
# 1825|-> 		log_error("Failed to parse mountinfo line.");
# 1826|   		return 0;
# 1827|   	}

Error: GCC_ANALYZER_WARNING (CWE-775): [#def146]
LVM2.2.03.38/device_mapper/libdm-common.c:1831:13: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(&_mountinfo, "r")’
LVM2.2.03.38/device_mapper/libdm-common.c:1864:5: enter_function: entry to ‘dm_mountinfo_read’
LVM2.2.03.38/device_mapper/libdm-common.c:1872:23: acquire_resource: opened here
LVM2.2.03.38/device_mapper/libdm-common.c:1872:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/device_mapper/libdm-common.c:1872:12: branch_false: ...to here
LVM2.2.03.38/device_mapper/libdm-common.c:1880:16: branch_true: following ‘true’ branch...
LVM2.2.03.38/device_mapper/libdm-common.c:1882:22: call_function: calling ‘_mountinfo_parse_line’ from ‘dm_mountinfo_read’
# 1829|   	/* btrfs fakes device numbers, but there is still /dev/mapper name
# 1830|   	 * placed in mountinfo, so try to detect proper major:minor via this */
# 1831|-> 	if (*maj == 0 && (devmapper = strstr(line, "/dev/mapper/"))) {
# 1832|   		if (!(dmt = dm_task_create(DM_DEVICE_INFO))) {
# 1833|   			log_error("Mount info task creation failed.");

Error: GCC_ANALYZER_WARNING (CWE-401): [#def147]
LVM2.2.03.38/device_mapper/libdm-common.c:1831:13: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(&_mountinfo, "r")’
LVM2.2.03.38/device_mapper/libdm-common.c:1864:5: enter_function: entry to ‘dm_mountinfo_read’
LVM2.2.03.38/device_mapper/libdm-common.c:1872:23: acquire_memory: allocated here
LVM2.2.03.38/device_mapper/libdm-common.c:1872:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/device_mapper/libdm-common.c:1872:12: branch_false: ...to here
LVM2.2.03.38/device_mapper/libdm-common.c:1880:16: branch_true: following ‘true’ branch...
LVM2.2.03.38/device_mapper/libdm-common.c:1882:22: call_function: calling ‘_mountinfo_parse_line’ from ‘dm_mountinfo_read’
# 1829|   	/* btrfs fakes device numbers, but there is still /dev/mapper name
# 1830|   	 * placed in mountinfo, so try to detect proper major:minor via this */
# 1831|-> 	if (*maj == 0 && (devmapper = strstr(line, "/dev/mapper/"))) {
# 1832|   		if (!(dmt = dm_task_create(DM_DEVICE_INFO))) {
# 1833|   			log_error("Mount info task creation failed.");

Error: GCC_ANALYZER_WARNING (CWE-775): [#def148]
LVM2.2.03.38/device_mapper/libdm-common.c:1918:17: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(&sysfs_path, "r")’
LVM2.2.03.38/device_mapper/libdm-common.c:1902:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/device_mapper/libdm-common.c:1909:20: branch_false: ...to here
LVM2.2.03.38/device_mapper/libdm-common.c:1909:20: acquire_resource: opened here
LVM2.2.03.38/device_mapper/libdm-common.c:1909:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/device_mapper/libdm-common.c:1917:14: branch_false: ...to here
LVM2.2.03.38/device_mapper/libdm-common.c:1917:12: branch_true: following ‘true’ branch...
LVM2.2.03.38/device_mapper/libdm-common.c:1918:17: branch_true: ...to here
LVM2.2.03.38/device_mapper/libdm-common.c:1918:17: throw: if the called function throws an exception...
LVM2.2.03.38/device_mapper/libdm-common.c:1918:17: danger: ‘fopen(&sysfs_path, "r")’ leaks here; was opened at [(3)](sarif:/runs/0/results/38/codeFlows/0/threadFlows/0/locations/2)
# 1916|   
# 1917|   	if (!fgets(temp_buf, sizeof(temp_buf), fp)) {
# 1918|-> 		log_sys_error("fgets", sysfs_path);
# 1919|   		goto bad;
# 1920|   	}

Error: GCC_ANALYZER_WARNING (CWE-401): [#def149]
LVM2.2.03.38/device_mapper/libdm-common.c:1918:17: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(&sysfs_path, "r")’
LVM2.2.03.38/device_mapper/libdm-common.c:1902:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/device_mapper/libdm-common.c:1909:20: branch_false: ...to here
LVM2.2.03.38/device_mapper/libdm-common.c:1909:20: acquire_memory: allocated here
LVM2.2.03.38/device_mapper/libdm-common.c:1909:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/device_mapper/libdm-common.c:1917:14: branch_false: ...to here
LVM2.2.03.38/device_mapper/libdm-common.c:1917:12: branch_true: following ‘true’ branch...
LVM2.2.03.38/device_mapper/libdm-common.c:1918:17: branch_true: ...to here
LVM2.2.03.38/device_mapper/libdm-common.c:1918:17: throw: if the called function throws an exception...
LVM2.2.03.38/device_mapper/libdm-common.c:1918:17: danger: ‘fopen(&sysfs_path, "r")’ leaks here; was allocated at [(3)](sarif:/runs/0/results/39/codeFlows/0/threadFlows/0/locations/2)
# 1916|   
# 1917|   	if (!fgets(temp_buf, sizeof(temp_buf), fp)) {
# 1918|-> 		log_sys_error("fgets", sysfs_path);
# 1919|   		goto bad;
# 1920|   	}

Error: GCC_ANALYZER_WARNING (CWE-775): [#def150]
LVM2.2.03.38/device_mapper/libdm-common.c:1925:17: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(&sysfs_path, "r")’
LVM2.2.03.38/device_mapper/libdm-common.c:1902:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/device_mapper/libdm-common.c:1909:20: branch_false: ...to here
LVM2.2.03.38/device_mapper/libdm-common.c:1909:20: acquire_resource: opened here
LVM2.2.03.38/device_mapper/libdm-common.c:1909:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/device_mapper/libdm-common.c:1917:14: branch_false: ...to here
LVM2.2.03.38/device_mapper/libdm-common.c:1917:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/device_mapper/libdm-common.c:1922:15: branch_false: ...to here
LVM2.2.03.38/device_mapper/libdm-common.c:1924:12: branch_true: following ‘true’ branch (when ‘len > buf_size’)...
LVM2.2.03.38/device_mapper/libdm-common.c:1925:17: branch_true: ...to here
LVM2.2.03.38/device_mapper/libdm-common.c:1925:17: throw: if the called function throws an exception...
LVM2.2.03.38/device_mapper/libdm-common.c:1925:17: danger: ‘fopen(&sysfs_path, "r")’ leaks here; was opened at [(3)](sarif:/runs/0/results/40/codeFlows/0/threadFlows/0/locations/2)
# 1923|   
# 1924|   	if (len > buf_size) {
# 1925|-> 		log_error("_sysfs_get_dm_name: supplied buffer too small.");
# 1926|   		goto bad;
# 1927|   	}

Error: GCC_ANALYZER_WARNING (CWE-401): [#def151]
LVM2.2.03.38/device_mapper/libdm-common.c:1925:17: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(&sysfs_path, "r")’
LVM2.2.03.38/device_mapper/libdm-common.c:1902:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/device_mapper/libdm-common.c:1909:20: branch_false: ...to here
LVM2.2.03.38/device_mapper/libdm-common.c:1909:20: acquire_memory: allocated here
LVM2.2.03.38/device_mapper/libdm-common.c:1909:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/device_mapper/libdm-common.c:1917:14: branch_false: ...to here
LVM2.2.03.38/device_mapper/libdm-common.c:1917:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/device_mapper/libdm-common.c:1922:15: branch_false: ...to here
LVM2.2.03.38/device_mapper/libdm-common.c:1924:12: branch_true: following ‘true’ branch (when ‘len > buf_size’)...
LVM2.2.03.38/device_mapper/libdm-common.c:1925:17: branch_true: ...to here
LVM2.2.03.38/device_mapper/libdm-common.c:1925:17: throw: if the called function throws an exception...
LVM2.2.03.38/device_mapper/libdm-common.c:1925:17: danger: ‘fopen(&sysfs_path, "r")’ leaks here; was allocated at [(3)](sarif:/runs/0/results/41/codeFlows/0/threadFlows/0/locations/2)
# 1923|   
# 1924|   	if (len > buf_size) {
# 1925|-> 		log_error("_sysfs_get_dm_name: supplied buffer too small.");
# 1926|   		goto bad;
# 1927|   	}

Error: GCC_ANALYZER_WARNING (CWE-401): [#def152]
LVM2.2.03.38/device_mapper/libdm-common.c:1982:32: warning[-Wanalyzer-malloc-leak]: leak of ‘opendir(&path)’
LVM2.2.03.38/device_mapper/libdm-common.c:1971:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/device_mapper/libdm-common.c:1972:13: branch_false: ...to here
LVM2.2.03.38/device_mapper/libdm-common.c:1971:13: branch_false: following ‘false’ branch...
LVM2.2.03.38/device_mapper/libdm-common.c:1977:19: branch_false: ...to here
LVM2.2.03.38/device_mapper/libdm-common.c:1977:19: acquire_memory: allocated here
LVM2.2.03.38/device_mapper/libdm-common.c:1977:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/device_mapper/libdm-common.c:1977:12: branch_false: ...to here
LVM2.2.03.38/device_mapper/libdm-common.c:1982:16: branch_true: following ‘true’ branch (when ‘r == 0’)...
LVM2.2.03.38/device_mapper/libdm-common.c:1982:32: branch_true: ...to here
LVM2.2.03.38/device_mapper/libdm-common.c:1982:32: throw: if ‘readdir’ throws an exception...
LVM2.2.03.38/device_mapper/libdm-common.c:1982:32: danger: ‘opendir(&path)’ leaks here; was allocated at [(5)](sarif:/runs/0/results/42/codeFlows/0/threadFlows/0/locations/4)
# 1980|   	}
# 1981|   
# 1982|-> 	while (!r && (dirent = readdir(d))) {
# 1983|   		name = dirent->d_name;
# 1984|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def153]
LVM2.2.03.38/device_mapper/libdm-common.c:2011:46: warning[-Wanalyzer-malloc-leak]: leak of ‘opendir(&path)’
LVM2.2.03.38/device_mapper/libdm-common.c:1971:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/device_mapper/libdm-common.c:1972:13: branch_false: ...to here
LVM2.2.03.38/device_mapper/libdm-common.c:1971:13: branch_false: following ‘false’ branch...
LVM2.2.03.38/device_mapper/libdm-common.c:1977:19: branch_false: ...to here
LVM2.2.03.38/device_mapper/libdm-common.c:1977:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/device_mapper/libdm-common.c:1977:12: branch_false: ...to here
LVM2.2.03.38/device_mapper/libdm-common.c:1982:16: branch_true: following ‘true’ branch...
LVM2.2.03.38/device_mapper/libdm-common.c:1994:20: branch_false: following ‘false’ branch...
LVM2.2.03.38/device_mapper/libdm-common.c:1999:22: branch_false: ...to here
LVM2.2.03.38/device_mapper/libdm-common.c:2006:39: acquire_memory: allocated here
LVM2.2.03.38/device_mapper/libdm-common.c:2011:46: throw: if ‘readdir’ throws an exception...
LVM2.2.03.38/device_mapper/libdm-common.c:2011:46: danger: ‘opendir(&path)’ leaks here; was allocated at [(11)](sarif:/runs/0/results/43/codeFlows/0/threadFlows/0/locations/10)
# 2009|   			}
# 2010|   
# 2011|-> 			while ((dirent_dev = readdir(d_dev))) {
# 2012|   				name_dev = dirent_dev->d_name;
# 2013|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def154]
LVM2.2.03.38/device_mapper/libdm-common.c:2066:17: warning[-Wanalyzer-malloc-leak]: leak of ‘sysfs_path’
LVM2.2.03.38/device_mapper/libdm-common.c:2064:28: acquire_memory: allocated here
LVM2.2.03.38/device_mapper/libdm-common.c:2064:12: branch_false: following ‘false’ branch (when ‘sysfs_path’ is non-NULL)...
LVM2.2.03.38/device_mapper/libdm-common.c:2065:26: branch_false: ...to here
LVM2.2.03.38/device_mapper/libdm-common.c:2064:13: branch_true: following ‘true’ branch (when ‘temp_buf’ is NULL)...
LVM2.2.03.38/device_mapper/libdm-common.c:2066:17: branch_true: ...to here
LVM2.2.03.38/device_mapper/libdm-common.c:2066:17: throw: if the called function throws an exception...
LVM2.2.03.38/device_mapper/libdm-common.c:2066:17: danger: ‘sysfs_path’ leaks here; was allocated at [(1)](sarif:/runs/0/results/44/codeFlows/0/threadFlows/0/locations/0)
# 2064|   	if (!(sysfs_path = malloc(PATH_MAX)) ||
# 2065|   	    !(temp_buf = malloc(PATH_MAX))) {
# 2066|-> 		log_error("_sysfs_get_kernel_name: failed to allocate temporary buffers");
# 2067|   		goto bad;
# 2068|   	}

Error: GCC_ANALYZER_WARNING (CWE-401): [#def155]
LVM2.2.03.38/device_mapper/libdm-common.c:2070:13: warning[-Wanalyzer-malloc-leak]: leak of ‘sysfs_path’
LVM2.2.03.38/device_mapper/libdm-common.c:2064:28: acquire_memory: allocated here
LVM2.2.03.38/device_mapper/libdm-common.c:2064:12: branch_false: following ‘false’ branch (when ‘sysfs_path’ is non-NULL)...
LVM2.2.03.38/device_mapper/libdm-common.c:2065:26: branch_false: ...to here
LVM2.2.03.38/device_mapper/libdm-common.c:2064:13: branch_false: following ‘false’ branch (when ‘temp_buf’ is non-NULL)...
LVM2.2.03.38/device_mapper/libdm-common.c:2070:13: branch_false: ...to here
LVM2.2.03.38/device_mapper/libdm-common.c:2070:13: throw: if ‘dm_snprintf’ throws an exception...
LVM2.2.03.38/device_mapper/libdm-common.c:2070:13: danger: ‘sysfs_path’ leaks here; was allocated at [(1)](sarif:/runs/0/results/45/codeFlows/0/threadFlows/0/locations/0)
# 2068|   	}
# 2069|   
# 2070|-> 	if (dm_snprintf(sysfs_path, PATH_MAX, "%sdev/block/%" PRIu32 ":%" PRIu32,
# 2071|   			_sysfs_dir, major, minor) < 0) {
# 2072|   		log_error("_sysfs_get_kernel_name: dm_snprintf failed");

Error: GCC_ANALYZER_WARNING (CWE-401): [#def156]
LVM2.2.03.38/device_mapper/libdm-common.c:2070:13: warning[-Wanalyzer-malloc-leak]: leak of ‘temp_buf’
LVM2.2.03.38/device_mapper/libdm-common.c:2064:12: branch_false: following ‘false’ branch (when ‘sysfs_path’ is non-NULL)...
LVM2.2.03.38/device_mapper/libdm-common.c:2065:26: branch_false: ...to here
LVM2.2.03.38/device_mapper/libdm-common.c:2065:26: acquire_memory: allocated here
LVM2.2.03.38/device_mapper/libdm-common.c:2064:13: branch_false: following ‘false’ branch (when ‘temp_buf’ is non-NULL)...
LVM2.2.03.38/device_mapper/libdm-common.c:2070:13: branch_false: ...to here
LVM2.2.03.38/device_mapper/libdm-common.c:2070:13: throw: if ‘dm_snprintf’ throws an exception...
LVM2.2.03.38/device_mapper/libdm-common.c:2070:13: danger: ‘temp_buf’ leaks here; was allocated at [(3)](sarif:/runs/0/results/46/codeFlows/0/threadFlows/0/locations/2)
# 2068|   	}
# 2069|   
# 2070|-> 	if (dm_snprintf(sysfs_path, PATH_MAX, "%sdev/block/%" PRIu32 ":%" PRIu32,
# 2071|   			_sysfs_dir, major, minor) < 0) {
# 2072|   		log_error("_sysfs_get_kernel_name: dm_snprintf failed");

Error: GCC_ANALYZER_WARNING (CWE-401): [#def157]
LVM2.2.03.38/device_mapper/libdm-common.c:2072:17: warning[-Wanalyzer-malloc-leak]: leak of ‘temp_buf’
LVM2.2.03.38/device_mapper/libdm-common.c:2064:12: branch_false: following ‘false’ branch (when ‘sysfs_path’ is non-NULL)...
LVM2.2.03.38/device_mapper/libdm-common.c:2065:26: branch_false: ...to here
LVM2.2.03.38/device_mapper/libdm-common.c:2065:26: acquire_memory: allocated here
LVM2.2.03.38/device_mapper/libdm-common.c:2064:13: branch_false: following ‘false’ branch (when ‘temp_buf’ is non-NULL)...
LVM2.2.03.38/device_mapper/libdm-common.c:2070:13: branch_false: ...to here
LVM2.2.03.38/device_mapper/libdm-common.c:2070:12: branch_true: following ‘true’ branch...
LVM2.2.03.38/device_mapper/libdm-common.c:2072:17: branch_true: ...to here
LVM2.2.03.38/device_mapper/libdm-common.c:2072:17: throw: if the called function throws an exception...
LVM2.2.03.38/device_mapper/libdm-common.c:2072:17: danger: ‘temp_buf’ leaks here; was allocated at [(3)](sarif:/runs/0/results/47/codeFlows/0/threadFlows/0/locations/2)
# 2070|   	if (dm_snprintf(sysfs_path, PATH_MAX, "%sdev/block/%" PRIu32 ":%" PRIu32,
# 2071|   			_sysfs_dir, major, minor) < 0) {
# 2072|-> 		log_error("_sysfs_get_kernel_name: dm_snprintf failed");
# 2073|   		goto bad;
# 2074|   	}

Error: GCC_ANALYZER_WARNING (CWE-401): [#def158]
LVM2.2.03.38/device_mapper/libdm-common.c:2177:26: warning[-Wanalyzer-malloc-leak]: leak of ‘opendir(&sysfs_path)’
LVM2.2.03.38/device_mapper/libdm-common.c:2166:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/device_mapper/libdm-common.c:2171:19: branch_false: ...to here
LVM2.2.03.38/device_mapper/libdm-common.c:2171:19: acquire_memory: allocated here
LVM2.2.03.38/device_mapper/libdm-common.c:2171:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/device_mapper/libdm-common.c:2171:12: branch_false: ...to here
LVM2.2.03.38/device_mapper/libdm-common.c:2177:26: throw: if ‘readdir’ throws an exception...
LVM2.2.03.38/device_mapper/libdm-common.c:2177:26: danger: ‘opendir(&sysfs_path)’ leaks here; was allocated at [(3)](sarif:/runs/0/results/48/codeFlows/0/threadFlows/0/locations/2)
# 2175|   	}
# 2176|   
# 2177|-> 	while ((dirent = readdir(d))) {
# 2178|   		if (!strcmp(dirent->d_name, ".") || !strcmp(dirent->d_name, ".."))
# 2179|   			continue;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def159]
LVM2.2.03.38/device_mapper/libdm-common.c:2266:14: warning[-Wanalyzer-malloc-leak]: leak of ‘dm_task_create(15)’
LVM2.2.03.38/device_mapper/libdm-common.c:2255:5: enter_function: entry to ‘dm_mknodes’
LVM2.2.03.38/device_mapper/libdm-common.c:2260:21: call_function: calling ‘dm_task_create’ from ‘dm_mknodes’
LVM2.2.03.38/device_mapper/libdm-common.c:2260:21: return_function: returning to ‘dm_mknodes’ from ‘dm_task_create’
LVM2.2.03.38/device_mapper/libdm-common.c:2260:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/device_mapper/libdm-common.c:2263:12: branch_false: ...to here
LVM2.2.03.38/device_mapper/libdm-common.c:2263:12: branch_false: following ‘false’ branch (when ‘name’ is NULL)...
LVM2.2.03.38/device_mapper/libdm-common.c:2266:14: branch_false: ...to here
LVM2.2.03.38/device_mapper/libdm-common.c:2266:14: throw: if ‘dm_task_no_open_count’ throws an exception...
LVM2.2.03.38/device_mapper/libdm-common.c:2266:14: danger: ‘dm_task_create(15)’ leaks here; was allocated at [(5)](sarif:/runs/0/results/49/codeFlows/0/threadFlows/0/locations/4)
# 2264|   		goto out;
# 2265|   
# 2266|-> 	if (!dm_task_no_open_count(dmt))
# 2267|   		goto out;
# 2268|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def160]
LVM2.2.03.38/device_mapper/libdm-common.c:2284:14: warning[-Wanalyzer-malloc-leak]: leak of ‘dm_task_create(9)’
LVM2.2.03.38/device_mapper/libdm-common.c:2276:5: enter_function: entry to ‘dm_driver_version’
LVM2.2.03.38/device_mapper/libdm-common.c:2281:21: call_function: calling ‘dm_task_create’ from ‘dm_driver_version’
LVM2.2.03.38/device_mapper/libdm-common.c:2281:21: return_function: returning to ‘dm_driver_version’ from ‘dm_task_create’
LVM2.2.03.38/device_mapper/libdm-common.c:2281:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/device_mapper/libdm-common.c:2284:14: branch_false: ...to here
LVM2.2.03.38/device_mapper/libdm-common.c:2284:14: throw: if ‘dm_task_run’ throws an exception...
LVM2.2.03.38/device_mapper/libdm-common.c:2284:14: danger: ‘dm_task_create(9)’ leaks here; was allocated at [(5)](sarif:/runs/0/results/50/codeFlows/0/threadFlows/0/locations/4)
# 2282|   		return_0;
# 2283|   
# 2284|-> 	if (!dm_task_run(dmt))
# 2285|   		log_error("Failed to get driver version");
# 2286|   

Error: GCC_ANALYZER_WARNING (CWE-775): [#def161]
LVM2.2.03.38/device_mapper/libdm-common.c:2587:25: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘open("/dev/urandom", 0)’
LVM2.2.03.38/device_mapper/libdm-common.c:2576:19: acquire_resource: opened here
LVM2.2.03.38/device_mapper/libdm-common.c:2576:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/device_mapper/libdm-common.c:2576:12: branch_false: ...to here
LVM2.2.03.38/device_mapper/libdm-common.c:2587:25: throw: if the called function throws an exception...
LVM2.2.03.38/device_mapper/libdm-common.c:2587:25: danger: ‘open("/dev/urandom", 0)’ leaks here; was opened at [(1)](sarif:/runs/0/results/51/codeFlows/0/threadFlows/0/locations/0)
# 2585|   		/* FIXME Handle non-error returns from read(). Move _io() into libdm? */
# 2586|   		if (read(fd, &base_cookie, sizeof(base_cookie)) != sizeof(base_cookie)) {
# 2587|-> 			log_error("Failed to initialize notification cookie");
# 2588|   			goto bad;
# 2589|   		}

Error: GCC_ANALYZER_WARNING (CWE-775): [#def162]
LVM2.2.03.38/device_mapper/libdm-common.c:2591:30: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘open("/dev/urandom", 0)’
LVM2.2.03.38/device_mapper/libdm-common.c:2576:19: acquire_resource: opened here
LVM2.2.03.38/device_mapper/libdm-common.c:2576:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/device_mapper/libdm-common.c:2576:12: branch_false: ...to here
LVM2.2.03.38/device_mapper/libdm-common.c:2586:20: branch_false: following ‘false’ branch...
LVM2.2.03.38/device_mapper/libdm-common.c:2591:30: branch_false: ...to here
LVM2.2.03.38/device_mapper/libdm-common.c:2602:41: throw: if the called function throws an exception...
LVM2.2.03.38/device_mapper/libdm-common.c:2591:30: danger: ‘open("/dev/urandom", 0)’ leaks here; was opened at [(1)](sarif:/runs/0/results/53/codeFlows/0/threadFlows/0/locations/0)
# 2589|   		}
# 2590|   
# 2591|-> 		gen_cookie = DM_COOKIE_MAGIC << 16 | base_cookie;
# 2592|   
# 2593|   		if (base_cookie && (gen_semid = semget((key_t) gen_cookie,

Error: GCC_ANALYZER_WARNING (CWE-401): [#def163]
LVM2.2.03.38/device_mapper/libdm-file.c:28:17: warning[-Wanalyzer-malloc-leak]: leak of ‘s’
LVM2.2.03.38/device_mapper/libdm-file.c:41:12: enter_function: entry to ‘_create_dir_recursive’
LVM2.2.03.38/device_mapper/libdm-file.c:48:20: acquire_memory: allocated here
LVM2.2.03.38/device_mapper/libdm-file.c:49:12: branch_false: following ‘false’ branch (when ‘s’ is non-NULL)...
LVM2.2.03.38/device_mapper/libdm-file.c:49:12: branch_false: ...to here
LVM2.2.03.38/device_mapper/libdm-file.c:54:16: branch_false: following ‘false’ branch (when ‘s’ is NULL)...
LVM2.2.03.38/device_mapper/libdm-file.c:73:14: branch_false: ...to here
LVM2.2.03.38/device_mapper/libdm-file.c:74:12: branch_true: following ‘true’ branch (when ‘rc < 0’)...
LVM2.2.03.38/device_mapper/libdm-file.c:75:21: branch_true: ...to here
LVM2.2.03.38/device_mapper/libdm-file.c:75:20: branch_true: following ‘true’ branch...
LVM2.2.03.38/device_mapper/libdm-file.c:76:30: branch_true: ...to here
LVM2.2.03.38/device_mapper/libdm-file.c:76:30: call_function: calling ‘_is_dir’ from ‘_create_dir_recursive’
#   26|   
#   27|   	if (stat(path, &st) < 0) {
#   28|-> 		log_sys_error("stat", path);
#   29|   		return 0;
#   30|   	}

Error: GCC_ANALYZER_WARNING (CWE-401): [#def164]
LVM2.2.03.38/device_mapper/libdm-file.c:33:17: warning[-Wanalyzer-malloc-leak]: leak of ‘s’
LVM2.2.03.38/device_mapper/libdm-file.c:41:12: enter_function: entry to ‘_create_dir_recursive’
LVM2.2.03.38/device_mapper/libdm-file.c:48:20: acquire_memory: allocated here
LVM2.2.03.38/device_mapper/libdm-file.c:49:12: branch_false: following ‘false’ branch (when ‘s’ is non-NULL)...
LVM2.2.03.38/device_mapper/libdm-file.c:49:12: branch_false: ...to here
LVM2.2.03.38/device_mapper/libdm-file.c:54:16: branch_false: following ‘false’ branch (when ‘s’ is NULL)...
LVM2.2.03.38/device_mapper/libdm-file.c:73:14: branch_false: ...to here
LVM2.2.03.38/device_mapper/libdm-file.c:74:12: branch_true: following ‘true’ branch (when ‘rc < 0’)...
LVM2.2.03.38/device_mapper/libdm-file.c:75:21: branch_true: ...to here
LVM2.2.03.38/device_mapper/libdm-file.c:75:20: branch_true: following ‘true’ branch...
LVM2.2.03.38/device_mapper/libdm-file.c:76:30: branch_true: ...to here
LVM2.2.03.38/device_mapper/libdm-file.c:76:30: call_function: calling ‘_is_dir’ from ‘_create_dir_recursive’
#   31|   
#   32|   	if (!S_ISDIR(st.st_mode)) {
#   33|-> 		log_error("Existing path %s is not "
#   34|   			  "a directory.", path);
#   35|   		return 0;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def165]
LVM2.2.03.38/device_mapper/libdm-file.c:64:49: warning[-Wanalyzer-malloc-leak]: leak of ‘s’
LVM2.2.03.38/device_mapper/libdm-file.c:48:20: acquire_memory: allocated here
LVM2.2.03.38/device_mapper/libdm-file.c:49:12: branch_false: following ‘false’ branch (when ‘s’ is non-NULL)...
LVM2.2.03.38/device_mapper/libdm-file.c:49:12: branch_false: ...to here
LVM2.2.03.38/device_mapper/libdm-file.c:54:16: branch_true: following ‘true’ branch (when ‘s’ is non-NULL)...
LVM2.2.03.38/device_mapper/libdm-file.c:55:17: branch_true: ...to here
LVM2.2.03.38/device_mapper/libdm-file.c:56:20: branch_true: following ‘true’ branch...
LVM2.2.03.38/device_mapper/libdm-file.c:57:30: branch_true: ...to here
LVM2.2.03.38/device_mapper/libdm-file.c:58:28: branch_true: following ‘true’ branch (when ‘rc < 0’)...
LVM2.2.03.38/device_mapper/libdm-file.c:59:37: branch_true: ...to here
LVM2.2.03.38/device_mapper/libdm-file.c:59:36: branch_false: following ‘false’ branch...
LVM2.2.03.38/device_mapper/libdm-file.c:63:44: branch_false: ...to here
LVM2.2.03.38/device_mapper/libdm-file.c:63:44: branch_true: following ‘true’ branch...
LVM2.2.03.38/device_mapper/libdm-file.c:64:49: branch_true: ...to here
LVM2.2.03.38/device_mapper/libdm-file.c:64:49: throw: if the called function throws an exception...
LVM2.2.03.38/device_mapper/libdm-file.c:64:49: danger: ‘s’ leaks here; was allocated at [(1)](sarif:/runs/0/results/2/codeFlows/0/threadFlows/0/locations/0)
#   62|   				} else {
#   63|   					if (errno != EROFS)
#   64|-> 						log_sys_error("mkdir", orig);
#   65|   					goto out;
#   66|   				}

Error: GCC_ANALYZER_WARNING (CWE-401): [#def166]
LVM2.2.03.38/device_mapper/libdm-file.c:77:33: warning[-Wanalyzer-malloc-leak]: leak of ‘s’
LVM2.2.03.38/device_mapper/libdm-file.c:48:20: acquire_memory: allocated here
LVM2.2.03.38/device_mapper/libdm-file.c:49:12: branch_false: following ‘false’ branch (when ‘s’ is non-NULL)...
LVM2.2.03.38/device_mapper/libdm-file.c:49:12: branch_false: ...to here
LVM2.2.03.38/device_mapper/libdm-file.c:54:16: branch_false: following ‘false’ branch (when ‘s’ is NULL)...
LVM2.2.03.38/device_mapper/libdm-file.c:73:14: branch_false: ...to here
LVM2.2.03.38/device_mapper/libdm-file.c:74:12: branch_true: following ‘true’ branch (when ‘rc < 0’)...
LVM2.2.03.38/device_mapper/libdm-file.c:75:21: branch_true: ...to here
LVM2.2.03.38/device_mapper/libdm-file.c:75:20: branch_true: following ‘true’ branch...
LVM2.2.03.38/device_mapper/libdm-file.c:76:30: branch_true: ...to here
LVM2.2.03.38/device_mapper/libdm-file.c:76:28: branch_true: following ‘true’ branch...
LVM2.2.03.38/device_mapper/libdm-file.c:77:33: branch_true: ...to here
LVM2.2.03.38/device_mapper/libdm-file.c:77:33: throw: if the called function throws an exception...
LVM2.2.03.38/device_mapper/libdm-file.c:77:33: danger: ‘s’ leaks here; was allocated at [(1)](sarif:/runs/0/results/3/codeFlows/0/threadFlows/0/locations/0)
#   75|   		if (errno == EEXIST) {
#   76|   			if (!_is_dir(dir))
#   77|-> 				goto_out;
#   78|   		} else {
#   79|   			if (errno != EROFS)

Error: GCC_ANALYZER_WARNING (CWE-401): [#def167]
LVM2.2.03.38/device_mapper/libdm-file.c:80:33: warning[-Wanalyzer-malloc-leak]: leak of ‘s’
LVM2.2.03.38/device_mapper/libdm-file.c:48:20: acquire_memory: allocated here
LVM2.2.03.38/device_mapper/libdm-file.c:49:12: branch_false: following ‘false’ branch (when ‘s’ is non-NULL)...
LVM2.2.03.38/device_mapper/libdm-file.c:49:12: branch_false: ...to here
LVM2.2.03.38/device_mapper/libdm-file.c:54:16: branch_false: following ‘false’ branch (when ‘s’ is NULL)...
LVM2.2.03.38/device_mapper/libdm-file.c:73:14: branch_false: ...to here
LVM2.2.03.38/device_mapper/libdm-file.c:74:12: branch_true: following ‘true’ branch (when ‘rc < 0’)...
LVM2.2.03.38/device_mapper/libdm-file.c:75:21: branch_true: ...to here
LVM2.2.03.38/device_mapper/libdm-file.c:75:20: branch_false: following ‘false’ branch...
LVM2.2.03.38/device_mapper/libdm-file.c:79:28: branch_false: ...to here
LVM2.2.03.38/device_mapper/libdm-file.c:79:28: branch_true: following ‘true’ branch...
LVM2.2.03.38/device_mapper/libdm-file.c:80:33: branch_true: ...to here
LVM2.2.03.38/device_mapper/libdm-file.c:80:33: throw: if the called function throws an exception...
LVM2.2.03.38/device_mapper/libdm-file.c:80:33: danger: ‘s’ leaks here; was allocated at [(1)](sarif:/runs/0/results/4/codeFlows/0/threadFlows/0/locations/0)
#   78|   		} else {
#   79|   			if (errno != EROFS)
#   80|-> 				log_sys_error("mkdir", orig);
#   81|   			goto out;
#   82|   		}

Error: GCC_ANALYZER_WARNING (CWE-401): [#def168]
LVM2.2.03.38/device_mapper/libdm-file.c:117:26: warning[-Wanalyzer-malloc-leak]: leak of ‘opendir(dir)’
LVM2.2.03.38/device_mapper/libdm-file.c:112:19: acquire_memory: allocated here
LVM2.2.03.38/device_mapper/libdm-file.c:112:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/device_mapper/libdm-file.c:112:12: branch_false: ...to here
LVM2.2.03.38/device_mapper/libdm-file.c:117:26: throw: if ‘readdir’ throws an exception...
LVM2.2.03.38/device_mapper/libdm-file.c:117:26: danger: ‘opendir(dir)’ leaks here; was allocated at [(1)](sarif:/runs/0/results/5/codeFlows/0/threadFlows/0/locations/0)
#  115|   	}
#  116|   
#  117|-> 	while ((dirent = readdir(d)))
#  118|   		if (strcmp(dirent->d_name, ".") && strcmp(dirent->d_name, ".."))
#  119|   			break;

Error: GCC_ANALYZER_WARNING (CWE-775): [#def169]
LVM2.2.03.38/device_mapper/libdm-file.c:250:12: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘open(lockfile, 0)’
LVM2.2.03.38/device_mapper/libdm-file.c:243:17: acquire_resource: opened here
LVM2.2.03.38/device_mapper/libdm-file.c:243:10: branch_false: following ‘false’ branch...
LVM2.2.03.38/device_mapper/libdm-file.c:246:8: branch_false: ...to here
LVM2.2.03.38/device_mapper/libdm-file.c:250:12: throw: if ‘fcntl’ throws an exception...
LVM2.2.03.38/device_mapper/libdm-file.c:250:12: danger: ‘open(lockfile, 0)’ leaks here; was opened at [(1)](sarif:/runs/0/results/6/codeFlows/0/threadFlows/0/locations/0)
#  248|          lock.l_whence = SEEK_SET;
#  249|          lock.l_len = 0;
#  250|->        if (fcntl(fd, F_GETLK, &lock) < 0) {
#  251|                  log_error("Cannot check lock status of lockfile [%s], error was [%s]",
#  252|                            lockfile, strerror(errno));

Error: GCC_ANALYZER_WARNING (CWE-401): [#def170]
LVM2.2.03.38/device_mapper/libdm-report.c:1344:36: warning[-Wanalyzer-malloc-leak]: leak of ‘calloc(1, 160)’
LVM2.2.03.38/device_mapper/libdm-report.c:4432:19: enter_function: entry to ‘dm_report_init_with_selection’
LVM2.2.03.38/device_mapper/libdm-report.c:4447:20: call_function: calling ‘dm_report_init’ from ‘dm_report_init_with_selection’
# 1342|   	 */
# 1343|   	if (report_types)
# 1344|-> 		rh->report_types = *report_types;
# 1345|   
# 1346|   	rh->separator = output_separator;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def171]
LVM2.2.03.38/device_mapper/libdm-report.c:1351:9: warning[-Wanalyzer-malloc-leak]: leak of ‘calloc(1, 160)’
LVM2.2.03.38/device_mapper/libdm-report.c:4432:19: enter_function: entry to ‘dm_report_init_with_selection’
LVM2.2.03.38/device_mapper/libdm-report.c:4447:20: call_function: calling ‘dm_report_init’ from ‘dm_report_init_with_selection’
# 1349|   	rh->private = private_data;
# 1350|   
# 1351|-> 	rh->flags |= output_flags & DM_REPORT_OUTPUT_MASK;
# 1352|   
# 1353|   	/* With columns_as_rows we must buffer and not align. */

Error: GCC_ANALYZER_WARNING (CWE-401): [#def172]
LVM2.2.03.38/device_mapper/libdm-report.c:4807:29: warning[-Wanalyzer-malloc-leak]: leak of ‘buf’
LVM2.2.03.38/device_mapper/libdm-report.c:4788:12: branch_true: following ‘true’ branch...
LVM2.2.03.38/device_mapper/libdm-report.c:4789:31: branch_true: ...to here
LVM2.2.03.38/device_mapper/libdm-report.c:4798:20: branch_false: following ‘false’ branch (when ‘buf_size > 8191’)...
LVM2.2.03.38/device_mapper/libdm-report.c:4801:34: branch_false: ...to here
LVM2.2.03.38/device_mapper/libdm-report.c:4801:34: acquire_memory: allocated here
LVM2.2.03.38/device_mapper/libdm-report.c:4801:25: branch_false: following ‘false’ branch (when ‘buf’ is non-NULL)...
LVM2.2.03.38/device_mapper/libdm-report.c:4806:21: branch_false: ...to here
LVM2.2.03.38/device_mapper/libdm-report.c:4806:20: branch_true: following ‘true’ branch...
LVM2.2.03.38/device_mapper/libdm-report.c:4807:29: branch_true: ...to here
LVM2.2.03.38/device_mapper/libdm-report.c:4807:29: throw: if ‘dm_snprintf’ throws an exception...
LVM2.2.03.38/device_mapper/libdm-report.c:4807:29: danger: ‘buf’ leaks here; was allocated at [(5)](sarif:/runs/0/results/2/codeFlows/0/threadFlows/0/locations/4)
# 4805|   
# 4806|   		if (align & DM_REPORT_FIELD_ALIGN_LEFT) {
# 4807|-> 			if (dm_snprintf(buf, buf_size, "%-*.*s",
# 4808|   					 width, width, field->report_string) < 0) {
# 4809|   				log_error("dm_report: left-aligned snprintf() failed");

Error: GCC_ANALYZER_WARNING (CWE-401): [#def173]
LVM2.2.03.38/device_mapper/libdm-report.c:4817:29: warning[-Wanalyzer-malloc-leak]: leak of ‘buf’
LVM2.2.03.38/device_mapper/libdm-report.c:4788:12: branch_true: following ‘true’ branch...
LVM2.2.03.38/device_mapper/libdm-report.c:4789:31: branch_true: ...to here
LVM2.2.03.38/device_mapper/libdm-report.c:4798:20: branch_false: following ‘false’ branch (when ‘buf_size > 8191’)...
LVM2.2.03.38/device_mapper/libdm-report.c:4801:34: branch_false: ...to here
LVM2.2.03.38/device_mapper/libdm-report.c:4801:34: acquire_memory: allocated here
LVM2.2.03.38/device_mapper/libdm-report.c:4801:25: branch_false: following ‘false’ branch (when ‘buf’ is non-NULL)...
LVM2.2.03.38/device_mapper/libdm-report.c:4806:21: branch_false: ...to here
LVM2.2.03.38/device_mapper/libdm-report.c:4806:20: branch_false: following ‘false’ branch...
LVM2.2.03.38/device_mapper/libdm-report.c:4816:28: branch_false: ...to here
LVM2.2.03.38/device_mapper/libdm-report.c:4816:27: branch_true: following ‘true’ branch...
LVM2.2.03.38/device_mapper/libdm-report.c:4817:29: branch_true: ...to here
LVM2.2.03.38/device_mapper/libdm-report.c:4817:29: throw: if ‘dm_snprintf’ throws an exception...
LVM2.2.03.38/device_mapper/libdm-report.c:4817:29: danger: ‘buf’ leaks here; was allocated at [(5)](sarif:/runs/0/results/3/codeFlows/0/threadFlows/0/locations/4)
# 4815|   			}
# 4816|   		} else if (align & DM_REPORT_FIELD_ALIGN_RIGHT) {
# 4817|-> 			if (dm_snprintf(buf, buf_size, "%*.*s",
# 4818|   					 width, width, field->report_string) < 0) {
# 4819|   				log_error("dm_report: right-aligned snprintf() failed");

Error: GCC_ANALYZER_WARNING (CWE-401): [#def174]
LVM2.2.03.38/device_mapper/libdm-report.c:4837:33: warning[-Wanalyzer-malloc-leak]: leak of ‘buf’
LVM2.2.03.38/device_mapper/libdm-report.c:4757:20: branch_false: following ‘false’ branch (when ‘buf_size <= 8191’)...
LVM2.2.03.38/device_mapper/libdm-report.c:4764:17: branch_false: ...to here
LVM2.2.03.38/device_mapper/libdm-report.c:4766:20: branch_false: following ‘false’ branch...
LVM2.2.03.38/device_mapper/libdm-report.c:4771:51: branch_false: ...to here
LVM2.2.03.38/device_mapper/libdm-report.c:4771:20: branch_false: following ‘false’ branch...
LVM2.2.03.38/device_mapper/libdm-report.c:4776:22: branch_false: ...to here
LVM2.2.03.38/device_mapper/libdm-report.c:4776:20: branch_false: following ‘false’ branch...
LVM2.2.03.38/device_mapper/libdm-report.c:4781:23: branch_false: ...to here
LVM2.2.03.38/device_mapper/libdm-report.c:4788:12: branch_true: following ‘true’ branch...
LVM2.2.03.38/device_mapper/libdm-report.c:4789:31: branch_true: ...to here
LVM2.2.03.38/device_mapper/libdm-report.c:4798:20: branch_false: following ‘false’ branch (when ‘buf_size > 8191’)...
LVM2.2.03.38/device_mapper/libdm-report.c:4801:34: branch_false: ...to here
LVM2.2.03.38/device_mapper/libdm-report.c:4801:34: acquire_memory: allocated here
LVM2.2.03.38/device_mapper/libdm-report.c:4801:25: branch_false: following ‘false’ branch (when ‘buf’ is non-NULL)...
LVM2.2.03.38/device_mapper/libdm-report.c:4806:21: branch_false: ...to here
LVM2.2.03.38/device_mapper/libdm-report.c:4806:20: branch_false: following ‘false’ branch...
LVM2.2.03.38/device_mapper/libdm-report.c:4816:28: branch_false: ...to here
LVM2.2.03.38/device_mapper/libdm-report.c:4816:27: branch_false: following ‘false’ branch...
LVM2.2.03.38/device_mapper/libdm-report.c:4834:13: branch_false: ...to here
LVM2.2.03.38/device_mapper/libdm-report.c:4834:12: branch_true: following ‘true’ branch...
LVM2.2.03.38/device_mapper/libdm-report.c:4835:22: branch_true: ...to here
LVM2.2.03.38/device_mapper/libdm-report.c:4835:20: branch_true: following ‘true’ branch...
LVM2.2.03.38/device_mapper/libdm-report.c:4836:30: branch_true: ...to here
LVM2.2.03.38/device_mapper/libdm-report.c:4836:28: branch_true: following ‘true’ branch...
LVM2.2.03.38/device_mapper/libdm-report.c:4837:33: branch_true: ...to here
LVM2.2.03.38/device_mapper/libdm-report.c:4837:33: throw: if the called function throws an exception...
LVM2.2.03.38/device_mapper/libdm-report.c:4837:33: danger: ‘buf’ leaks here; was allocated at [(13)](sarif:/runs/0/results/4/codeFlows/0/threadFlows/0/locations/12)
# 4835|   		if (!(rh->flags & DM_REPORT_OUTPUT_FIELD_UNQUOTED)) {
# 4836|   			if (!dm_pool_grow_object(rh->mem, STANDARD_QUOTE, 1)) {
# 4837|-> 				log_error(UNABLE_TO_EXTEND_OUTPUT_LINE_MSG);
# 4838|   				goto bad;
# 4839|   			}

Error: GCC_ANALYZER_WARNING (CWE-401): [#def175]
LVM2.2.03.38/device_mapper/mm/pool-fast.c:62:25: warning[-Wanalyzer-malloc-leak]: leak of ‘calloc(1, 72)’
LVM2.2.03.38/device_mapper/mm/pool-fast.c:49:17: enter_function: entry to ‘dm_pool_create’
LVM2.2.03.38/device_mapper/mm/pool-fast.c:52:29: call_function: inlined call to ‘zalloc’ from ‘dm_pool_create’
LVM2.2.03.38/device_mapper/mm/pool-fast.c:54:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/device_mapper/mm/pool-fast.c:60:9: branch_false: ...to here
LVM2.2.03.38/device_mapper/mm/pool-fast.c:67:9: throw: if ‘dm_list_add’ throws an exception...
LVM2.2.03.38/device_mapper/mm/pool-fast.c:62:25: danger: ‘calloc(1, 72)’ leaks here; was allocated at [(3)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/2)
#   60|   	p->name = name;
#   61|   	/* round chunk_hint up to the next power of 2 */
#   62|-> 	p->chunk_size = chunk_hint + sizeof(struct chunk);
#   63|   	while (new_size < p->chunk_size)
#   64|   		new_size <<= 1;

Error: GCC_ANALYZER_WARNING (CWE-775): [#def176]
LVM2.2.03.38/device_mapper/raid/raid_parser.c:118:17: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘open(dev_path,  <unknown>)’
LVM2.2.03.38/device_mapper/raid/raid_parser.c:106:13: branch_true: following ‘true’ branch...
LVM2.2.03.38/device_mapper/raid/raid_parser.c:106:13: branch_true: ...to here
LVM2.2.03.38/device_mapper/raid/raid_parser.c:111:14: acquire_resource: opened here
LVM2.2.03.38/device_mapper/raid/raid_parser.c:112:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/device_mapper/raid/raid_parser.c:117:13: branch_false: ...to here
LVM2.2.03.38/device_mapper/raid/raid_parser.c:117:12: branch_true: following ‘true’ branch...
LVM2.2.03.38/device_mapper/raid/raid_parser.c:118:17: branch_true: ...to here
LVM2.2.03.38/device_mapper/raid/raid_parser.c:118:17: throw: if the called function throws an exception...
LVM2.2.03.38/device_mapper/raid/raid_parser.c:118:17: danger: ‘open(dev_path,  <unknown>)’ leaks here; was opened at [(3)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/2)
#  116|   
#  117|   	if (read(fd, sb, SB_BUFSZ) != SB_BUFSZ) {
#  118|-> 		log_sys_error("Failed to read RAID metadata volume", dev_path);
#  119|   		goto out;
#  120|   	}

Error: GCC_ANALYZER_WARNING (CWE-775): [#def177]
LVM2.2.03.38/device_mapper/raid/raid_parser.c:123:13: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘open(dev_path,  <unknown>)’
LVM2.2.03.38/device_mapper/raid/raid_parser.c:106:13: branch_true: following ‘true’ branch...
LVM2.2.03.38/device_mapper/raid/raid_parser.c:106:13: branch_true: ...to here
LVM2.2.03.38/device_mapper/raid/raid_parser.c:111:14: acquire_resource: opened here
LVM2.2.03.38/device_mapper/raid/raid_parser.c:112:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/device_mapper/raid/raid_parser.c:117:13: branch_false: ...to here
LVM2.2.03.38/device_mapper/raid/raid_parser.c:117:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/device_mapper/raid/raid_parser.c:123:13: branch_false: ...to here
LVM2.2.03.38/device_mapper/raid/raid_parser.c:123:12: branch_true: following ‘true’ branch...
LVM2.2.03.38/device_mapper/raid/raid_parser.c:124:17: branch_true: ...to here
LVM2.2.03.38/device_mapper/raid/raid_parser.c:124:17: throw: if the called function throws an exception...
LVM2.2.03.38/device_mapper/raid/raid_parser.c:123:13: danger: ‘open(dev_path,  <unknown>)’ leaks here; was opened at [(3)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/2)
#  121|   
#  122|   	/* FIXME: big endian??? */
#  123|-> 	if (sb->magic != htobe32(DM_RAID_SB_MAGIC)) {
#  124|   		log_error("No RAID signature on %s.", dev_path);
#  125|   		goto out;

Error: COMPILER_WARNING: [#def178]
LVM2.2.03.38/lib/activate/dev_manager.c: scope_hint: In function ‘add_areas_line’
LVM2.2.03.38/lib/activate/dev_manager.c:3031:18: warning[-Wunused-but-set-variable=]: variable ‘num_existing_areas’ set but not used
# 3031 |         unsigned num_existing_areas = 0;
#      |                  ^~~~~~~~~~~~~~~~~~
# 3029|   	const char *name;
# 3030|   	unsigned num_error_areas = 0;
# 3031|-> 	unsigned num_existing_areas = 0;
# 3032|   
# 3033|   	for (s = start_area; s < areas; s++) {

Error: GCC_ANALYZER_WARNING (CWE-401): [#def179]
LVM2.2.03.38/lib/activate/fs.c:100:26: warning[-Wanalyzer-malloc-leak]: leak of ‘opendir(dir)’
LVM2.2.03.38/lib/activate/fs.c:474:5: enter_function: entry to ‘fs_rename_lv’
LVM2.2.03.38/lib/activate/fs.c:477:12: branch_false: following ‘false’ branch (when the strings are equal)...
LVM2.2.03.38/lib/activate/fs.c:486:40: branch_false: ...to here
LVM2.2.03.38/lib/activate/fs.c:485:16: call_function: calling ‘_fs_op’ from ‘fs_rename_lv’
#   98|   	}
#   99|   
#  100|-> 	while ((dirent = readdir(d))) {
#  101|   		name = dirent->d_name;
#  102|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def180]
LVM2.2.03.38/lib/cache/lvmcache.c:233:25: warning[-Wanalyzer-malloc-leak]: leak of ‘calloc(1, 24)’
LVM2.2.03.38/lib/cache/lvmcache.c:214:6: enter_function: entry to ‘lvmcache_get_bad_mdas’
LVM2.2.03.38/lib/cache/lvmcache.c:223:24: call_function: calling ‘lvmcache_vginfo_from_vgname’ from ‘lvmcache_get_bad_mdas’
LVM2.2.03.38/lib/cache/lvmcache.c:223:24: return_function: returning to ‘lvmcache_get_bad_mdas’ from ‘lvmcache_vginfo_from_vgname’
LVM2.2.03.38/lib/cache/lvmcache.c:223:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/lib/cache/lvmcache.c:228:9: branch_false: ...to here
LVM2.2.03.38/lib/cache/lvmcache.c:228:9: branch_true: following ‘true’ branch...
LVM2.2.03.38/lib/cache/lvmcache.c:229:17: branch_true: ...to here
LVM2.2.03.38/lib/cache/lvmcache.c:230:38: call_function: inlined call to ‘zalloc’ from ‘lvmcache_get_bad_mdas’
LVM2.2.03.38/lib/cache/lvmcache.c:233:25: danger: ‘calloc(1, 24)’ leaks here; was allocated at [(15)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/14)
#  231|   				continue;
#  232|   			mdal->mda = mda;
#  233|-> 			dm_list_add(bad_mda_list, &mdal->list);
#  234|   		}
#  235|   	}

Error: GCC_ANALYZER_WARNING (CWE-401): [#def181]
LVM2.2.03.38/lib/cache/lvmcache.c:257:25: warning[-Wanalyzer-malloc-leak]: leak of ‘calloc(1, 24)’
LVM2.2.03.38/lib/cache/lvmcache.c:238:6: enter_function: entry to ‘lvmcache_get_mdas’
LVM2.2.03.38/lib/cache/lvmcache.c:247:24: call_function: calling ‘lvmcache_vginfo_from_vgname’ from ‘lvmcache_get_mdas’
LVM2.2.03.38/lib/cache/lvmcache.c:247:24: return_function: returning to ‘lvmcache_get_mdas’ from ‘lvmcache_vginfo_from_vgname’
LVM2.2.03.38/lib/cache/lvmcache.c:247:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/lib/cache/lvmcache.c:252:9: branch_false: ...to here
LVM2.2.03.38/lib/cache/lvmcache.c:252:9: branch_true: following ‘true’ branch...
LVM2.2.03.38/lib/cache/lvmcache.c:253:17: branch_true: ...to here
LVM2.2.03.38/lib/cache/lvmcache.c:254:38: call_function: inlined call to ‘zalloc’ from ‘lvmcache_get_mdas’
LVM2.2.03.38/lib/cache/lvmcache.c:257:25: danger: ‘calloc(1, 24)’ leaks here; was allocated at [(15)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/14)
#  255|   				continue;
#  256|   			mdal->mda = mda;
#  257|-> 			dm_list_add(mda_list, &mdal->list);
#  258|   		}
#  259|   	}

Error: CPPCHECK_WARNING (CWE-476): [#def182]
LVM2.2.03.38/lib/cache/lvmcache.c:298: warning[nullPointer]: Possible null pointer dereference: vgname
#  296|   	} else {
#  297|   		dm_list_iterate_items(vginfo, &_vginfos) {
#  298|-> 			if (!strcmp(vgname, vginfo->vgname))
#  299|   				return vginfo;
#  300|   		}

Error: GCC_ANALYZER_WARNING (CWE-401): [#def183]
LVM2.2.03.38/lib/cache/lvmcache.c:1340:17: warning[-Wanalyzer-malloc-leak]: leak of ‘devl’
LVM2.2.03.38/lib/cache/lvmcache.c:1322:12: enter_function: entry to ‘_label_rescan_vg’
LVM2.2.03.38/lib/cache/lvmcache.c:1331:24: call_function: calling ‘lvmcache_vginfo_from_vgname’ from ‘_label_rescan_vg’
LVM2.2.03.38/lib/cache/lvmcache.c:1331:24: return_function: returning to ‘_label_rescan_vg’ from ‘lvmcache_vginfo_from_vgname’
LVM2.2.03.38/lib/cache/lvmcache.c:1331:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/lib/cache/lvmcache.c:1334:9: branch_false: ...to here
LVM2.2.03.38/lib/cache/lvmcache.c:1334:9: branch_true: following ‘true’ branch...
LVM2.2.03.38/lib/cache/lvmcache.c:1335:30: branch_true: ...to here
LVM2.2.03.38/lib/cache/lvmcache.c:1335:30: acquire_memory: allocated here
LVM2.2.03.38/lib/cache/lvmcache.c:1335:20: branch_false: following ‘false’ branch (when ‘devl’ is non-NULL)...
LVM2.2.03.38/lib/cache/lvmcache.c:1339:29: branch_false: ...to here
LVM2.2.03.38/lib/cache/lvmcache.c:1340:17: throw: if ‘dm_list_add’ throws an exception...
LVM2.2.03.38/lib/cache/lvmcache.c:1340:17: danger: ‘devl’ leaks here; was allocated at [(14)](sarif:/runs/0/results/2/codeFlows/0/threadFlows/0/locations/13)
# 1338|   		}
# 1339|   		devl->dev = info->dev;
# 1340|-> 		dm_list_add(&devs, &devl->list);
# 1341|   	}
# 1342|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def184]
LVM2.2.03.38/lib/cache/lvmcache.c:1867:17: warning[-Wanalyzer-malloc-leak]: leak of ‘<unknown>’
LVM2.2.03.38/lib/cache/lvmcache.c:1835:12: enter_function: entry to ‘_lvmcache_update_vgname’
LVM2.2.03.38/lib/cache/lvmcache.c:1857:12: branch_true: following ‘true’ branch (when ‘info’ is NULL)...
LVM2.2.03.38/lib/cache/lvmcache.c:1858:32: call_function: inlined call to ‘zalloc’ from ‘_lvmcache_update_vgname’
LVM2.2.03.38/lib/cache/lvmcache.c:1858:20: branch_false: following ‘false’ branch...
LVM2.2.03.38/lib/cache/lvmcache.c:1862:40: branch_false: ...to here
LVM2.2.03.38/lib/cache/lvmcache.c:1862:40: acquire_memory: allocated here
LVM2.2.03.38/lib/cache/lvmcache.c:1862:20: branch_false: following ‘false’ branch...
LVM2.2.03.38/lib/cache/lvmcache.c:1867:17: branch_false: ...to here
LVM2.2.03.38/lib/cache/lvmcache.c:1867:17: throw: if ‘dm_list_init’ throws an exception...
LVM2.2.03.38/lib/cache/lvmcache.c:1867:17: danger: ‘<unknown>’ leaks here; was allocated at [(7)](sarif:/runs/0/results/4/codeFlows/0/threadFlows/0/locations/6)
# 1865|   			return 0;
# 1866|   		}
# 1867|-> 		dm_list_init(&vginfo->infos);
# 1868|   		dm_list_init(&vginfo->outdated_infos);
# 1869|   		dm_list_init(&vginfo->pvsummaries);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def185]
LVM2.2.03.38/lib/cache/lvmcache.c:1867:17: warning[-Wanalyzer-malloc-leak]: leak of ‘calloc(1, 176)’
LVM2.2.03.38/lib/cache/lvmcache.c:1835:12: enter_function: entry to ‘_lvmcache_update_vgname’
LVM2.2.03.38/lib/cache/lvmcache.c:1857:12: branch_true: following ‘true’ branch (when ‘info’ is NULL)...
LVM2.2.03.38/lib/cache/lvmcache.c:1858:32: call_function: inlined call to ‘zalloc’ from ‘_lvmcache_update_vgname’
LVM2.2.03.38/lib/cache/lvmcache.c:1858:20: branch_false: following ‘false’ branch...
LVM2.2.03.38/lib/cache/lvmcache.c:1862:40: branch_false: ...to here
LVM2.2.03.38/lib/cache/lvmcache.c:1862:20: branch_false: following ‘false’ branch...
LVM2.2.03.38/lib/cache/lvmcache.c:1867:17: branch_false: ...to here
LVM2.2.03.38/lib/cache/lvmcache.c:1867:17: throw: if ‘dm_list_init’ throws an exception...
LVM2.2.03.38/lib/cache/lvmcache.c:1867:17: danger: ‘calloc(1, 176)’ leaks here; was allocated at [(5)](sarif:/runs/0/results/3/codeFlows/0/threadFlows/0/locations/4)
# 1865|   			return 0;
# 1866|   		}
# 1867|-> 		dm_list_init(&vginfo->infos);
# 1868|   		dm_list_init(&vginfo->outdated_infos);
# 1869|   		dm_list_init(&vginfo->pvsummaries);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def186]
LVM2.2.03.38/lib/cache/lvmcache.c:2053:12: warning[-Wanalyzer-malloc-leak]: leak of ‘strdup(system_id)’
LVM2.2.03.38/lib/cache/lvmcache.c:1997:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/lib/cache/lvmcache.c:2027:12: branch_false: following ‘false’ branch (when ‘lock_type’ is non-NULL)...
LVM2.2.03.38/lib/cache/lvmcache.c:2030:13: branch_false: ...to here
LVM2.2.03.38/lib/cache/lvmcache.c:2035:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/lib/cache/lvmcache.c:2040:9: branch_false: ...to here
LVM2.2.03.38/lib/cache/lvmcache.c:2045:12: branch_false: following ‘false’ branch (when ‘system_id’ is non-NULL)...
LVM2.2.03.38/lib/cache/lvmcache.c:2048:13: branch_false: ...to here
LVM2.2.03.38/lib/cache/lvmcache.c:2053:41: acquire_memory: allocated here
LVM2.2.03.38/lib/cache/lvmcache.c:2053:12: danger: ‘strdup(system_id)’ leaks here; was allocated at [(9)](sarif:/runs/0/results/5/codeFlows/0/threadFlows/0/locations/8)
# 2051|   	free(info->vginfo->system_id);
# 2052|   
# 2053|-> 	if (!(info->vginfo->system_id = strdup(system_id))) {
# 2054|   		log_error("cache system_id alloc failed for %s", system_id);
# 2055|   		return 0;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def187]
LVM2.2.03.38/lib/cache/lvmcache.c:2544:33: warning[-Wanalyzer-malloc-leak]: leak of ‘calloc(1, 24)’
LVM2.2.03.38/lib/cache/lvmcache.c:2475:23: enter_function: entry to ‘lvmcache_add’
LVM2.2.03.38/lib/cache/lvmcache.c:2503:16: call_function: calling ‘lvmcache_info_from_pvid’ from ‘lvmcache_add’
LVM2.2.03.38/lib/cache/lvmcache.c:2503:16: return_function: returning to ‘lvmcache_add’ from ‘lvmcache_info_from_pvid’
LVM2.2.03.38/lib/cache/lvmcache.c:2505:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/lib/cache/lvmcache.c:2513:12: branch_false: ...to here
LVM2.2.03.38/lib/cache/lvmcache.c:2513:12: branch_false: following ‘false’ branch (when ‘info’ is non-NULL)...
LVM2.2.03.38/lib/cache/lvmcache.c:2519:12: branch_false: ...to here
LVM2.2.03.38/lib/cache/lvmcache.c:2519:12: branch_true: following ‘true’ branch (when ‘created == 0’)...
LVM2.2.03.38/lib/cache/lvmcache.c:2520:21: branch_true: ...to here
LVM2.2.03.38/lib/cache/lvmcache.c:2520:20: branch_true: following ‘true’ branch...
LVM2.2.03.38/lib/cache/lvmcache.c:2521:25: branch_true: ...to here
LVM2.2.03.38/lib/cache/lvmcache.c:2528:28: branch_false: following ‘false’ branch...
LVM2.2.03.38/lib/cache/lvmcache.c:2540:46: call_function: inlined call to ‘zalloc’ from ‘lvmcache_add’
LVM2.2.03.38/lib/cache/lvmcache.c:2540:36: branch_false: following ‘false’ branch...
LVM2.2.03.38/lib/cache/lvmcache.c:2542:33: branch_false: ...to here
LVM2.2.03.38/lib/cache/lvmcache.c:2544:33: danger: ‘calloc(1, 24)’ leaks here; was allocated at [(18)](sarif:/runs/0/results/6/codeFlows/0/threadFlows/0/locations/17)
# 2542|   				devl->dev = dev;
# 2543|   
# 2544|-> 				dm_list_add(&_initial_duplicates, &devl->list);
# 2545|   			}
# 2546|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def188]
LVM2.2.03.38/lib/cache_segtype/cache.c:799:14: warning[-Wanalyzer-malloc-leak]: leak of ‘calloc(1, 72)’
LVM2.2.03.38/lib/cache_segtype/cache.c:779:5: enter_function: entry to ‘init_cache_segtypes’
LVM2.2.03.38/lib/cache_segtype/cache.c:788:40: call_function: inlined call to ‘zalloc’ from ‘init_cache_segtypes’
LVM2.2.03.38/lib/cache_segtype/cache.c:790:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/lib/cache_segtype/cache.c:795:9: branch_false: ...to here
LVM2.2.03.38/lib/cache_segtype/cache.c:799:14: throw: if ‘lvm_register_segtype’ throws an exception...
LVM2.2.03.38/lib/cache_segtype/cache.c:799:14: danger: ‘calloc(1, 72)’ leaks here; was allocated at [(3)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/2)
#  797|   	segtype->ops = &_cache_pool_ops;
#  798|   
#  799|-> 	if (!lvm_register_segtype(seglib, segtype))
#  800|   		return_0;
#  801|   	log_very_verbose("Initialised segtype: %s", segtype->name);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def189]
LVM2.2.03.38/lib/cache_segtype/cache.c:813:14: warning[-Wanalyzer-malloc-leak]: leak of ‘calloc(1, 72)’
LVM2.2.03.38/lib/cache_segtype/cache.c:779:5: enter_function: entry to ‘init_cache_segtypes’
LVM2.2.03.38/lib/cache_segtype/cache.c:790:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/lib/cache_segtype/cache.c:795:9: branch_false: ...to here
LVM2.2.03.38/lib/cache_segtype/cache.c:799:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/lib/cache_segtype/cache.c:801:9: branch_false: ...to here
LVM2.2.03.38/lib/cache_segtype/cache.c:803:19: call_function: inlined call to ‘zalloc’ from ‘init_cache_segtypes’
LVM2.2.03.38/lib/cache_segtype/cache.c:804:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/lib/cache_segtype/cache.c:809:9: branch_false: ...to here
LVM2.2.03.38/lib/cache_segtype/cache.c:813:14: throw: if ‘lvm_register_segtype’ throws an exception...
LVM2.2.03.38/lib/cache_segtype/cache.c:813:14: danger: ‘calloc(1, 72)’ leaks here; was allocated at [(7)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/6)
#  811|   	segtype->ops = &_cache_ops;
#  812|   
#  813|-> 	if (!lvm_register_segtype(seglib, segtype))
#  814|   		return_0;
#  815|   	log_very_verbose("Initialised segtype: %s", segtype->name);

Error: GCC_ANALYZER_WARNING (CWE-775): [#def190]
LVM2.2.03.38/lib/commands/toolcontext.c:246:21: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(&proc_mounts, "r")’
LVM2.2.03.38/lib/commands/toolcontext.c:229:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/lib/commands/toolcontext.c:235:39: branch_false: ...to here
LVM2.2.03.38/lib/commands/toolcontext.c:234:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/lib/commands/toolcontext.c:240:20: branch_false: ...to here
LVM2.2.03.38/lib/commands/toolcontext.c:240:20: acquire_resource: opened here
LVM2.2.03.38/lib/commands/toolcontext.c:240:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/lib/commands/toolcontext.c:240:12: branch_false: ...to here
LVM2.2.03.38/lib/commands/toolcontext.c:245:16: branch_true: following ‘true’ branch...
LVM2.2.03.38/lib/commands/toolcontext.c:246:21: branch_true: ...to here
LVM2.2.03.38/lib/commands/toolcontext.c:246:21: throw: if ‘dm_split_words’ throws an exception...
LVM2.2.03.38/lib/commands/toolcontext.c:246:21: danger: ‘fopen(&proc_mounts, "r")’ leaks here; was opened at [(5)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/4)
#  244|   
#  245|   	while (fgets(buffer, sizeof(buffer), fp)) {
#  246|-> 		if (dm_split_words(buffer, 4, 0, split) == 4 &&
#  247|   		    !strcmp(split[2], "sysfs")) {
#  248|   			sys_mnt = split[1];

Error: GCC_ANALYZER_WARNING (CWE-401): [#def191]
LVM2.2.03.38/lib/commands/toolcontext.c:246:21: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(&proc_mounts, "r")’
LVM2.2.03.38/lib/commands/toolcontext.c:229:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/lib/commands/toolcontext.c:235:39: branch_false: ...to here
LVM2.2.03.38/lib/commands/toolcontext.c:234:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/lib/commands/toolcontext.c:240:20: branch_false: ...to here
LVM2.2.03.38/lib/commands/toolcontext.c:240:20: acquire_memory: allocated here
LVM2.2.03.38/lib/commands/toolcontext.c:240:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/lib/commands/toolcontext.c:240:12: branch_false: ...to here
LVM2.2.03.38/lib/commands/toolcontext.c:245:16: branch_true: following ‘true’ branch...
LVM2.2.03.38/lib/commands/toolcontext.c:246:21: branch_true: ...to here
LVM2.2.03.38/lib/commands/toolcontext.c:246:21: throw: if ‘dm_split_words’ throws an exception...
LVM2.2.03.38/lib/commands/toolcontext.c:246:21: danger: ‘fopen(&proc_mounts, "r")’ leaks here; was allocated at [(5)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/4)
#  244|   
#  245|   	while (fgets(buffer, sizeof(buffer), fp)) {
#  246|-> 		if (dm_split_words(buffer, 4, 0, split) == 4 &&
#  247|   		    !strcmp(split[2], "sysfs")) {
#  248|   			sys_mnt = split[1];

Error: GCC_ANALYZER_WARNING (CWE-401): [#def192]
LVM2.2.03.38/lib/commands/toolcontext.c:1662:9: warning[-Wanalyzer-malloc-leak]: leak of ‘calloc(1, 18448)’
LVM2.2.03.38/lib/commands/toolcontext.c:1638:21: enter_function: entry to ‘create_toolcontext’
LVM2.2.03.38/lib/commands/toolcontext.c:1658:21: call_function: inlined call to ‘zalloc’ from ‘create_toolcontext’
LVM2.2.03.38/lib/commands/toolcontext.c:1658:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/lib/commands/toolcontext.c:1662:9: branch_false: ...to here
LVM2.2.03.38/lib/commands/toolcontext.c:1671:9: throw: if ‘dm_list_init’ throws an exception...
LVM2.2.03.38/lib/commands/toolcontext.c:1662:9: danger: ‘calloc(1, 18448)’ leaks here; was allocated at [(3)](sarif:/runs/0/results/2/codeFlows/0/threadFlows/0/locations/2)
# 1660|   		return NULL;
# 1661|   	}
# 1662|-> 	cmd->is_long_lived = is_clvmd;
# 1663|   	cmd->is_clvmd = is_clvmd;
# 1664|   	cmd->threaded = threaded ? 1 : 0;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def193]
LVM2.2.03.38/lib/config/config.c:754:17: warning[-Wanalyzer-malloc-leak]: leak of ‘enc_value’
LVM2.2.03.38/lib/config/config.c:1458:31: enter_function: entry to ‘_get_array_def_node’
LVM2.2.03.38/lib/config/config.c:1464:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/lib/config/config.c:1467:52: branch_false: ...to here
LVM2.2.03.38/lib/config/config.c:1467:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/lib/config/config.c:1472:23: branch_false: ...to here
LVM2.2.03.38/lib/config/config.c:1472:23: call_function: calling ‘_get_def_array_values’ from ‘_get_array_def_node’
#  752|   	/* Proper value always starts with '#'. */
#  753|   	if (token[0] != '#')
#  754|-> 		goto_bad;
#  755|   
#  756|   	while (token) {

Error: GCC_ANALYZER_WARNING (CWE-401): [#def194]
LVM2.2.03.38/lib/config/config.c:758:17: warning[-Wanalyzer-malloc-leak]: leak of ‘token’
LVM2.2.03.38/lib/config/config.c:1458:31: enter_function: entry to ‘_get_array_def_node’
LVM2.2.03.38/lib/config/config.c:1464:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/lib/config/config.c:1467:52: branch_false: ...to here
LVM2.2.03.38/lib/config/config.c:1467:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/lib/config/config.c:1472:23: branch_false: ...to here
LVM2.2.03.38/lib/config/config.c:1472:23: call_function: calling ‘_get_def_array_values’ from ‘_get_array_def_node’
#  756|   	while (token) {
#  757|   		/* Move to type identifier. Error on no char. */
#  758|-> 		token++;
#  759|   		if (!token[0])
#  760|   			goto_bad;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def195]
LVM2.2.03.38/lib/config/config.c:760:25: warning[-Wanalyzer-malloc-leak]: leak of ‘enc_value’
LVM2.2.03.38/lib/config/config.c:1458:31: enter_function: entry to ‘_get_array_def_node’
LVM2.2.03.38/lib/config/config.c:1464:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/lib/config/config.c:1467:52: branch_false: ...to here
LVM2.2.03.38/lib/config/config.c:1467:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/lib/config/config.c:1472:23: branch_false: ...to here
LVM2.2.03.38/lib/config/config.c:1472:23: call_function: calling ‘_get_def_array_values’ from ‘_get_array_def_node’
#  758|   		token++;
#  759|   		if (!token[0])
#  760|-> 			goto_bad;
#  761|   
#  762|   		/* Move to the actual value and decode any "##" into "#". */

Error: GCC_ANALYZER_WARNING (CWE-401): [#def196]
LVM2.2.03.38/lib/config/config.c:822:9: warning[-Wanalyzer-malloc-leak]: leak of ‘enc_value’
LVM2.2.03.38/lib/config/config.c:1458:31: enter_function: entry to ‘_get_array_def_node’
LVM2.2.03.38/lib/config/config.c:1464:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/lib/config/config.c:1467:52: branch_false: ...to here
LVM2.2.03.38/lib/config/config.c:1467:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/lib/config/config.c:1472:23: branch_false: ...to here
LVM2.2.03.38/lib/config/config.c:1472:23: call_function: calling ‘_get_def_array_values’ from ‘_get_array_def_node’
#  820|   	return array;
#  821|   bad:
#  822|-> 	log_error(INTERNAL_ERROR "Default array value malformed for \"%s\", "
#  823|   		  "value: \"%s\", token: \"%s\".", def->name,
#  824|   		  def->default_value.v_CFG_TYPE_STRING, token);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def197]
LVM2.2.03.38/lib/config/config.c:822:9: warning[-Wanalyzer-malloc-leak]: leak of ‘token’
LVM2.2.03.38/lib/config/config.c:1458:31: enter_function: entry to ‘_get_array_def_node’
LVM2.2.03.38/lib/config/config.c:1464:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/lib/config/config.c:1467:52: branch_false: ...to here
LVM2.2.03.38/lib/config/config.c:1467:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/lib/config/config.c:1472:23: branch_false: ...to here
LVM2.2.03.38/lib/config/config.c:1472:23: call_function: calling ‘_get_def_array_values’ from ‘_get_array_def_node’
#  820|   	return array;
#  821|   bad:
#  822|-> 	log_error(INTERNAL_ERROR "Default array value malformed for \"%s\", "
#  823|   		  "value: \"%s\", token: \"%s\".", def->name,
#  824|   		  def->default_value.v_CFG_TYPE_STRING, token);

Error: GCC_ANALYZER_WARNING (CWE-775): [#def198]
LVM2.2.03.38/lib/config/config.c:1977:9: warning[-Wanalyzer-file-leak]: leak of FILE ‘baton.fp’
LVM2.2.03.38/lib/config/config.c:1968:12: branch_false: following ‘false’ branch (when ‘file’ is non-NULL)...
LVM2.2.03.38/lib/config/config.c:1972:33: branch_false: ...to here
LVM2.2.03.38/lib/config/config.c:1972:33: acquire_resource: opened here
LVM2.2.03.38/lib/config/config.c:1972:19: branch_false: following ‘false’ branch...
LVM2.2.03.38/lib/config/config.c:1977:9: branch_false: ...to here
LVM2.2.03.38/lib/config/config.c:1977:9: throw: if ‘print_log’ throws an exception...
LVM2.2.03.38/lib/config/config.c:1977:9: danger: ‘baton.fp’ leaks here; was opened at [(3)](sarif:/runs/0/results/10/codeFlows/0/threadFlows/0/locations/2)
# 1975|   	}
# 1976|   
# 1977|-> 	log_verbose("Dumping configuration to %s", file);
# 1978|   
# 1979|   	if (tree_spec->withgeneralpreamble)

Error: GCC_ANALYZER_WARNING (CWE-401): [#def199]
LVM2.2.03.38/lib/config/config.c:1977:9: warning[-Wanalyzer-malloc-leak]: leak of ‘baton.fp’
LVM2.2.03.38/lib/config/config.c:1968:12: branch_false: following ‘false’ branch (when ‘file’ is non-NULL)...
LVM2.2.03.38/lib/config/config.c:1972:33: branch_false: ...to here
LVM2.2.03.38/lib/config/config.c:1972:33: acquire_memory: allocated here
LVM2.2.03.38/lib/config/config.c:1972:19: branch_false: following ‘false’ branch...
LVM2.2.03.38/lib/config/config.c:1977:9: branch_false: ...to here
LVM2.2.03.38/lib/config/config.c:1977:9: throw: if ‘print_log’ throws an exception...
LVM2.2.03.38/lib/config/config.c:1977:9: danger: ‘baton.fp’ leaks here; was allocated at [(3)](sarif:/runs/0/results/11/codeFlows/0/threadFlows/0/locations/2)
# 1975|   	}
# 1976|   
# 1977|-> 	log_verbose("Dumping configuration to %s", file);
# 1978|   
# 1979|   	if (tree_spec->withgeneralpreamble)

Error: GCC_ANALYZER_WARNING (CWE-775): [#def200]
LVM2.2.03.38/lib/config/config.c:1985:22: warning[-Wanalyzer-file-leak]: leak of FILE ‘baton.fp’
LVM2.2.03.38/lib/config/config.c:1968:12: branch_false: following ‘false’ branch (when ‘file’ is non-NULL)...
LVM2.2.03.38/lib/config/config.c:1972:33: branch_false: ...to here
LVM2.2.03.38/lib/config/config.c:1972:33: acquire_resource: opened here
LVM2.2.03.38/lib/config/config.c:1972:19: branch_false: following ‘false’ branch...
LVM2.2.03.38/lib/config/config.c:1977:9: branch_false: ...to here
LVM2.2.03.38/lib/config/config.c:1984:12: branch_true: following ‘true’ branch (when ‘argc == 0’)...
LVM2.2.03.38/lib/config/config.c:1985:47: branch_true: ...to here
LVM2.2.03.38/lib/config/config.c:1985:22: throw: if ‘dm_config_write_node_out’ throws an exception...
LVM2.2.03.38/lib/config/config.c:1985:22: danger: ‘baton.fp’ leaks here; was opened at [(3)](sarif:/runs/0/results/12/codeFlows/0/threadFlows/0/locations/2)
# 1983|   
# 1984|   	if (!argc) {
# 1985|-> 		if (!dm_config_write_node_out(cft->root, &_out_spec, &baton)) {
# 1986|   			log_error("Failure while writing to %s", file);
# 1987|   			r = 0;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def201]
LVM2.2.03.38/lib/config/config.c:1985:22: warning[-Wanalyzer-malloc-leak]: leak of ‘baton.fp’
LVM2.2.03.38/lib/config/config.c:1968:12: branch_false: following ‘false’ branch (when ‘file’ is non-NULL)...
LVM2.2.03.38/lib/config/config.c:1972:33: branch_false: ...to here
LVM2.2.03.38/lib/config/config.c:1972:33: acquire_memory: allocated here
LVM2.2.03.38/lib/config/config.c:1972:19: branch_false: following ‘false’ branch...
LVM2.2.03.38/lib/config/config.c:1977:9: branch_false: ...to here
LVM2.2.03.38/lib/config/config.c:1984:12: branch_true: following ‘true’ branch (when ‘argc == 0’)...
LVM2.2.03.38/lib/config/config.c:1985:47: branch_true: ...to here
LVM2.2.03.38/lib/config/config.c:1985:22: throw: if ‘dm_config_write_node_out’ throws an exception...
LVM2.2.03.38/lib/config/config.c:1985:22: danger: ‘baton.fp’ leaks here; was allocated at [(3)](sarif:/runs/0/results/13/codeFlows/0/threadFlows/0/locations/2)
# 1983|   
# 1984|   	if (!argc) {
# 1985|-> 		if (!dm_config_write_node_out(cft->root, &_out_spec, &baton)) {
# 1986|   			log_error("Failure while writing to %s", file);
# 1987|   			r = 0;

Error: GCC_ANALYZER_WARNING (CWE-775): [#def202]
LVM2.2.03.38/lib/config/config.c:1990:27: warning[-Wanalyzer-file-leak]: leak of FILE ‘baton.fp’
LVM2.2.03.38/lib/config/config.c:1968:12: branch_false: following ‘false’ branch (when ‘file’ is non-NULL)...
LVM2.2.03.38/lib/config/config.c:1972:33: branch_false: ...to here
LVM2.2.03.38/lib/config/config.c:1972:33: acquire_resource: opened here
LVM2.2.03.38/lib/config/config.c:1972:19: branch_false: following ‘false’ branch...
LVM2.2.03.38/lib/config/config.c:1977:9: branch_false: ...to here
LVM2.2.03.38/lib/config/config.c:1984:12: branch_false: following ‘false’ branch (when ‘argc != 0’)...
LVM2.2.03.38/lib/config/config.c:1984:12: branch_false: ...to here
LVM2.2.03.38/lib/config/config.c:1989:23: branch_true: following ‘true’ branch (when ‘argc != 0’)...
LVM2.2.03.38/lib/config/config.c:1990:27: branch_true: ...to here
LVM2.2.03.38/lib/config/config.c:1990:27: throw: if ‘dm_config_find_node’ throws an exception...
LVM2.2.03.38/lib/config/config.c:1990:27: danger: ‘baton.fp’ leaks here; was opened at [(3)](sarif:/runs/0/results/14/codeFlows/0/threadFlows/0/locations/2)
# 1988|   		}
# 1989|   	} else while (argc--) {
# 1990|-> 		if ((cn = dm_config_find_node(cft->root, *argv))) {
# 1991|   			if (!dm_config_write_one_node_out(cn, &_out_spec, &baton)) {
# 1992|   				log_error("Failure while writing to %s", file);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def203]
LVM2.2.03.38/lib/config/config.c:1990:27: warning[-Wanalyzer-malloc-leak]: leak of ‘baton.fp’
LVM2.2.03.38/lib/config/config.c:1968:12: branch_false: following ‘false’ branch (when ‘file’ is non-NULL)...
LVM2.2.03.38/lib/config/config.c:1972:33: branch_false: ...to here
LVM2.2.03.38/lib/config/config.c:1972:33: acquire_memory: allocated here
LVM2.2.03.38/lib/config/config.c:1972:19: branch_false: following ‘false’ branch...
LVM2.2.03.38/lib/config/config.c:1977:9: branch_false: ...to here
LVM2.2.03.38/lib/config/config.c:1984:12: branch_false: following ‘false’ branch (when ‘argc != 0’)...
LVM2.2.03.38/lib/config/config.c:1984:12: branch_false: ...to here
LVM2.2.03.38/lib/config/config.c:1989:23: branch_true: following ‘true’ branch (when ‘argc != 0’)...
LVM2.2.03.38/lib/config/config.c:1990:27: branch_true: ...to here
LVM2.2.03.38/lib/config/config.c:1990:27: throw: if ‘dm_config_find_node’ throws an exception...
LVM2.2.03.38/lib/config/config.c:1990:27: danger: ‘baton.fp’ leaks here; was allocated at [(3)](sarif:/runs/0/results/15/codeFlows/0/threadFlows/0/locations/2)
# 1988|   		}
# 1989|   	} else while (argc--) {
# 1990|-> 		if ((cn = dm_config_find_node(cft->root, *argv))) {
# 1991|   			if (!dm_config_write_one_node_out(cn, &_out_spec, &baton)) {
# 1992|   				log_error("Failure while writing to %s", file);

Error: GCC_ANALYZER_WARNING (CWE-775): [#def204]
LVM2.2.03.38/lib/config/config.c:1991:30: warning[-Wanalyzer-file-leak]: leak of FILE ‘baton.fp’
LVM2.2.03.38/lib/config/config.c:1968:12: branch_false: following ‘false’ branch (when ‘file’ is non-NULL)...
LVM2.2.03.38/lib/config/config.c:1972:33: branch_false: ...to here
LVM2.2.03.38/lib/config/config.c:1972:33: acquire_resource: opened here
LVM2.2.03.38/lib/config/config.c:1972:19: branch_false: following ‘false’ branch...
LVM2.2.03.38/lib/config/config.c:1977:9: branch_false: ...to here
LVM2.2.03.38/lib/config/config.c:1984:12: branch_false: following ‘false’ branch (when ‘argc != 0’)...
LVM2.2.03.38/lib/config/config.c:1984:12: branch_false: ...to here
LVM2.2.03.38/lib/config/config.c:1989:23: branch_true: following ‘true’ branch (when ‘argc != 0’)...
LVM2.2.03.38/lib/config/config.c:1990:27: branch_true: ...to here
LVM2.2.03.38/lib/config/config.c:1990:20: branch_true: following ‘true’ branch...
LVM2.2.03.38/lib/config/config.c:1991:30: branch_true: ...to here
LVM2.2.03.38/lib/config/config.c:1991:30: throw: if ‘dm_config_write_one_node_out’ throws an exception...
LVM2.2.03.38/lib/config/config.c:1991:30: danger: ‘baton.fp’ leaks here; was opened at [(3)](sarif:/runs/0/results/16/codeFlows/0/threadFlows/0/locations/2)
# 1989|   	} else while (argc--) {
# 1990|   		if ((cn = dm_config_find_node(cft->root, *argv))) {
# 1991|-> 			if (!dm_config_write_one_node_out(cn, &_out_spec, &baton)) {
# 1992|   				log_error("Failure while writing to %s", file);
# 1993|   				r = 0;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def205]
LVM2.2.03.38/lib/config/config.c:1991:30: warning[-Wanalyzer-malloc-leak]: leak of ‘baton.fp’
LVM2.2.03.38/lib/config/config.c:1968:12: branch_false: following ‘false’ branch (when ‘file’ is non-NULL)...
LVM2.2.03.38/lib/config/config.c:1972:33: branch_false: ...to here
LVM2.2.03.38/lib/config/config.c:1972:33: acquire_memory: allocated here
LVM2.2.03.38/lib/config/config.c:1972:19: branch_false: following ‘false’ branch...
LVM2.2.03.38/lib/config/config.c:1977:9: branch_false: ...to here
LVM2.2.03.38/lib/config/config.c:1984:12: branch_false: following ‘false’ branch (when ‘argc != 0’)...
LVM2.2.03.38/lib/config/config.c:1984:12: branch_false: ...to here
LVM2.2.03.38/lib/config/config.c:1989:23: branch_true: following ‘true’ branch (when ‘argc != 0’)...
LVM2.2.03.38/lib/config/config.c:1990:27: branch_true: ...to here
LVM2.2.03.38/lib/config/config.c:1990:20: branch_true: following ‘true’ branch...
LVM2.2.03.38/lib/config/config.c:1991:30: branch_true: ...to here
LVM2.2.03.38/lib/config/config.c:1991:30: throw: if ‘dm_config_write_one_node_out’ throws an exception...
LVM2.2.03.38/lib/config/config.c:1991:30: danger: ‘baton.fp’ leaks here; was allocated at [(3)](sarif:/runs/0/results/17/codeFlows/0/threadFlows/0/locations/2)
# 1989|   	} else while (argc--) {
# 1990|   		if ((cn = dm_config_find_node(cft->root, *argv))) {
# 1991|-> 			if (!dm_config_write_one_node_out(cn, &_out_spec, &baton)) {
# 1992|   				log_error("Failure while writing to %s", file);
# 1993|   				r = 0;

Error: GCC_ANALYZER_WARNING (CWE-775): [#def206]
LVM2.2.03.38/lib/config/config.c:1996:25: warning[-Wanalyzer-file-leak]: leak of FILE ‘baton.fp’
LVM2.2.03.38/lib/config/config.c:1968:12: branch_false: following ‘false’ branch (when ‘file’ is non-NULL)...
LVM2.2.03.38/lib/config/config.c:1972:33: branch_false: ...to here
LVM2.2.03.38/lib/config/config.c:1972:33: acquire_resource: opened here
LVM2.2.03.38/lib/config/config.c:1972:19: branch_false: following ‘false’ branch...
LVM2.2.03.38/lib/config/config.c:1977:9: branch_false: ...to here
LVM2.2.03.38/lib/config/config.c:1984:12: branch_false: following ‘false’ branch (when ‘argc != 0’)...
LVM2.2.03.38/lib/config/config.c:1984:12: branch_false: ...to here
LVM2.2.03.38/lib/config/config.c:1989:23: branch_true: following ‘true’ branch (when ‘argc != 0’)...
LVM2.2.03.38/lib/config/config.c:1990:27: branch_true: ...to here
LVM2.2.03.38/lib/config/config.c:1990:20: branch_false: following ‘false’ branch...
LVM2.2.03.38/lib/config/config.c:1996:25: branch_false: ...to here
LVM2.2.03.38/lib/config/config.c:1996:25: throw: if ‘print_log’ throws an exception...
LVM2.2.03.38/lib/config/config.c:1996:25: danger: ‘baton.fp’ leaks here; was opened at [(3)](sarif:/runs/0/results/18/codeFlows/0/threadFlows/0/locations/2)
# 1994|   			}
# 1995|   		} else {
# 1996|-> 			log_error("Configuration node %s not found", *argv);
# 1997|   			r = 0;
# 1998|   		}

Error: GCC_ANALYZER_WARNING (CWE-401): [#def207]
LVM2.2.03.38/lib/config/config.c:1996:25: warning[-Wanalyzer-malloc-leak]: leak of ‘baton.fp’
LVM2.2.03.38/lib/config/config.c:1968:12: branch_false: following ‘false’ branch (when ‘file’ is non-NULL)...
LVM2.2.03.38/lib/config/config.c:1972:33: branch_false: ...to here
LVM2.2.03.38/lib/config/config.c:1972:33: acquire_memory: allocated here
LVM2.2.03.38/lib/config/config.c:1972:19: branch_false: following ‘false’ branch...
LVM2.2.03.38/lib/config/config.c:1977:9: branch_false: ...to here
LVM2.2.03.38/lib/config/config.c:1984:12: branch_false: following ‘false’ branch (when ‘argc != 0’)...
LVM2.2.03.38/lib/config/config.c:1984:12: branch_false: ...to here
LVM2.2.03.38/lib/config/config.c:1989:23: branch_true: following ‘true’ branch (when ‘argc != 0’)...
LVM2.2.03.38/lib/config/config.c:1990:27: branch_true: ...to here
LVM2.2.03.38/lib/config/config.c:1990:20: branch_false: following ‘false’ branch...
LVM2.2.03.38/lib/config/config.c:1996:25: branch_false: ...to here
LVM2.2.03.38/lib/config/config.c:1996:25: throw: if ‘print_log’ throws an exception...
LVM2.2.03.38/lib/config/config.c:1996:25: danger: ‘baton.fp’ leaks here; was allocated at [(3)](sarif:/runs/0/results/19/codeFlows/0/threadFlows/0/locations/2)
# 1994|   			}
# 1995|   		} else {
# 1996|-> 			log_error("Configuration node %s not found", *argv);
# 1997|   			r = 0;
# 1998|   		}

Error: GCC_ANALYZER_WARNING (CWE-775): [#def208]
LVM2.2.03.38/lib/config/config.c:2002:36: warning[-Wanalyzer-file-leak]: leak of FILE ‘baton.fp’
LVM2.2.03.38/lib/config/config.c:1968:12: branch_false: following ‘false’ branch (when ‘file’ is non-NULL)...
LVM2.2.03.38/lib/config/config.c:1972:33: branch_false: ...to here
LVM2.2.03.38/lib/config/config.c:1972:33: acquire_resource: opened here
LVM2.2.03.38/lib/config/config.c:1972:19: branch_false: following ‘false’ branch...
LVM2.2.03.38/lib/config/config.c:1977:9: branch_false: ...to here
LVM2.2.03.38/lib/config/config.c:1984:12: branch_false: following ‘false’ branch (when ‘argc != 0’)...
LVM2.2.03.38/lib/config/config.c:1984:12: branch_false: ...to here
LVM2.2.03.38/lib/config/config.c:1989:23: branch_true: following ‘true’ branch (when ‘argc != 0’)...
LVM2.2.03.38/lib/config/config.c:1990:27: branch_true: ...to here
LVM2.2.03.38/lib/config/config.c:1990:20: branch_false: following ‘false’ branch...
LVM2.2.03.38/lib/config/config.c:1996:25: branch_false: ...to here
LVM2.2.03.38/lib/config/config.c:1989:23: branch_false: following ‘false’ branch (when ‘argc == 0’)...
LVM2.2.03.38/lib/config/config.c:2002:12: branch_false: ...to here
LVM2.2.03.38/lib/config/config.c:2002:12: branch_true: following ‘true’ branch...
LVM2.2.03.38/lib/config/config.c:2002:36: throw: if ‘dm_fclose’ throws an exception...
LVM2.2.03.38/lib/config/config.c:2002:36: danger: ‘baton.fp’ leaks here; was opened at [(3)](sarif:/runs/0/results/20/codeFlows/0/threadFlows/0/locations/2)
# 2000|   	}
# 2001|   
# 2002|-> 	if (free_fp && baton.fp && dm_fclose(baton.fp)) {
# 2003|   		stack;
# 2004|   		r = 0;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def209]
LVM2.2.03.38/lib/config/config.c:2002:36: warning[-Wanalyzer-malloc-leak]: leak of ‘baton.fp’
LVM2.2.03.38/lib/config/config.c:1968:12: branch_false: following ‘false’ branch (when ‘file’ is non-NULL)...
LVM2.2.03.38/lib/config/config.c:1972:33: branch_false: ...to here
LVM2.2.03.38/lib/config/config.c:1972:33: acquire_memory: allocated here
LVM2.2.03.38/lib/config/config.c:1972:19: branch_false: following ‘false’ branch...
LVM2.2.03.38/lib/config/config.c:1977:9: branch_false: ...to here
LVM2.2.03.38/lib/config/config.c:1984:12: branch_false: following ‘false’ branch (when ‘argc != 0’)...
LVM2.2.03.38/lib/config/config.c:1984:12: branch_false: ...to here
LVM2.2.03.38/lib/config/config.c:1989:23: branch_true: following ‘true’ branch (when ‘argc != 0’)...
LVM2.2.03.38/lib/config/config.c:1990:27: branch_true: ...to here
LVM2.2.03.38/lib/config/config.c:1990:20: branch_false: following ‘false’ branch...
LVM2.2.03.38/lib/config/config.c:1996:25: branch_false: ...to here
LVM2.2.03.38/lib/config/config.c:1989:23: branch_false: following ‘false’ branch (when ‘argc == 0’)...
LVM2.2.03.38/lib/config/config.c:2002:12: branch_false: ...to here
LVM2.2.03.38/lib/config/config.c:2002:12: branch_true: following ‘true’ branch...
LVM2.2.03.38/lib/config/config.c:2002:36: throw: if ‘dm_fclose’ throws an exception...
LVM2.2.03.38/lib/config/config.c:2002:36: danger: ‘baton.fp’ leaks here; was allocated at [(3)](sarif:/runs/0/results/21/codeFlows/0/threadFlows/0/locations/2)
# 2000|   	}
# 2001|   
# 2002|-> 	if (free_fp && baton.fp && dm_fclose(baton.fp)) {
# 2003|   		stack;
# 2004|   		r = 0;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def210]
LVM2.2.03.38/lib/device/bcache.c:80:9: warning[-Wanalyzer-malloc-leak]: leak of ‘cbs’
LVM2.2.03.38/lib/device/bcache.c:369:19: enter_function: entry to ‘create_async_io_engine’
LVM2.2.03.38/lib/device/bcache.c:380:12: branch_false: following ‘false’ branch (when ‘e’ is non-NULL)...
LVM2.2.03.38/lib/device/bcache.c:383:9: branch_false: ...to here
LVM2.2.03.38/lib/device/bcache.c:391:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/lib/device/bcache.c:397:18: branch_false: ...to here
LVM2.2.03.38/lib/device/bcache.c:397:18: call_function: calling ‘_cb_set_create’ from ‘create_async_io_engine’
#   78|   		return NULL;
#   79|   
#   80|-> 	dm_list_init(&cbs->free);
#   81|   	dm_list_init(&cbs->allocated);
#   82|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def211]
LVM2.2.03.38/lib/device/bcache.c:390:13: warning[-Wanalyzer-malloc-leak]: leak of ‘e’
LVM2.2.03.38/lib/device/bcache.c:380:19: acquire_memory: allocated here
LVM2.2.03.38/lib/device/bcache.c:380:12: branch_false: following ‘false’ branch (when ‘e’ is non-NULL)...
LVM2.2.03.38/lib/device/bcache.c:383:9: branch_false: ...to here
LVM2.2.03.38/lib/device/bcache.c:390:13: throw: if ‘io_setup’ throws an exception...
LVM2.2.03.38/lib/device/bcache.c:390:13: danger: ‘e’ leaks here; was allocated at [(1)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/0)
#  388|   	e->aio_context = 0;
#  389|   	e->aio_context_pid = getpid();
#  390|-> 	r = io_setup(MAX_IO, &e->aio_context);
#  391|   	if (r < 0) {
#  392|   		log_debug("io_setup failed %d", r);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def212]
LVM2.2.03.38/lib/device/bcache.c:451:17: warning[-Wanalyzer-malloc-leak]: leak of ‘io’
LVM2.2.03.38/lib/device/bcache.c:442:30: acquire_memory: allocated here
LVM2.2.03.38/lib/device/bcache.c:443:12: branch_false: following ‘false’ branch (when ‘io’ is non-NULL)...
LVM2.2.03.38/lib/device/bcache.c:448:9: branch_false: ...to here
LVM2.2.03.38/lib/device/bcache.c:450:12: branch_true: following ‘true’ branch (when ‘off == -1’)...
LVM2.2.03.38/lib/device/bcache.c:451:17: branch_true: ...to here
LVM2.2.03.38/lib/device/bcache.c:451:17: throw: if ‘print_log’ throws an exception...
LVM2.2.03.38/lib/device/bcache.c:451:17: danger: ‘io’ leaks here; was allocated at [(1)](sarif:/runs/0/results/2/codeFlows/0/threadFlows/0/locations/0)
#  449|   	off = lseek(_fd_table[di], where, SEEK_SET);
#  450|   	if (off == (off_t) -1) {
#  451|-> 		log_warn("Device seek error %d for offset %llu", errno, (unsigned long long)where);
#  452|   		free(io);
#  453|   		return false;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def213]
LVM2.2.03.38/lib/device/bcache.c:456:17: warning[-Wanalyzer-malloc-leak]: leak of ‘io’
LVM2.2.03.38/lib/device/bcache.c:442:30: acquire_memory: allocated here
LVM2.2.03.38/lib/device/bcache.c:443:12: branch_false: following ‘false’ branch (when ‘io’ is non-NULL)...
LVM2.2.03.38/lib/device/bcache.c:448:9: branch_false: ...to here
LVM2.2.03.38/lib/device/bcache.c:450:12: branch_false: following ‘false’ branch (when ‘off != -1’)...
LVM2.2.03.38/lib/device/bcache.c:455:12: branch_false: ...to here
LVM2.2.03.38/lib/device/bcache.c:455:12: branch_true: following ‘true’ branch...
LVM2.2.03.38/lib/device/bcache.c:456:17: branch_true: ...to here
LVM2.2.03.38/lib/device/bcache.c:456:17: throw: if ‘print_log’ throws an exception...
LVM2.2.03.38/lib/device/bcache.c:456:17: danger: ‘io’ leaks here; was allocated at [(1)](sarif:/runs/0/results/3/codeFlows/0/threadFlows/0/locations/0)
#  454|   	}
#  455|   	if (off != (off_t) where) {
#  456|-> 		log_warn("Device seek failed for offset %llu", (unsigned long long)where);
#  457|   		free(io);
#  458|   		return false;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def214]
LVM2.2.03.38/lib/device/bcache.c:472:25: warning[-Wanalyzer-malloc-leak]: leak of ‘io’
LVM2.2.03.38/lib/device/bcache.c:442:30: acquire_memory: allocated here
LVM2.2.03.38/lib/device/bcache.c:443:12: branch_false: following ‘false’ branch (when ‘io’ is non-NULL)...
LVM2.2.03.38/lib/device/bcache.c:448:9: branch_false: ...to here
LVM2.2.03.38/lib/device/bcache.c:450:12: branch_false: following ‘false’ branch (when ‘off != -1’)...
LVM2.2.03.38/lib/device/bcache.c:455:12: branch_false: ...to here
LVM2.2.03.38/lib/device/bcache.c:455:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/lib/device/bcache.c:464:12: branch_false: ...to here
LVM2.2.03.38/lib/device/bcache.c:464:12: branch_true: following ‘true’ branch...
LVM2.2.03.38/lib/device/bcache.c:471:20: branch_true: following ‘true’ branch...
LVM2.2.03.38/lib/device/bcache.c:472:25: branch_true: ...to here
LVM2.2.03.38/lib/device/bcache.c:472:25: throw: if ‘print_log’ throws an exception...
LVM2.2.03.38/lib/device/bcache.c:472:25: danger: ‘io’ leaks here; was allocated at [(1)](sarif:/runs/0/results/4/codeFlows/0/threadFlows/0/locations/0)
#  470|   
#  471|   		if (offset > _last_byte_offset) {
#  472|-> 			log_error("Limit write at %llu len %llu beyond last byte %llu",
#  473|   				  (unsigned long long)offset,
#  474|   				  (unsigned long long)nbytes,

Error: GCC_ANALYZER_WARNING (CWE-401): [#def215]
LVM2.2.03.38/lib/device/bcache.c:494:41: warning[-Wanalyzer-malloc-leak]: leak of ‘io’
LVM2.2.03.38/lib/device/bcache.c:442:30: acquire_memory: allocated here
LVM2.2.03.38/lib/device/bcache.c:443:12: branch_false: following ‘false’ branch (when ‘io’ is non-NULL)...
LVM2.2.03.38/lib/device/bcache.c:448:9: branch_false: ...to here
LVM2.2.03.38/lib/device/bcache.c:450:12: branch_false: following ‘false’ branch (when ‘off != -1’)...
LVM2.2.03.38/lib/device/bcache.c:455:12: branch_false: ...to here
LVM2.2.03.38/lib/device/bcache.c:455:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/lib/device/bcache.c:464:12: branch_false: ...to here
LVM2.2.03.38/lib/device/bcache.c:464:12: branch_true: following ‘true’ branch...
LVM2.2.03.38/lib/device/bcache.c:471:20: branch_false: following ‘false’ branch...
LVM2.2.03.38/lib/device/bcache.c:480:21: branch_false: ...to here
LVM2.2.03.38/lib/device/bcache.c:480:20: branch_true: following ‘true’ branch...
LVM2.2.03.38/lib/device/bcache.c:481:25: branch_true: ...to here
LVM2.2.03.38/lib/device/bcache.c:483:28: branch_true: following ‘true’ branch...
LVM2.2.03.38/lib/device/bcache.c:484:33: branch_true: ...to here
LVM2.2.03.38/lib/device/bcache.c:493:36: branch_true: following ‘true’ branch...
LVM2.2.03.38/lib/device/bcache.c:494:41: branch_true: ...to here
LVM2.2.03.38/lib/device/bcache.c:494:41: throw: if ‘print_log’ throws an exception...
LVM2.2.03.38/lib/device/bcache.c:494:41: danger: ‘io’ leaks here; was allocated at [(1)](sarif:/runs/0/results/5/codeFlows/0/threadFlows/0/locations/0)
#  492|   				 */
#  493|   				if (limit_nbytes + extra_nbytes > nbytes) {
#  494|-> 					log_warn("Skip extending write at %llu len %llu limit %llu extra %llu sector_size %llu",
#  495|   						 (unsigned long long)offset,
#  496|   						 (unsigned long long)nbytes,

Error: GCC_ANALYZER_WARNING (CWE-401): [#def216]
LVM2.2.03.38/lib/device/bcache.c:507:33: warning[-Wanalyzer-malloc-leak]: leak of ‘io’
LVM2.2.03.38/lib/device/bcache.c:442:30: acquire_memory: allocated here
LVM2.2.03.38/lib/device/bcache.c:443:12: branch_false: following ‘false’ branch (when ‘io’ is non-NULL)...
LVM2.2.03.38/lib/device/bcache.c:448:9: branch_false: ...to here
LVM2.2.03.38/lib/device/bcache.c:450:12: branch_false: following ‘false’ branch (when ‘off != -1’)...
LVM2.2.03.38/lib/device/bcache.c:455:12: branch_false: ...to here
LVM2.2.03.38/lib/device/bcache.c:455:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/lib/device/bcache.c:464:12: branch_false: ...to here
LVM2.2.03.38/lib/device/bcache.c:464:12: branch_true: following ‘true’ branch...
LVM2.2.03.38/lib/device/bcache.c:471:20: branch_false: following ‘false’ branch...
LVM2.2.03.38/lib/device/bcache.c:480:21: branch_false: ...to here
LVM2.2.03.38/lib/device/bcache.c:480:20: branch_true: following ‘true’ branch...
LVM2.2.03.38/lib/device/bcache.c:481:25: branch_true: ...to here
LVM2.2.03.38/lib/device/bcache.c:483:28: branch_true: following ‘true’ branch...
LVM2.2.03.38/lib/device/bcache.c:484:33: branch_true: ...to here
LVM2.2.03.38/lib/device/bcache.c:493:36: branch_false: following ‘false’ branch...
LVM2.2.03.38/lib/device/bcache.c:506:28: branch_false: ...to here
LVM2.2.03.38/lib/device/bcache.c:506:28: branch_true: following ‘true’ branch (when ‘extra_nbytes != 0’)...
LVM2.2.03.38/lib/device/bcache.c:507:33: branch_true: ...to here
LVM2.2.03.38/lib/device/bcache.c:507:33: throw: if ‘print_log’ throws an exception...
LVM2.2.03.38/lib/device/bcache.c:507:33: danger: ‘io’ leaks here; was allocated at [(1)](sarif:/runs/0/results/6/codeFlows/0/threadFlows/0/locations/0)
#  505|   
#  506|   			if (extra_nbytes) {
#  507|-> 				log_debug("Limit write at %llu len %llu to len %llu rounded to %llu",
#  508|   					  (unsigned long long)offset,
#  509|   					  (unsigned long long)nbytes,

Error: GCC_ANALYZER_WARNING (CWE-401): [#def217]
LVM2.2.03.38/lib/device/bcache.c:514:33: warning[-Wanalyzer-malloc-leak]: leak of ‘io’
LVM2.2.03.38/lib/device/bcache.c:442:30: acquire_memory: allocated here
LVM2.2.03.38/lib/device/bcache.c:443:12: branch_false: following ‘false’ branch (when ‘io’ is non-NULL)...
LVM2.2.03.38/lib/device/bcache.c:448:9: branch_false: ...to here
LVM2.2.03.38/lib/device/bcache.c:450:12: branch_false: following ‘false’ branch (when ‘off != -1’)...
LVM2.2.03.38/lib/device/bcache.c:455:12: branch_false: ...to here
LVM2.2.03.38/lib/device/bcache.c:455:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/lib/device/bcache.c:464:12: branch_false: ...to here
LVM2.2.03.38/lib/device/bcache.c:464:12: branch_true: following ‘true’ branch...
LVM2.2.03.38/lib/device/bcache.c:471:20: branch_false: following ‘false’ branch...
LVM2.2.03.38/lib/device/bcache.c:480:21: branch_false: ...to here
LVM2.2.03.38/lib/device/bcache.c:480:20: branch_true: following ‘true’ branch...
LVM2.2.03.38/lib/device/bcache.c:481:25: branch_true: ...to here
LVM2.2.03.38/lib/device/bcache.c:514:33: throw: if ‘print_log’ throws an exception...
LVM2.2.03.38/lib/device/bcache.c:514:33: danger: ‘io’ leaks here; was allocated at [(1)](sarif:/runs/0/results/7/codeFlows/0/threadFlows/0/locations/0)
#  512|   				nbytes = limit_nbytes + extra_nbytes;
#  513|   			} else {
#  514|-> 				log_debug("Limit write at %llu len %llu to len %llu",
#  515|   					  (unsigned long long)offset,
#  516|   					  (unsigned long long)nbytes,

Error: GCC_ANALYZER_WARNING (CWE-401): [#def218]
LVM2.2.03.38/lib/device/bcache.c:527:33: warning[-Wanalyzer-malloc-leak]: leak of ‘io’
LVM2.2.03.38/lib/device/bcache.c:442:30: acquire_memory: allocated here
LVM2.2.03.38/lib/device/bcache.c:443:12: branch_false: following ‘false’ branch (when ‘io’ is non-NULL)...
LVM2.2.03.38/lib/device/bcache.c:448:9: branch_false: ...to here
LVM2.2.03.38/lib/device/bcache.c:450:12: branch_false: following ‘false’ branch (when ‘off != -1’)...
LVM2.2.03.38/lib/device/bcache.c:455:12: branch_false: ...to here
LVM2.2.03.38/lib/device/bcache.c:455:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/lib/device/bcache.c:464:12: branch_false: ...to here
LVM2.2.03.38/lib/device/bcache.c:464:12: branch_true: following ‘true’ branch...
LVM2.2.03.38/lib/device/bcache.c:471:20: branch_false: following ‘false’ branch...
LVM2.2.03.38/lib/device/bcache.c:480:21: branch_false: ...to here
LVM2.2.03.38/lib/device/bcache.c:480:20: branch_true: following ‘true’ branch...
LVM2.2.03.38/lib/device/bcache.c:481:25: branch_true: ...to here
LVM2.2.03.38/lib/device/bcache.c:526:28: branch_true: following ‘true’ branch (when ‘nbytes > len’)...
LVM2.2.03.38/lib/device/bcache.c:527:33: branch_true: ...to here
LVM2.2.03.38/lib/device/bcache.c:527:33: throw: if ‘print_log’ throws an exception...
LVM2.2.03.38/lib/device/bcache.c:527:33: danger: ‘io’ leaks here; was allocated at [(1)](sarif:/runs/0/results/8/codeFlows/0/threadFlows/0/locations/0)
#  525|   			 */
#  526|   			if (nbytes > orig_nbytes) {
#  527|-> 				log_error("Invalid adjusted write at %llu len %llu adjusted %llu limit %llu extra %llu sector_size %llu",
#  528|   					  (unsigned long long)offset,
#  529|   					  (unsigned long long)orig_nbytes,

Error: GCC_ANALYZER_WARNING (CWE-401): [#def219]
LVM2.2.03.38/lib/device/bcache.c:547:30: warning[-Wanalyzer-malloc-leak]: leak of ‘io’
LVM2.2.03.38/lib/device/bcache.c:442:30: acquire_memory: allocated here
LVM2.2.03.38/lib/device/bcache.c:443:12: branch_false: following ‘false’ branch (when ‘io’ is non-NULL)...
LVM2.2.03.38/lib/device/bcache.c:448:9: branch_false: ...to here
LVM2.2.03.38/lib/device/bcache.c:450:12: branch_false: following ‘false’ branch (when ‘off != -1’)...
LVM2.2.03.38/lib/device/bcache.c:455:12: branch_false: ...to here
LVM2.2.03.38/lib/device/bcache.c:455:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/lib/device/bcache.c:464:12: branch_false: ...to here
LVM2.2.03.38/lib/device/bcache.c:543:16: branch_true: following ‘true’ branch (when ‘pos < len’)...
LVM2.2.03.38/lib/device/bcache.c:544:20: branch_true: ...to here
LVM2.2.03.38/lib/device/bcache.c:547:30: throw: if ‘write’ throws an exception...
LVM2.2.03.38/lib/device/bcache.c:547:30: danger: ‘io’ leaks here; was allocated at [(1)](sarif:/runs/0/results/9/codeFlows/0/threadFlows/0/locations/0)
#  545|   			rv = read(_fd_table[di], (char *)data + pos, len - pos);
#  546|   		else
#  547|-> 			rv = write(_fd_table[di], (char *)data + pos, len - pos);
#  548|   
#  549|   		if (rv == -1 && errno == EINTR)

Error: GCC_ANALYZER_WARNING (CWE-401): [#def220]
LVM2.2.03.38/lib/device/bcache.c:559:33: warning[-Wanalyzer-malloc-leak]: leak of ‘io’
LVM2.2.03.38/lib/device/bcache.c:442:30: acquire_memory: allocated here
LVM2.2.03.38/lib/device/bcache.c:443:12: branch_false: following ‘false’ branch (when ‘io’ is non-NULL)...
LVM2.2.03.38/lib/device/bcache.c:448:9: branch_false: ...to here
LVM2.2.03.38/lib/device/bcache.c:450:12: branch_false: following ‘false’ branch (when ‘off != -1’)...
LVM2.2.03.38/lib/device/bcache.c:455:12: branch_false: ...to here
LVM2.2.03.38/lib/device/bcache.c:455:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/lib/device/bcache.c:464:12: branch_false: ...to here
LVM2.2.03.38/lib/device/bcache.c:543:16: branch_true: following ‘true’ branch (when ‘pos < len’)...
LVM2.2.03.38/lib/device/bcache.c:544:20: branch_true: ...to here
LVM2.2.03.38/lib/device/bcache.c:554:20: branch_false: following ‘false’ branch (when ‘rv != 0’)...
LVM2.2.03.38/lib/device/bcache.c:557:20: branch_false: ...to here
LVM2.2.03.38/lib/device/bcache.c:558:28: branch_true: following ‘true’ branch (when ‘d == 0’)...
LVM2.2.03.38/lib/device/bcache.c:559:33: branch_true: ...to here
LVM2.2.03.38/lib/device/bcache.c:559:33: throw: if ‘print_log’ throws an exception...
LVM2.2.03.38/lib/device/bcache.c:559:33: danger: ‘io’ leaks here; was allocated at [(1)](sarif:/runs/0/results/10/codeFlows/0/threadFlows/0/locations/0)
#  557|   		if (rv < 0) {
#  558|   			if (d == DIR_READ)
#  559|-> 				log_debug("Device read error %d offset %llu len %llu", errno,
#  560|   					  (unsigned long long)(where + pos),
#  561|   					  (unsigned long long)(len - pos));

Error: GCC_ANALYZER_WARNING (CWE-401): [#def221]
LVM2.2.03.38/lib/device/bcache.c:563:33: warning[-Wanalyzer-malloc-leak]: leak of ‘io’
LVM2.2.03.38/lib/device/bcache.c:442:30: acquire_memory: allocated here
LVM2.2.03.38/lib/device/bcache.c:443:12: branch_false: following ‘false’ branch (when ‘io’ is non-NULL)...
LVM2.2.03.38/lib/device/bcache.c:448:9: branch_false: ...to here
LVM2.2.03.38/lib/device/bcache.c:450:12: branch_false: following ‘false’ branch (when ‘off != -1’)...
LVM2.2.03.38/lib/device/bcache.c:455:12: branch_false: ...to here
LVM2.2.03.38/lib/device/bcache.c:455:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/lib/device/bcache.c:464:12: branch_false: ...to here
LVM2.2.03.38/lib/device/bcache.c:543:16: branch_true: following ‘true’ branch (when ‘pos < len’)...
LVM2.2.03.38/lib/device/bcache.c:544:20: branch_true: ...to here
LVM2.2.03.38/lib/device/bcache.c:554:20: branch_false: following ‘false’ branch (when ‘rv != 0’)...
LVM2.2.03.38/lib/device/bcache.c:557:20: branch_false: ...to here
LVM2.2.03.38/lib/device/bcache.c:558:28: branch_false: following ‘false’ branch (when ‘d != 0’)...
LVM2.2.03.38/lib/device/bcache.c:563:33: branch_false: ...to here
LVM2.2.03.38/lib/device/bcache.c:563:33: throw: if ‘print_log’ throws an exception...
LVM2.2.03.38/lib/device/bcache.c:563:33: danger: ‘io’ leaks here; was allocated at [(1)](sarif:/runs/0/results/11/codeFlows/0/threadFlows/0/locations/0)
#  561|   					  (unsigned long long)(len - pos));
#  562|   			else
#  563|-> 				log_debug("Device write error %d offset %llu len %llu", errno,
#  564|   					  (unsigned long long)(where + pos),
#  565|   					  (unsigned long long)(len - pos));

Error: GCC_ANALYZER_WARNING (CWE-401): [#def222]
LVM2.2.03.38/lib/device/bcache.c:574:25: warning[-Wanalyzer-malloc-leak]: leak of ‘io’
LVM2.2.03.38/lib/device/bcache.c:442:30: acquire_memory: allocated here
LVM2.2.03.38/lib/device/bcache.c:443:12: branch_false: following ‘false’ branch (when ‘io’ is non-NULL)...
LVM2.2.03.38/lib/device/bcache.c:448:9: branch_false: ...to here
LVM2.2.03.38/lib/device/bcache.c:450:12: branch_false: following ‘false’ branch (when ‘off != -1’)...
LVM2.2.03.38/lib/device/bcache.c:455:12: branch_false: ...to here
LVM2.2.03.38/lib/device/bcache.c:455:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/lib/device/bcache.c:464:12: branch_false: ...to here
LVM2.2.03.38/lib/device/bcache.c:572:12: branch_true: following ‘true’ branch (when ‘pos < len’)...
LVM2.2.03.38/lib/device/bcache.c:573:20: branch_true: ...to here
LVM2.2.03.38/lib/device/bcache.c:573:20: branch_true: following ‘true’ branch (when ‘d == 0’)...
LVM2.2.03.38/lib/device/bcache.c:574:25: branch_true: ...to here
LVM2.2.03.38/lib/device/bcache.c:574:25: throw: if ‘print_log’ throws an exception...
LVM2.2.03.38/lib/device/bcache.c:574:25: danger: ‘io’ leaks here; was allocated at [(1)](sarif:/runs/0/results/12/codeFlows/0/threadFlows/0/locations/0)
#  572|   	if (pos < len) {
#  573|   		if (d == DIR_READ)
#  574|-> 			log_warn("Device read short %u bytes remaining", (unsigned)(len - pos));
#  575|   		else
#  576|   			log_warn("Device write short %u bytes remaining", (unsigned)(len - pos));

Error: GCC_ANALYZER_WARNING (CWE-401): [#def223]
LVM2.2.03.38/lib/device/bcache.c:576:25: warning[-Wanalyzer-malloc-leak]: leak of ‘io’
LVM2.2.03.38/lib/device/bcache.c:442:30: acquire_memory: allocated here
LVM2.2.03.38/lib/device/bcache.c:443:12: branch_false: following ‘false’ branch (when ‘io’ is non-NULL)...
LVM2.2.03.38/lib/device/bcache.c:448:9: branch_false: ...to here
LVM2.2.03.38/lib/device/bcache.c:450:12: branch_false: following ‘false’ branch (when ‘off != -1’)...
LVM2.2.03.38/lib/device/bcache.c:455:12: branch_false: ...to here
LVM2.2.03.38/lib/device/bcache.c:455:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/lib/device/bcache.c:464:12: branch_false: ...to here
LVM2.2.03.38/lib/device/bcache.c:572:12: branch_true: following ‘true’ branch (when ‘pos < len’)...
LVM2.2.03.38/lib/device/bcache.c:573:20: branch_true: ...to here
LVM2.2.03.38/lib/device/bcache.c:573:20: branch_false: following ‘false’ branch (when ‘d != 0’)...
LVM2.2.03.38/lib/device/bcache.c:576:25: branch_false: ...to here
LVM2.2.03.38/lib/device/bcache.c:576:25: throw: if ‘print_log’ throws an exception...
LVM2.2.03.38/lib/device/bcache.c:576:25: danger: ‘io’ leaks here; was allocated at [(1)](sarif:/runs/0/results/13/codeFlows/0/threadFlows/0/locations/0)
#  574|   			log_warn("Device read short %u bytes remaining", (unsigned)(len - pos));
#  575|   		else
#  576|-> 			log_warn("Device write short %u bytes remaining", (unsigned)(len - pos));
#  577|   		/*
#  578|           	free(io);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def224]
LVM2.2.03.38/lib/device/bcache.c:584:9: warning[-Wanalyzer-malloc-leak]: leak of ‘io’
LVM2.2.03.38/lib/device/bcache.c:442:30: acquire_memory: allocated here
LVM2.2.03.38/lib/device/bcache.c:443:12: branch_false: following ‘false’ branch (when ‘io’ is non-NULL)...
LVM2.2.03.38/lib/device/bcache.c:448:9: branch_false: ...to here
LVM2.2.03.38/lib/device/bcache.c:450:12: branch_false: following ‘false’ branch (when ‘off != -1’)...
LVM2.2.03.38/lib/device/bcache.c:455:12: branch_false: ...to here
LVM2.2.03.38/lib/device/bcache.c:455:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/lib/device/bcache.c:464:12: branch_false: ...to here
LVM2.2.03.38/lib/device/bcache.c:584:9: throw: if ‘dm_list_add’ throws an exception...
LVM2.2.03.38/lib/device/bcache.c:584:9: danger: ‘io’ leaks here; was allocated at [(1)](sarif:/runs/0/results/14/codeFlows/0/threadFlows/0/locations/0)
#  582|   
#  583|   
#  584|-> 	dm_list_add(&e->complete, &io->list);
#  585|   	io->context = context;
#  586|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def225]
LVM2.2.03.38/lib/device/bcache.c:621:9: warning[-Wanalyzer-malloc-leak]: leak of ‘e’
LVM2.2.03.38/lib/device/bcache.c:611:33: acquire_memory: allocated here
LVM2.2.03.38/lib/device/bcache.c:613:12: branch_false: following ‘false’ branch (when ‘e’ is non-NULL)...
LVM2.2.03.38/lib/device/bcache.c:616:9: branch_false: ...to here
LVM2.2.03.38/lib/device/bcache.c:621:9: throw: if ‘dm_list_init’ throws an exception...
LVM2.2.03.38/lib/device/bcache.c:621:9: danger: ‘e’ leaks here; was allocated at [(1)](sarif:/runs/0/results/15/codeFlows/0/threadFlows/0/locations/0)
#  619|           e->e.max_io = _sync_max_io;
#  620|   
#  621|-> 	dm_list_init(&e->complete);
#  622|   	/* coverity[leaked_storage] 'e' is not leaking */
#  623|           return &e->e;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def226]
LVM2.2.03.38/lib/device/bcache.c:1146:9: warning[-Wanalyzer-malloc-leak]: leak of ‘cache’
LVM2.2.03.38/lib/device/bcache.c:1119:12: branch_false: following ‘false’ branch (when ‘nr_cache_blocks != 0’)...
LVM2.2.03.38/lib/device/bcache.c:1124:12: branch_false: ...to here
LVM2.2.03.38/lib/device/bcache.c:1124:12: branch_false: following ‘false’ branch (when ‘block_sectors != 0’)...
LVM2.2.03.38/lib/device/bcache.c:1129:30: branch_false: ...to here
LVM2.2.03.38/lib/device/bcache.c:1129:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/lib/device/bcache.c:1134:17: branch_false: ...to here
LVM2.2.03.38/lib/device/bcache.c:1134:17: acquire_memory: allocated here
LVM2.2.03.38/lib/device/bcache.c:1135:12: branch_false: following ‘false’ branch (when ‘cache’ is non-NULL)...
LVM2.2.03.38/lib/device/bcache.c:1138:9: branch_false: ...to here
LVM2.2.03.38/lib/device/bcache.c:1146:9: throw: if ‘dm_list_init’ throws an exception...
LVM2.2.03.38/lib/device/bcache.c:1146:9: danger: ‘cache’ leaks here; was allocated at [(7)](sarif:/runs/0/results/16/codeFlows/0/threadFlows/0/locations/6)
# 1144|   	cache->nr_io_pending = 0;
# 1145|   
# 1146|-> 	dm_list_init(&cache->free);
# 1147|   	dm_list_init(&cache->errored);
# 1148|   	dm_list_init(&cache->dirty);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def227]
LVM2.2.03.38/lib/device/dev-cache.c:2414:34: warning[-Wanalyzer-malloc-leak]: leak of ‘opendir(&path)’
LVM2.2.03.38/lib/device/dev-cache.c:2398:12: branch_false: following ‘false’ branch (when ‘devno != 0’)...
LVM2.2.03.38/lib/device/dev-cache.c:2405:13: branch_false: ...to here
LVM2.2.03.38/lib/device/dev-cache.c:2405:12: branch_true: following ‘true’ branch...
LVM2.2.03.38/lib/device/dev-cache.c:2406:21: branch_true: ...to here
LVM2.2.03.38/lib/device/dev-cache.c:2406:20: branch_false: following ‘false’ branch...
LVM2.2.03.38/lib/device/dev-cache.c:2411:29: branch_false: ...to here
LVM2.2.03.38/lib/device/dev-cache.c:2411:29: acquire_memory: allocated here
LVM2.2.03.38/lib/device/dev-cache.c:2411:20: branch_false: following ‘false’ branch...
LVM2.2.03.38/lib/device/dev-cache.c:2411:20: branch_false: ...to here
LVM2.2.03.38/lib/device/dev-cache.c:2414:34: throw: if ‘readdir’ throws an exception...
LVM2.2.03.38/lib/device/dev-cache.c:2414:34: danger: ‘opendir(&path)’ leaks here; was allocated at [(7)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/6)
# 2412|   			goto try_partition;
# 2413|   
# 2414|-> 		while ((dirent = readdir(dir))) {
# 2415|   			if (dirent->d_name[0] == '.')
# 2416|   				continue;

Error: GCC_ANALYZER_WARNING (CWE-775): [#def228]
LVM2.2.03.38/lib/device/dev-cache.c:2470:21: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(&_partitions, "r")’
LVM2.2.03.38/lib/device/dev-cache.c:2398:12: branch_false: following ‘false’ branch (when ‘devno != 0’)...
LVM2.2.03.38/lib/device/dev-cache.c:2405:13: branch_false: ...to here
LVM2.2.03.38/lib/device/dev-cache.c:2437:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/lib/device/dev-cache.c:2462:1: branch_false: ...to here
LVM2.2.03.38/lib/device/dev-cache.c:2463:20: acquire_resource: opened here
LVM2.2.03.38/lib/device/dev-cache.c:2463:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/lib/device/dev-cache.c:2463:12: branch_false: ...to here
LVM2.2.03.38/lib/device/dev-cache.c:2466:16: branch_true: following ‘true’ branch...
LVM2.2.03.38/lib/device/dev-cache.c:2467:21: branch_true: ...to here
LVM2.2.03.38/lib/device/dev-cache.c:2475:21: throw: if ‘dm_snprintf’ throws an exception...
LVM2.2.03.38/lib/device/dev-cache.c:2470:21: danger: ‘fopen(&_partitions, "r")’ leaks here; was opened at [(5)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/4)
# 2468|   			   &line_major, &line_minor, (unsigned long long *)&line_blocks, namebuf) != 4)
# 2469|   			continue;
# 2470|-> 		if (line_major != major)
# 2471|   			continue;
# 2472|   		if (line_minor != minor)

Error: GCC_ANALYZER_WARNING (CWE-401): [#def229]
LVM2.2.03.38/lib/device/dev-cache.c:2470:21: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(&_partitions, "r")’
LVM2.2.03.38/lib/device/dev-cache.c:2398:12: branch_false: following ‘false’ branch (when ‘devno != 0’)...
LVM2.2.03.38/lib/device/dev-cache.c:2405:13: branch_false: ...to here
LVM2.2.03.38/lib/device/dev-cache.c:2437:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/lib/device/dev-cache.c:2462:1: branch_false: ...to here
LVM2.2.03.38/lib/device/dev-cache.c:2463:20: acquire_memory: allocated here
LVM2.2.03.38/lib/device/dev-cache.c:2463:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/lib/device/dev-cache.c:2463:12: branch_false: ...to here
LVM2.2.03.38/lib/device/dev-cache.c:2466:16: branch_true: following ‘true’ branch...
LVM2.2.03.38/lib/device/dev-cache.c:2467:21: branch_true: ...to here
LVM2.2.03.38/lib/device/dev-cache.c:2475:21: throw: if ‘dm_snprintf’ throws an exception...
LVM2.2.03.38/lib/device/dev-cache.c:2470:21: danger: ‘fopen(&_partitions, "r")’ leaks here; was allocated at [(5)](sarif:/runs/0/results/2/codeFlows/0/threadFlows/0/locations/4)
# 2468|   			   &line_major, &line_minor, (unsigned long long *)&line_blocks, namebuf) != 4)
# 2469|   			continue;
# 2470|-> 		if (line_major != major)
# 2471|   			continue;
# 2472|   		if (line_minor != minor)

Error: GCC_ANALYZER_WARNING (CWE-775): [#def230]
LVM2.2.03.38/lib/device/dev-md.c:371:17: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(&path, "r")’
LVM2.2.03.38/lib/device/dev-md.c:361:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/lib/device/dev-md.c:365:20: branch_false: ...to here
LVM2.2.03.38/lib/device/dev-md.c:365:20: acquire_resource: opened here
LVM2.2.03.38/lib/device/dev-md.c:365:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/lib/device/dev-md.c:370:14: branch_false: ...to here
LVM2.2.03.38/lib/device/dev-md.c:370:12: branch_true: following ‘true’ branch...
LVM2.2.03.38/lib/device/dev-md.c:371:17: branch_true: ...to here
LVM2.2.03.38/lib/device/dev-md.c:371:17: throw: if ‘print_log’ throws an exception...
LVM2.2.03.38/lib/device/dev-md.c:371:17: danger: ‘fopen(&path, "r")’ leaks here; was opened at [(3)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/2)
#  369|   
#  370|   	if (!fgets(buffer, sizeof(buffer), fp)) {
#  371|-> 		log_debug("_md_sysfs_attribute_scanf fgets failed %s", path);
#  372|   		goto out;
#  373|   	}

Error: GCC_ANALYZER_WARNING (CWE-401): [#def231]
LVM2.2.03.38/lib/device/dev-md.c:371:17: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(&path, "r")’
LVM2.2.03.38/lib/device/dev-md.c:361:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/lib/device/dev-md.c:365:20: branch_false: ...to here
LVM2.2.03.38/lib/device/dev-md.c:365:20: acquire_memory: allocated here
LVM2.2.03.38/lib/device/dev-md.c:365:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/lib/device/dev-md.c:370:14: branch_false: ...to here
LVM2.2.03.38/lib/device/dev-md.c:370:12: branch_true: following ‘true’ branch...
LVM2.2.03.38/lib/device/dev-md.c:371:17: branch_true: ...to here
LVM2.2.03.38/lib/device/dev-md.c:371:17: throw: if ‘print_log’ throws an exception...
LVM2.2.03.38/lib/device/dev-md.c:371:17: danger: ‘fopen(&path, "r")’ leaks here; was allocated at [(3)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/2)
#  369|   
#  370|   	if (!fgets(buffer, sizeof(buffer), fp)) {
#  371|-> 		log_debug("_md_sysfs_attribute_scanf fgets failed %s", path);
#  372|   		goto out;
#  373|   	}

Error: GCC_ANALYZER_WARNING (CWE-775): [#def232]
LVM2.2.03.38/lib/device/dev-md.c:376:17: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(&path, "r")’
LVM2.2.03.38/lib/device/dev-md.c:361:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/lib/device/dev-md.c:365:20: branch_false: ...to here
LVM2.2.03.38/lib/device/dev-md.c:365:20: acquire_resource: opened here
LVM2.2.03.38/lib/device/dev-md.c:365:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/lib/device/dev-md.c:370:14: branch_false: ...to here
LVM2.2.03.38/lib/device/dev-md.c:370:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/lib/device/dev-md.c:375:20: branch_false: ...to here
LVM2.2.03.38/lib/device/dev-md.c:375:12: branch_true: following ‘true’ branch (when ‘ret != 1’)...
LVM2.2.03.38/lib/device/dev-md.c:376:17: branch_true: ...to here
LVM2.2.03.38/lib/device/dev-md.c:376:17: throw: if ‘dev_name’ throws an exception...
LVM2.2.03.38/lib/device/dev-md.c:376:17: danger: ‘fopen(&path, "r")’ leaks here; was opened at [(3)](sarif:/runs/0/results/2/codeFlows/0/threadFlows/0/locations/2)
#  374|   
#  375|   	if ((ret = sscanf(buffer, attribute_fmt, attribute_value)) != 1) {
#  376|-> 		log_error("%s sysfs attr %s not in expected format: %s",
#  377|   			  dev_name(dev), attribute_name, buffer);
#  378|   		goto out;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def233]
LVM2.2.03.38/lib/device/dev-md.c:376:17: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(&path, "r")’
LVM2.2.03.38/lib/device/dev-md.c:361:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/lib/device/dev-md.c:365:20: branch_false: ...to here
LVM2.2.03.38/lib/device/dev-md.c:365:20: acquire_memory: allocated here
LVM2.2.03.38/lib/device/dev-md.c:365:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/lib/device/dev-md.c:370:14: branch_false: ...to here
LVM2.2.03.38/lib/device/dev-md.c:370:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/lib/device/dev-md.c:375:20: branch_false: ...to here
LVM2.2.03.38/lib/device/dev-md.c:375:12: branch_true: following ‘true’ branch (when ‘ret != 1’)...
LVM2.2.03.38/lib/device/dev-md.c:376:17: branch_true: ...to here
LVM2.2.03.38/lib/device/dev-md.c:376:17: throw: if ‘dev_name’ throws an exception...
LVM2.2.03.38/lib/device/dev-md.c:376:17: danger: ‘fopen(&path, "r")’ leaks here; was allocated at [(3)](sarif:/runs/0/results/3/codeFlows/0/threadFlows/0/locations/2)
#  374|   
#  375|   	if ((ret = sscanf(buffer, attribute_fmt, attribute_value)) != 1) {
#  376|-> 		log_error("%s sysfs attr %s not in expected format: %s",
#  377|   			  dev_name(dev), attribute_name, buffer);
#  378|   		goto out;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def234]
LVM2.2.03.38/lib/device/dev-mpath.c:178:30: warning[-Wanalyzer-malloc-leak]: leak of ‘opendir(&_mpath_conf)’
LVM2.2.03.38/lib/device/dev-mpath.c:177:20: acquire_memory: allocated here
LVM2.2.03.38/lib/device/dev-mpath.c:177:12: branch_true: following ‘true’ branch...
LVM2.2.03.38/lib/device/dev-mpath.c:177:12: branch_true: ...to here
LVM2.2.03.38/lib/device/dev-mpath.c:178:30: throw: if ‘readdir’ throws an exception...
LVM2.2.03.38/lib/device/dev-mpath.c:178:30: danger: ‘opendir(&_mpath_conf)’ leaks here; was allocated at [(1)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/0)
#  176|   
#  177|   	if ((dir = opendir(_mpath_conf))) {
#  178|-> 		while ((de = readdir(dir))) {
#  179|   			if (de->d_name[0] == '.')
#  180|   				continue;

Error: GCC_ANALYZER_WARNING (CWE-775): [#def235]
LVM2.2.03.38/lib/device/dev-mpath.c:225:21: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(config_wwids_file, "r")’
LVM2.2.03.38/lib/device/dev-mpath.c:214:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/lib/device/dev-mpath.c:219:20: branch_false: ...to here
LVM2.2.03.38/lib/device/dev-mpath.c:219:20: acquire_resource: opened here
LVM2.2.03.38/lib/device/dev-mpath.c:219:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/lib/device/dev-mpath.c:219:12: branch_false: ...to here
LVM2.2.03.38/lib/device/dev-mpath.c:224:16: branch_true: following ‘true’ branch...
LVM2.2.03.38/lib/device/dev-mpath.c:225:21: branch_true: ...to here
LVM2.2.03.38/lib/device/dev-mpath.c:245:20: branch_false: following ‘false’ branch (when ‘p’ is NULL)...
LVM2.2.03.38/lib/device/dev-mpath.c:248:68: branch_false: ...to here
LVM2.2.03.38/lib/device/dev-mpath.c:248:24: throw: if ‘dm_hash_insert_binary’ throws an exception...
LVM2.2.03.38/lib/device/dev-mpath.c:225:21: danger: ‘fopen(config_wwids_file, "r")’ leaks here; was opened at [(3)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/2)
#  223|   
#  224|   	while (fgets(line, sizeof(line), fp)) {
#  225|-> 		if (line[0] == '#')
#  226|   			continue;
#  227|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def236]
LVM2.2.03.38/lib/device/dev-mpath.c:225:21: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(config_wwids_file, "r")’
LVM2.2.03.38/lib/device/dev-mpath.c:214:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/lib/device/dev-mpath.c:219:20: branch_false: ...to here
LVM2.2.03.38/lib/device/dev-mpath.c:219:20: acquire_memory: allocated here
LVM2.2.03.38/lib/device/dev-mpath.c:219:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/lib/device/dev-mpath.c:219:12: branch_false: ...to here
LVM2.2.03.38/lib/device/dev-mpath.c:224:16: branch_true: following ‘true’ branch...
LVM2.2.03.38/lib/device/dev-mpath.c:225:21: branch_true: ...to here
LVM2.2.03.38/lib/device/dev-mpath.c:245:20: branch_false: following ‘false’ branch (when ‘p’ is NULL)...
LVM2.2.03.38/lib/device/dev-mpath.c:248:68: branch_false: ...to here
LVM2.2.03.38/lib/device/dev-mpath.c:248:24: throw: if ‘dm_hash_insert_binary’ throws an exception...
LVM2.2.03.38/lib/device/dev-mpath.c:225:21: danger: ‘fopen(config_wwids_file, "r")’ leaks here; was allocated at [(3)](sarif:/runs/0/results/2/codeFlows/0/threadFlows/0/locations/2)
#  223|   
#  224|   	while (fgets(line, sizeof(line), fp)) {
#  225|-> 		if (line[0] == '#')
#  226|   			continue;
#  227|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def237]
LVM2.2.03.38/lib/device/dev-mpath.c:480:22: warning[-Wanalyzer-malloc-leak]: leak of ‘opendir(&holders_path)’
LVM2.2.03.38/lib/device/dev-mpath.c:416:12: enter_function: entry to ‘_dev_is_mpath_component_sysfs’
LVM2.2.03.38/lib/device/dev-mpath.c:448:30: call_function: calling ‘_get_sysfs_name’ from ‘_dev_is_mpath_component_sysfs’
LVM2.2.03.38/lib/device/dev-mpath.c:448:30: return_function: returning to ‘_dev_is_mpath_component_sysfs’ from ‘_get_sysfs_name’
LVM2.2.03.38/lib/device/dev-mpath.c:448:20: branch_false: following ‘false’ branch...
LVM2.2.03.38/lib/device/dev-mpath.c:457:13: branch_false: ...to here
LVM2.2.03.38/lib/device/dev-mpath.c:457:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/lib/device/dev-mpath.c:463:13: branch_false: ...to here
LVM2.2.03.38/lib/device/dev-mpath.c:463:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/lib/device/dev-mpath.c:466:14: branch_false: ...to here
LVM2.2.03.38/lib/device/dev-mpath.c:466:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/lib/device/dev-mpath.c:475:20: branch_false: ...to here
LVM2.2.03.38/lib/device/dev-mpath.c:475:20: acquire_memory: allocated here
LVM2.2.03.38/lib/device/dev-mpath.c:475:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/lib/device/dev-mpath.c:475:12: branch_false: ...to here
LVM2.2.03.38/lib/device/dev-mpath.c:480:22: throw: if ‘readdir’ throws an exception...
LVM2.2.03.38/lib/device/dev-mpath.c:480:22: danger: ‘opendir(&holders_path)’ leaks here; was allocated at [(17)](sarif:/runs/0/results/3/codeFlows/0/threadFlows/0/locations/16)
#  478|   	}
#  479|   
#  480|-> 	while ((de = readdir(dr))) {
#  481|   		if (!strcmp(de->d_name, ".") || !strcmp(de->d_name, ".."))
#  482|   			continue;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def238]
LVM2.2.03.38/lib/device/dev-mpath.c:705:22: warning[-Wanalyzer-malloc-leak]: leak of ‘opendir(&slaves_path)’
LVM2.2.03.38/lib/device/dev-mpath.c:689:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/lib/device/dev-mpath.c:697:20: branch_false: ...to here
LVM2.2.03.38/lib/device/dev-mpath.c:697:20: acquire_memory: allocated here
LVM2.2.03.38/lib/device/dev-mpath.c:697:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/lib/device/dev-mpath.c:697:12: branch_false: ...to here
LVM2.2.03.38/lib/device/dev-mpath.c:705:22: throw: if ‘readdir’ throws an exception...
LVM2.2.03.38/lib/device/dev-mpath.c:705:22: danger: ‘opendir(&slaves_path)’ leaks here; was allocated at [(3)](sarif:/runs/0/results/4/codeFlows/0/threadFlows/0/locations/2)
#  703|   	}
#  704|   
#  705|-> 	while ((de = readdir(dr))) {
#  706|   		if (!strcmp(de->d_name, ".") || !strcmp(de->d_name, ".."))
#  707|   			continue;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def239]
LVM2.2.03.38/lib/device/dev-type.c:138:26: warning[-Wanalyzer-malloc-leak]: leak of ‘opendir(&holders_path)’
LVM2.2.03.38/lib/device/dev-type.c:129:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/lib/device/dev-type.c:135:19: branch_false: ...to here
LVM2.2.03.38/lib/device/dev-type.c:135:19: acquire_memory: allocated here
LVM2.2.03.38/lib/device/dev-type.c:135:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/lib/device/dev-type.c:135:12: branch_false: ...to here
LVM2.2.03.38/lib/device/dev-type.c:138:26: throw: if ‘readdir’ throws an exception...
LVM2.2.03.38/lib/device/dev-type.c:138:26: danger: ‘opendir(&holders_path)’ leaks here; was allocated at [(3)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/2)
#  136|   		return 0;
#  137|   
#  138|-> 	while ((dirent = readdir(d))) {
#  139|   		if (!strcmp(".", dirent->d_name) || !strcmp("..", dirent->d_name))
#  140|   			continue;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def240]
LVM2.2.03.38/lib/device/dev-type.c:240:14: warning[-Wanalyzer-malloc-leak]: leak of ‘calloc(1, 32804)’
LVM2.2.03.38/lib/device/dev-type.c:220:19: enter_function: entry to ‘create_dev_types’
LVM2.2.03.38/lib/device/dev-type.c:235:20: call_function: inlined call to ‘zalloc’ from ‘create_dev_types’
LVM2.2.03.38/lib/device/dev-type.c:235:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/lib/device/dev-type.c:240:14: branch_false: ...to here
LVM2.2.03.38/lib/device/dev-type.c:240:12: branch_true: following ‘true’ branch...
LVM2.2.03.38/lib/device/dev-type.c:241:17: branch_true: ...to here
LVM2.2.03.38/lib/device/dev-type.c:241:17: throw: if ‘print_log’ throws an exception...
LVM2.2.03.38/lib/device/dev-type.c:240:14: danger: ‘calloc(1, 32804)’ leaks here; was allocated at [(3)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/2)
#  238|   	}
#  239|   
#  240|-> 	if (!*proc_dir) {
#  241|   		log_verbose("No proc filesystem found: using all block device types");
#  242|   		for (i = 0; i < NUMBER_OF_MAJORS; i++)

Error: GCC_ANALYZER_WARNING (CWE-775): [#def241]
LVM2.2.03.38/lib/device/dev-type.c:260:24: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(&proc_devices, "r")’
LVM2.2.03.38/lib/device/dev-type.c:235:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/lib/device/dev-type.c:240:14: branch_false: ...to here
LVM2.2.03.38/lib/device/dev-type.c:240:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/lib/device/dev-type.c:247:13: branch_false: ...to here
LVM2.2.03.38/lib/device/dev-type.c:247:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/lib/device/dev-type.c:253:20: branch_false: ...to here
LVM2.2.03.38/lib/device/dev-type.c:253:20: acquire_resource: opened here
LVM2.2.03.38/lib/device/dev-type.c:253:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/lib/device/dev-type.c:253:12: branch_false: ...to here
LVM2.2.03.38/lib/device/dev-type.c:258:16: branch_true: following ‘true’ branch...
LVM2.2.03.38/lib/device/dev-type.c:258:16: branch_true: ...to here
LVM2.2.03.38/lib/device/dev-type.c:260:24: branch_false: following ‘false’ branch...
LVM2.2.03.38/lib/device/dev-type.c:264:28: branch_false: ...to here
LVM2.2.03.38/lib/device/dev-type.c:266:20: branch_true: following ‘true’ branch...
LVM2.2.03.38/lib/device/dev-type.c:272:35: branch_true: ...to here
LVM2.2.03.38/lib/device/dev-type.c:272:28: branch_true: following ‘true’ branch (when ‘nl’ is non-NULL)...
LVM2.2.03.38/lib/device/dev-type.c:272:56: branch_true: ...to here
LVM2.2.03.38/lib/device/dev-type.c:273:25: throw: if ‘print_log’ throws an exception...
LVM2.2.03.38/lib/device/dev-type.c:260:24: danger: ‘fopen(&proc_devices, "r")’ leaks here; was opened at [(7)](sarif:/runs/0/results/13/codeFlows/0/threadFlows/0/locations/6)
#  258|   	while (fgets(line, sizeof(line), pd) != NULL) {
#  259|   		i = 0;
#  260|-> 		while (line[i] == ' ')
#  261|   			i++;
#  262|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def242]
LVM2.2.03.38/lib/device/dev-type.c:260:24: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(&proc_devices, "r")’
LVM2.2.03.38/lib/device/dev-type.c:235:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/lib/device/dev-type.c:240:14: branch_false: ...to here
LVM2.2.03.38/lib/device/dev-type.c:240:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/lib/device/dev-type.c:247:13: branch_false: ...to here
LVM2.2.03.38/lib/device/dev-type.c:247:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/lib/device/dev-type.c:253:20: branch_false: ...to here
LVM2.2.03.38/lib/device/dev-type.c:253:20: acquire_memory: allocated here
LVM2.2.03.38/lib/device/dev-type.c:253:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/lib/device/dev-type.c:253:12: branch_false: ...to here
LVM2.2.03.38/lib/device/dev-type.c:258:16: branch_true: following ‘true’ branch...
LVM2.2.03.38/lib/device/dev-type.c:258:16: branch_true: ...to here
LVM2.2.03.38/lib/device/dev-type.c:260:24: branch_false: following ‘false’ branch...
LVM2.2.03.38/lib/device/dev-type.c:264:28: branch_false: ...to here
LVM2.2.03.38/lib/device/dev-type.c:266:20: branch_true: following ‘true’ branch...
LVM2.2.03.38/lib/device/dev-type.c:272:35: branch_true: ...to here
LVM2.2.03.38/lib/device/dev-type.c:272:28: branch_true: following ‘true’ branch (when ‘nl’ is non-NULL)...
LVM2.2.03.38/lib/device/dev-type.c:272:56: branch_true: ...to here
LVM2.2.03.38/lib/device/dev-type.c:273:25: throw: if ‘print_log’ throws an exception...
LVM2.2.03.38/lib/device/dev-type.c:260:24: danger: ‘fopen(&proc_devices, "r")’ leaks here; was allocated at [(7)](sarif:/runs/0/results/14/codeFlows/0/threadFlows/0/locations/6)
#  258|   	while (fgets(line, sizeof(line), pd) != NULL) {
#  259|   		i = 0;
#  260|-> 		while (line[i] == ' ')
#  261|   			i++;
#  262|   

Error: GCC_ANALYZER_WARNING (CWE-835): [#def243]
LVM2.2.03.38/lib/device/dev-type.c:288:24: warning[-Wanalyzer-infinite-loop]: infinite loop
LVM2.2.03.38/lib/device/dev-type.c:288:24: danger: infinite loop here
LVM2.2.03.38/lib/device/dev-type.c:288:24: branch_true: if it ever follows ‘true’ branch, it will always do so...
LVM2.2.03.38/lib/device/dev-type.c:289:25: branch_true: ...to here
#  286|   
#  287|   		/* Find the start of the device major name */
#  288|-> 		while (line[i] != ' ' && line[i] != '\0')
#  289|   			i++;
#  290|   		while (line[i] == ' ')

Error: GCC_ANALYZER_WARNING (CWE-775): [#def244]
LVM2.2.03.38/lib/device/dev-type.c:493:17: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(&path, "r")’
LVM2.2.03.38/lib/device/dev-type.c:483:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/lib/device/dev-type.c:489:20: branch_false: ...to here
LVM2.2.03.38/lib/device/dev-type.c:489:20: acquire_resource: opened here
LVM2.2.03.38/lib/device/dev-type.c:489:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/lib/device/dev-type.c:492:14: branch_false: ...to here
LVM2.2.03.38/lib/device/dev-type.c:492:12: branch_true: following ‘true’ branch...
LVM2.2.03.38/lib/device/dev-type.c:493:17: branch_true: ...to here
LVM2.2.03.38/lib/device/dev-type.c:493:17: throw: if ‘print_log’ throws an exception...
LVM2.2.03.38/lib/device/dev-type.c:493:17: danger: ‘fopen(&path, "r")’ leaks here; was opened at [(3)](sarif:/runs/0/results/22/codeFlows/0/threadFlows/0/locations/2)
#  491|   
#  492|   	if (!fgets(buffer, sizeof(buffer), fp)) {
#  493|-> 		log_warn("Failed to read %s.", path);
#  494|   	} else if (sscanf(buffer, "%d", &partscan) != 1) {
#  495|   		log_warn("Failed to parse %s '%s'.", path, buffer);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def245]
LVM2.2.03.38/lib/device/dev-type.c:493:17: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(&path, "r")’
LVM2.2.03.38/lib/device/dev-type.c:483:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/lib/device/dev-type.c:489:20: branch_false: ...to here
LVM2.2.03.38/lib/device/dev-type.c:489:20: acquire_memory: allocated here
LVM2.2.03.38/lib/device/dev-type.c:489:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/lib/device/dev-type.c:492:14: branch_false: ...to here
LVM2.2.03.38/lib/device/dev-type.c:492:12: branch_true: following ‘true’ branch...
LVM2.2.03.38/lib/device/dev-type.c:493:17: branch_true: ...to here
LVM2.2.03.38/lib/device/dev-type.c:493:17: throw: if ‘print_log’ throws an exception...
LVM2.2.03.38/lib/device/dev-type.c:493:17: danger: ‘fopen(&path, "r")’ leaks here; was allocated at [(3)](sarif:/runs/0/results/23/codeFlows/0/threadFlows/0/locations/2)
#  491|   
#  492|   	if (!fgets(buffer, sizeof(buffer), fp)) {
#  493|-> 		log_warn("Failed to read %s.", path);
#  494|   	} else if (sscanf(buffer, "%d", &partscan) != 1) {
#  495|   		log_warn("Failed to parse %s '%s'.", path, buffer);

Error: GCC_ANALYZER_WARNING (CWE-775): [#def246]
LVM2.2.03.38/lib/device/dev-type.c:495:17: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(&path, "r")’
LVM2.2.03.38/lib/device/dev-type.c:483:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/lib/device/dev-type.c:489:20: branch_false: ...to here
LVM2.2.03.38/lib/device/dev-type.c:489:20: acquire_resource: opened here
LVM2.2.03.38/lib/device/dev-type.c:489:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/lib/device/dev-type.c:492:14: branch_false: ...to here
LVM2.2.03.38/lib/device/dev-type.c:492:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/lib/device/dev-type.c:494:20: branch_false: ...to here
LVM2.2.03.38/lib/device/dev-type.c:494:19: branch_true: following ‘true’ branch...
LVM2.2.03.38/lib/device/dev-type.c:495:17: branch_true: ...to here
LVM2.2.03.38/lib/device/dev-type.c:495:17: throw: if ‘print_log’ throws an exception...
LVM2.2.03.38/lib/device/dev-type.c:495:17: danger: ‘fopen(&path, "r")’ leaks here; was opened at [(3)](sarif:/runs/0/results/24/codeFlows/0/threadFlows/0/locations/2)
#  493|   		log_warn("Failed to read %s.", path);
#  494|   	} else if (sscanf(buffer, "%d", &partscan) != 1) {
#  495|-> 		log_warn("Failed to parse %s '%s'.", path, buffer);
#  496|   		partscan = 0;
#  497|   	}

Error: GCC_ANALYZER_WARNING (CWE-401): [#def247]
LVM2.2.03.38/lib/device/dev-type.c:495:17: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(&path, "r")’
LVM2.2.03.38/lib/device/dev-type.c:483:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/lib/device/dev-type.c:489:20: branch_false: ...to here
LVM2.2.03.38/lib/device/dev-type.c:489:20: acquire_memory: allocated here
LVM2.2.03.38/lib/device/dev-type.c:489:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/lib/device/dev-type.c:492:14: branch_false: ...to here
LVM2.2.03.38/lib/device/dev-type.c:492:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/lib/device/dev-type.c:494:20: branch_false: ...to here
LVM2.2.03.38/lib/device/dev-type.c:494:19: branch_true: following ‘true’ branch...
LVM2.2.03.38/lib/device/dev-type.c:495:17: branch_true: ...to here
LVM2.2.03.38/lib/device/dev-type.c:495:17: throw: if ‘print_log’ throws an exception...
LVM2.2.03.38/lib/device/dev-type.c:495:17: danger: ‘fopen(&path, "r")’ leaks here; was allocated at [(3)](sarif:/runs/0/results/25/codeFlows/0/threadFlows/0/locations/2)
#  493|   		log_warn("Failed to read %s.", path);
#  494|   	} else if (sscanf(buffer, "%d", &partscan) != 1) {
#  495|-> 		log_warn("Failed to parse %s '%s'.", path, buffer);
#  496|   		partscan = 0;
#  497|   	}

Error: GCC_ANALYZER_WARNING (CWE-775): [#def248]
LVM2.2.03.38/lib/device/dev-type.c:900:17: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(&path, "r")’
LVM2.2.03.38/lib/device/dev-type.c:858:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/lib/device/dev-type.c:871:13: branch_false: ...to here
LVM2.2.03.38/lib/device/dev-type.c:871:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/lib/device/dev-type.c:876:21: branch_false: ...to here
LVM2.2.03.38/lib/device/dev-type.c:876:12: branch_false: following ‘false’ branch (when ‘size >= 0’)...
LVM2.2.03.38/lib/device/dev-type.c:881:9: branch_false: ...to here
LVM2.2.03.38/lib/device/dev-type.c:883:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/lib/device/dev-type.c:891:20: branch_false: ...to here
LVM2.2.03.38/lib/device/dev-type.c:891:20: acquire_resource: opened here
LVM2.2.03.38/lib/device/dev-type.c:891:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/lib/device/dev-type.c:899:14: branch_false: ...to here
LVM2.2.03.38/lib/device/dev-type.c:899:12: branch_true: following ‘true’ branch...
LVM2.2.03.38/lib/device/dev-type.c:900:17: branch_true: ...to here
LVM2.2.03.38/lib/device/dev-type.c:900:17: throw: if ‘print_log’ throws an exception...
LVM2.2.03.38/lib/device/dev-type.c:900:17: danger: ‘fopen(&path, "r")’ leaks here; was opened at [(9)](sarif:/runs/0/results/26/codeFlows/0/threadFlows/0/locations/8)
#  898|   
#  899|   	if (!fgets(buffer, sizeof(buffer), fp)) {
#  900|-> 		log_sys_error("fgets", path);
#  901|   		goto out;
#  902|   	}

Error: GCC_ANALYZER_WARNING (CWE-401): [#def249]
LVM2.2.03.38/lib/device/dev-type.c:900:17: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(&path, "r")’
LVM2.2.03.38/lib/device/dev-type.c:858:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/lib/device/dev-type.c:871:13: branch_false: ...to here
LVM2.2.03.38/lib/device/dev-type.c:871:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/lib/device/dev-type.c:876:21: branch_false: ...to here
LVM2.2.03.38/lib/device/dev-type.c:876:12: branch_false: following ‘false’ branch (when ‘size >= 0’)...
LVM2.2.03.38/lib/device/dev-type.c:881:9: branch_false: ...to here
LVM2.2.03.38/lib/device/dev-type.c:883:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/lib/device/dev-type.c:891:20: branch_false: ...to here
LVM2.2.03.38/lib/device/dev-type.c:891:20: acquire_memory: allocated here
LVM2.2.03.38/lib/device/dev-type.c:891:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/lib/device/dev-type.c:899:14: branch_false: ...to here
LVM2.2.03.38/lib/device/dev-type.c:899:12: branch_true: following ‘true’ branch...
LVM2.2.03.38/lib/device/dev-type.c:900:17: branch_true: ...to here
LVM2.2.03.38/lib/device/dev-type.c:900:17: throw: if ‘print_log’ throws an exception...
LVM2.2.03.38/lib/device/dev-type.c:900:17: danger: ‘fopen(&path, "r")’ leaks here; was allocated at [(9)](sarif:/runs/0/results/27/codeFlows/0/threadFlows/0/locations/8)
#  898|   
#  899|   	if (!fgets(buffer, sizeof(buffer), fp)) {
#  900|-> 		log_sys_error("fgets", path);
#  901|   		goto out;
#  902|   	}

Error: GCC_ANALYZER_WARNING (CWE-775): [#def250]
LVM2.2.03.38/lib/device/dev-type.c:905:17: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(&path, "r")’
LVM2.2.03.38/lib/device/dev-type.c:858:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/lib/device/dev-type.c:871:13: branch_false: ...to here
LVM2.2.03.38/lib/device/dev-type.c:871:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/lib/device/dev-type.c:876:21: branch_false: ...to here
LVM2.2.03.38/lib/device/dev-type.c:876:12: branch_false: following ‘false’ branch (when ‘size >= 0’)...
LVM2.2.03.38/lib/device/dev-type.c:881:9: branch_false: ...to here
LVM2.2.03.38/lib/device/dev-type.c:883:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/lib/device/dev-type.c:891:20: branch_false: ...to here
LVM2.2.03.38/lib/device/dev-type.c:891:20: acquire_resource: opened here
LVM2.2.03.38/lib/device/dev-type.c:891:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/lib/device/dev-type.c:899:14: branch_false: ...to here
LVM2.2.03.38/lib/device/dev-type.c:899:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/lib/device/dev-type.c:904:13: branch_false: ...to here
LVM2.2.03.38/lib/device/dev-type.c:904:12: branch_true: following ‘true’ branch...
LVM2.2.03.38/lib/device/dev-type.c:905:17: branch_true: ...to here
LVM2.2.03.38/lib/device/dev-type.c:905:17: throw: if ‘print_log’ throws an exception...
LVM2.2.03.38/lib/device/dev-type.c:905:17: danger: ‘fopen(&path, "r")’ leaks here; was opened at [(9)](sarif:/runs/0/results/28/codeFlows/0/threadFlows/0/locations/8)
#  903|   
#  904|   	if (sscanf(buffer, "%d:%d", &major, &minor) != 2) {
#  905|-> 		log_warn("WARNING: sysfs file %s not in expected MAJ:MIN format: %s",
#  906|   			  path, buffer);
#  907|   		goto out;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def251]
LVM2.2.03.38/lib/device/dev-type.c:905:17: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(&path, "r")’
LVM2.2.03.38/lib/device/dev-type.c:858:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/lib/device/dev-type.c:871:13: branch_false: ...to here
LVM2.2.03.38/lib/device/dev-type.c:871:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/lib/device/dev-type.c:876:21: branch_false: ...to here
LVM2.2.03.38/lib/device/dev-type.c:876:12: branch_false: following ‘false’ branch (when ‘size >= 0’)...
LVM2.2.03.38/lib/device/dev-type.c:881:9: branch_false: ...to here
LVM2.2.03.38/lib/device/dev-type.c:883:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/lib/device/dev-type.c:891:20: branch_false: ...to here
LVM2.2.03.38/lib/device/dev-type.c:891:20: acquire_memory: allocated here
LVM2.2.03.38/lib/device/dev-type.c:891:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/lib/device/dev-type.c:899:14: branch_false: ...to here
LVM2.2.03.38/lib/device/dev-type.c:899:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/lib/device/dev-type.c:904:13: branch_false: ...to here
LVM2.2.03.38/lib/device/dev-type.c:904:12: branch_true: following ‘true’ branch...
LVM2.2.03.38/lib/device/dev-type.c:905:17: branch_true: ...to here
LVM2.2.03.38/lib/device/dev-type.c:905:17: throw: if ‘print_log’ throws an exception...
LVM2.2.03.38/lib/device/dev-type.c:905:17: danger: ‘fopen(&path, "r")’ leaks here; was allocated at [(9)](sarif:/runs/0/results/29/codeFlows/0/threadFlows/0/locations/8)
#  903|   
#  904|   	if (sscanf(buffer, "%d:%d", &major, &minor) != 2) {
#  905|-> 		log_warn("WARNING: sysfs file %s not in expected MAJ:MIN format: %s",
#  906|   			  path, buffer);
#  907|   		goto out;

Error: GCC_ANALYZER_WARNING (CWE-775): [#def252]
LVM2.2.03.38/lib/device/dev-type.c:1388:17: warning[-Wanalyzer-file-leak]: leak of FILE ‘fp’
LVM2.2.03.38/lib/device/dev-type.c:1354:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/lib/device/dev-type.c:1357:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/lib/device/dev-type.c:1360:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/lib/device/dev-type.c:1368:20: branch_false: ...to here
LVM2.2.03.38/lib/device/dev-type.c:1368:20: acquire_resource: opened here
LVM2.2.03.38/lib/device/dev-type.c:1368:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/lib/device/dev-type.c:1387:14: branch_false: ...to here
LVM2.2.03.38/lib/device/dev-type.c:1387:12: branch_true: following ‘true’ branch...
LVM2.2.03.38/lib/device/dev-type.c:1388:17: branch_true: ...to here
LVM2.2.03.38/lib/device/dev-type.c:1388:17: throw: if ‘print_log’ throws an exception...
LVM2.2.03.38/lib/device/dev-type.c:1388:17: danger: ‘fp’ leaks here; was opened at [(7)](sarif:/runs/0/results/30/codeFlows/0/threadFlows/0/locations/6)
# 1386|   
# 1387|   	if (!fgets(buffer, sizeof(buffer), fp)) {
# 1388|-> 		log_sys_debug("fgets", path);
# 1389|   		goto out_close;
# 1390|   	}

Error: GCC_ANALYZER_WARNING (CWE-401): [#def253]
LVM2.2.03.38/lib/device/dev-type.c:1388:17: warning[-Wanalyzer-malloc-leak]: leak of ‘fp’
LVM2.2.03.38/lib/device/dev-type.c:1354:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/lib/device/dev-type.c:1357:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/lib/device/dev-type.c:1360:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/lib/device/dev-type.c:1368:20: branch_false: ...to here
LVM2.2.03.38/lib/device/dev-type.c:1368:20: acquire_memory: allocated here
LVM2.2.03.38/lib/device/dev-type.c:1368:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/lib/device/dev-type.c:1387:14: branch_false: ...to here
LVM2.2.03.38/lib/device/dev-type.c:1387:12: branch_true: following ‘true’ branch...
LVM2.2.03.38/lib/device/dev-type.c:1388:17: branch_true: ...to here
LVM2.2.03.38/lib/device/dev-type.c:1388:17: throw: if ‘print_log’ throws an exception...
LVM2.2.03.38/lib/device/dev-type.c:1388:17: danger: ‘fp’ leaks here; was allocated at [(7)](sarif:/runs/0/results/31/codeFlows/0/threadFlows/0/locations/6)
# 1386|   
# 1387|   	if (!fgets(buffer, sizeof(buffer), fp)) {
# 1388|-> 		log_sys_debug("fgets", path);
# 1389|   		goto out_close;
# 1390|   	}

Error: GCC_ANALYZER_WARNING (CWE-775): [#def254]
LVM2.2.03.38/lib/device/dev-type.c:1393:17: warning[-Wanalyzer-file-leak]: leak of FILE ‘fp’
LVM2.2.03.38/lib/device/dev-type.c:1354:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/lib/device/dev-type.c:1357:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/lib/device/dev-type.c:1360:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/lib/device/dev-type.c:1368:20: branch_false: ...to here
LVM2.2.03.38/lib/device/dev-type.c:1368:20: acquire_resource: opened here
LVM2.2.03.38/lib/device/dev-type.c:1368:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/lib/device/dev-type.c:1387:14: branch_false: ...to here
LVM2.2.03.38/lib/device/dev-type.c:1387:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/lib/device/dev-type.c:1392:13: branch_false: ...to here
LVM2.2.03.38/lib/device/dev-type.c:1392:12: branch_true: following ‘true’ branch...
LVM2.2.03.38/lib/device/dev-type.c:1393:17: branch_true: ...to here
LVM2.2.03.38/lib/device/dev-type.c:1393:17: throw: if ‘print_log’ throws an exception...
LVM2.2.03.38/lib/device/dev-type.c:1393:17: danger: ‘fp’ leaks here; was opened at [(7)](sarif:/runs/0/results/32/codeFlows/0/threadFlows/0/locations/6)
# 1391|   
# 1392|   	if (sscanf(buffer, "%lu", value) != 1) {
# 1393|-> 		log_warn("WARNING: sysfs file %s not in expected format: %s", path, buffer);
# 1394|   		goto out_close;
# 1395|   	}

Error: GCC_ANALYZER_WARNING (CWE-401): [#def255]
LVM2.2.03.38/lib/device/dev-type.c:1393:17: warning[-Wanalyzer-malloc-leak]: leak of ‘fp’
LVM2.2.03.38/lib/device/dev-type.c:1354:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/lib/device/dev-type.c:1357:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/lib/device/dev-type.c:1360:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/lib/device/dev-type.c:1368:20: branch_false: ...to here
LVM2.2.03.38/lib/device/dev-type.c:1368:20: acquire_memory: allocated here
LVM2.2.03.38/lib/device/dev-type.c:1368:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/lib/device/dev-type.c:1387:14: branch_false: ...to here
LVM2.2.03.38/lib/device/dev-type.c:1387:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/lib/device/dev-type.c:1392:13: branch_false: ...to here
LVM2.2.03.38/lib/device/dev-type.c:1392:12: branch_true: following ‘true’ branch...
LVM2.2.03.38/lib/device/dev-type.c:1393:17: branch_true: ...to here
LVM2.2.03.38/lib/device/dev-type.c:1393:17: throw: if ‘print_log’ throws an exception...
LVM2.2.03.38/lib/device/dev-type.c:1393:17: danger: ‘fp’ leaks here; was allocated at [(7)](sarif:/runs/0/results/33/codeFlows/0/threadFlows/0/locations/6)
# 1391|   
# 1392|   	if (sscanf(buffer, "%lu", value) != 1) {
# 1393|-> 		log_warn("WARNING: sysfs file %s not in expected format: %s", path, buffer);
# 1394|   		goto out_close;
# 1395|   	}

Error: GCC_ANALYZER_WARNING (CWE-401): [#def256]
LVM2.2.03.38/lib/device/filesystem.c:65:22: warning[-Wanalyzer-malloc-leak]: leak of ‘opendir(&holders_path)’
LVM2.2.03.38/lib/device/filesystem.c:50:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/lib/device/filesystem.c:57:20: branch_false: ...to here
LVM2.2.03.38/lib/device/filesystem.c:57:20: acquire_memory: allocated here
LVM2.2.03.38/lib/device/filesystem.c:57:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/lib/device/filesystem.c:57:12: branch_false: ...to here
LVM2.2.03.38/lib/device/filesystem.c:65:22: throw: if ‘readdir’ throws an exception...
LVM2.2.03.38/lib/device/filesystem.c:65:22: danger: ‘opendir(&holders_path)’ leaks here; was allocated at [(3)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/2)
#   63|   	}
#   64|   
#   65|-> 	while ((de = readdir(dr))) {
#   66|   		if (!strcmp(de->d_name, ".") || !strcmp(de->d_name, ".."))
#   67|   			continue;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def257]
LVM2.2.03.38/lib/device/filesystem.c:195:22: warning[-Wanalyzer-malloc-leak]: leak of ‘opendir(&devices_path)’
LVM2.2.03.38/lib/device/filesystem.c:174:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/lib/device/filesystem.c:181:20: branch_false: ...to here
LVM2.2.03.38/lib/device/filesystem.c:181:20: acquire_memory: allocated here
LVM2.2.03.38/lib/device/filesystem.c:181:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/lib/device/filesystem.c:181:12: branch_false: ...to here
LVM2.2.03.38/lib/device/filesystem.c:195:22: throw: if ‘readdir’ throws an exception...
LVM2.2.03.38/lib/device/filesystem.c:195:22: danger: ‘opendir(&devices_path)’ leaks here; was allocated at [(3)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/2)
#  193|   	 * So also call _fs_get_mnt for every devices to find a matched mount point.
#  194|   	 */
#  195|-> 	while ((de = readdir(dr))) {
#  196|   		if (!strcmp(de->d_name, ".") || !strcmp(de->d_name, ".."))
#  197|   			continue;

Error: GCC_ANALYZER_WARNING (CWE-775): [#def258]
LVM2.2.03.38/lib/device/filesystem.c:216:21: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘open(&rdev_path, 0)’
LVM2.2.03.38/lib/device/filesystem.c:174:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/lib/device/filesystem.c:181:20: branch_false: ...to here
LVM2.2.03.38/lib/device/filesystem.c:181:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/lib/device/filesystem.c:181:12: branch_false: ...to here
LVM2.2.03.38/lib/device/filesystem.c:195:16: branch_true: following ‘true’ branch...
LVM2.2.03.38/lib/device/filesystem.c:196:29: branch_true: ...to here
LVM2.2.03.38/lib/device/filesystem.c:201:20: branch_false: following ‘false’ branch...
LVM2.2.03.38/lib/device/filesystem.c:208:27: branch_false: ...to here
LVM2.2.03.38/lib/device/filesystem.c:208:27: acquire_resource: opened here
LVM2.2.03.38/lib/device/filesystem.c:208:20: branch_false: following ‘false’ branch...
LVM2.2.03.38/lib/device/filesystem.c:214:21: branch_false: ...to here
LVM2.2.03.38/lib/device/filesystem.c:216:21: danger: ‘open(&rdev_path, 0)’ leaks here; was opened at [(9)](sarif:/runs/0/results/2/codeFlows/0/threadFlows/0/locations/8)
#  214|   		r = read(fd, buffer, sizeof(buffer));
#  215|   
#  216|-> 		if (close(fd))
#  217|   			log_sys_debug("close", rdev_path);
#  218|   		fd = -1;

Error: GCC_ANALYZER_WARNING (CWE-775): [#def259]
LVM2.2.03.38/lib/device/filesystem.c:449:21: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen("/proc/mounts", "r")’
LVM2.2.03.38/lib/device/filesystem.c:380:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/lib/device/filesystem.c:395:21: branch_false: ...to here
LVM2.2.03.38/lib/device/filesystem.c:395:12: branch_false: following ‘false’ branch (when ‘fme’ is non-NULL)...
LVM2.2.03.38/lib/device/filesystem.c:395:12: branch_false: ...to here
LVM2.2.03.38/lib/device/filesystem.c:423:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/lib/device/filesystem.c:439:25: branch_false: ...to here
LVM2.2.03.38/lib/device/filesystem.c:439:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/lib/device/filesystem.c:442:14: branch_false: ...to here
LVM2.2.03.38/lib/device/filesystem.c:442:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/lib/device/filesystem.c:445:20: branch_false: ...to here
LVM2.2.03.38/lib/device/filesystem.c:445:20: acquire_resource: opened here
LVM2.2.03.38/lib/device/filesystem.c:445:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/lib/device/filesystem.c:445:12: branch_false: ...to here
LVM2.2.03.38/lib/device/filesystem.c:448:16: branch_true: following ‘true’ branch...
LVM2.2.03.38/lib/device/filesystem.c:449:21: branch_true: ...to here
LVM2.2.03.38/lib/device/filesystem.c:451:20: branch_false: following ‘false’ branch...
LVM2.2.03.38/lib/device/filesystem.c:456:21: branch_false: ...to here
LVM2.2.03.38/lib/device/filesystem.c:456:20: branch_false: following ‘false’ branch (when the strings are equal)...
LVM2.2.03.38/lib/device/filesystem.c:470:30: branch_false: ...to here
LVM2.2.03.38/lib/device/filesystem.c:484:20: branch_false: following ‘false’ branch...
LVM2.2.03.38/lib/device/filesystem.c:487:21: branch_false: ...to here
LVM2.2.03.38/lib/device/filesystem.c:487:20: branch_true: following ‘true’ branch...
LVM2.2.03.38/lib/device/filesystem.c:488:25: branch_true: ...to here
LVM2.2.03.38/lib/device/filesystem.c:488:25: throw: if ‘print_log’ throws an exception...
LVM2.2.03.38/lib/device/filesystem.c:449:21: danger: ‘fopen("/proc/mounts", "r")’ leaks here; was opened at [(12)](sarif:/runs/0/results/3/codeFlows/0/threadFlows/0/locations/11)
#  447|   
#  448|   	while (fgets(proc_line, sizeof(proc_line), fp)) {
#  449|-> 		if (proc_line[0] != '/')
#  450|   			continue;
#  451|   		if (sscanf(proc_line, "%"

Error: GCC_ANALYZER_WARNING (CWE-401): [#def260]
LVM2.2.03.38/lib/device/filesystem.c:449:21: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen("/proc/mounts", "r")’
LVM2.2.03.38/lib/device/filesystem.c:380:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/lib/device/filesystem.c:395:21: branch_false: ...to here
LVM2.2.03.38/lib/device/filesystem.c:395:12: branch_false: following ‘false’ branch (when ‘fme’ is non-NULL)...
LVM2.2.03.38/lib/device/filesystem.c:395:12: branch_false: ...to here
LVM2.2.03.38/lib/device/filesystem.c:423:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/lib/device/filesystem.c:439:25: branch_false: ...to here
LVM2.2.03.38/lib/device/filesystem.c:439:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/lib/device/filesystem.c:442:14: branch_false: ...to here
LVM2.2.03.38/lib/device/filesystem.c:442:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/lib/device/filesystem.c:445:20: branch_false: ...to here
LVM2.2.03.38/lib/device/filesystem.c:445:20: acquire_memory: allocated here
LVM2.2.03.38/lib/device/filesystem.c:445:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/lib/device/filesystem.c:445:12: branch_false: ...to here
LVM2.2.03.38/lib/device/filesystem.c:448:16: branch_true: following ‘true’ branch...
LVM2.2.03.38/lib/device/filesystem.c:449:21: branch_true: ...to here
LVM2.2.03.38/lib/device/filesystem.c:451:20: branch_false: following ‘false’ branch...
LVM2.2.03.38/lib/device/filesystem.c:456:21: branch_false: ...to here
LVM2.2.03.38/lib/device/filesystem.c:456:20: branch_false: following ‘false’ branch (when the strings are equal)...
LVM2.2.03.38/lib/device/filesystem.c:470:30: branch_false: ...to here
LVM2.2.03.38/lib/device/filesystem.c:484:20: branch_false: following ‘false’ branch...
LVM2.2.03.38/lib/device/filesystem.c:487:21: branch_false: ...to here
LVM2.2.03.38/lib/device/filesystem.c:487:20: branch_true: following ‘true’ branch...
LVM2.2.03.38/lib/device/filesystem.c:488:25: branch_true: ...to here
LVM2.2.03.38/lib/device/filesystem.c:488:25: throw: if ‘print_log’ throws an exception...
LVM2.2.03.38/lib/device/filesystem.c:449:21: danger: ‘fopen("/proc/mounts", "r")’ leaks here; was allocated at [(12)](sarif:/runs/0/results/4/codeFlows/0/threadFlows/0/locations/11)
#  447|   
#  448|   	while (fgets(proc_line, sizeof(proc_line), fp)) {
#  449|-> 		if (proc_line[0] != '/')
#  450|   			continue;
#  451|   		if (sscanf(proc_line, "%"

Error: GCC_ANALYZER_WARNING (CWE-775): [#def261]
LVM2.2.03.38/lib/device/nvme.c:187:13: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘open(dev_name(dev), 0)’
LVM2.2.03.38/lib/device/nvme.c:177:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/lib/device/nvme.c:180:19: branch_false: ...to here
LVM2.2.03.38/lib/device/nvme.c:182:19: acquire_resource: opened here
LVM2.2.03.38/lib/device/nvme.c:182:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/lib/device/nvme.c:187:13: branch_false: ...to here
LVM2.2.03.38/lib/device/nvme.c:187:13: throw: if ‘nvme_get_nsid’ throws an exception...
LVM2.2.03.38/lib/device/nvme.c:187:13: danger: ‘open(dev_name(dev), 0)’ leaks here; was opened at [(3)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/2)
#  185|   	}
#  186|   
#  187|-> 	if (nvme_get_nsid(fd, &nsid)) {
#  188|   		log_debug("dev_read_nvme_wwids nvme_get_nsid error %d %s", errno, devpath);
#  189|   		goto out;

Error: GCC_ANALYZER_WARNING (CWE-775): [#def262]
LVM2.2.03.38/lib/device/nvme.c:318:13: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘open(dev_name(dev), 0)’
LVM2.2.03.38/lib/device/nvme.c:313:19: acquire_resource: opened here
LVM2.2.03.38/lib/device/nvme.c:313:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/lib/device/nvme.c:318:13: branch_false: ...to here
LVM2.2.03.38/lib/device/nvme.c:318:13: throw: if ‘nvme_get_nsid’ throws an exception...
LVM2.2.03.38/lib/device/nvme.c:318:13: danger: ‘open(dev_name(dev), 0)’ leaks here; was opened at [(1)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/0)
#  316|   	}
#  317|   
#  318|-> 	if (nvme_get_nsid(fd, &nsid)) {
#  319|   		log_error("dev_read_reservation %s nvme_get_nsid error %d", devname, errno);
#  320|   		goto out;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def263]
LVM2.2.03.38/lib/device/nvme.c:335:20: warning[-Wanalyzer-malloc-leak]: leak of ‘status’
LVM2.2.03.38/lib/device/nvme.c:313:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/lib/device/nvme.c:318:13: branch_false: ...to here
LVM2.2.03.38/lib/device/nvme.c:318:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/lib/device/nvme.c:323:24: branch_false: ...to here
LVM2.2.03.38/lib/device/nvme.c:323:24: acquire_memory: allocated here
LVM2.2.03.38/lib/device/nvme.c:323:12: branch_false: following ‘false’ branch (when ‘status’ is non-NULL)...
LVM2.2.03.38/lib/device/nvme.c:326:9: branch_false: ...to here
LVM2.2.03.38/lib/device/nvme.c:335:20: throw: if ‘nvme_resv_report’ throws an exception...
LVM2.2.03.38/lib/device/nvme.c:335:20: danger: ‘status’ leaks here; was allocated at [(5)](sarif:/runs/0/results/2/codeFlows/0/threadFlows/0/locations/4)
#  333|   	args.result = NULL;
#  334|   
#  335|-> 	if ((err = nvme_resv_report(&args))) {
#  336|   		log_error("dev_read_reservation %s error %d", devname, err);
#  337|   		goto out;

Error: GCC_ANALYZER_WARNING (CWE-775): [#def264]
LVM2.2.03.38/lib/device/nvme.c:402:13: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘open(dev_name(dev), 0)’
LVM2.2.03.38/lib/device/nvme.c:397:19: acquire_resource: opened here
LVM2.2.03.38/lib/device/nvme.c:397:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/lib/device/nvme.c:402:13: branch_false: ...to here
LVM2.2.03.38/lib/device/nvme.c:402:13: throw: if ‘nvme_get_nsid’ throws an exception...
LVM2.2.03.38/lib/device/nvme.c:402:13: danger: ‘open(dev_name(dev), 0)’ leaks here; was opened at [(1)](sarif:/runs/0/results/3/codeFlows/0/threadFlows/0/locations/0)
#  400|   	}
#  401|   
#  402|-> 	if (nvme_get_nsid(fd, &nsid)) {
#  403|   		if (may_fail)
#  404|   			log_debug("dev_find_key_nvme %s nvme_get_nsid error %d", devname, errno);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def265]
LVM2.2.03.38/lib/device/nvme.c:422:20: warning[-Wanalyzer-malloc-leak]: leak of ‘status’
LVM2.2.03.38/lib/device/nvme.c:397:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/lib/device/nvme.c:402:13: branch_false: ...to here
LVM2.2.03.38/lib/device/nvme.c:402:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/lib/device/nvme.c:410:24: branch_false: ...to here
LVM2.2.03.38/lib/device/nvme.c:410:24: acquire_memory: allocated here
LVM2.2.03.38/lib/device/nvme.c:410:12: branch_false: following ‘false’ branch (when ‘status’ is non-NULL)...
LVM2.2.03.38/lib/device/nvme.c:413:9: branch_false: ...to here
LVM2.2.03.38/lib/device/nvme.c:422:20: throw: if ‘nvme_resv_report’ throws an exception...
LVM2.2.03.38/lib/device/nvme.c:422:20: danger: ‘status’ leaks here; was allocated at [(5)](sarif:/runs/0/results/4/codeFlows/0/threadFlows/0/locations/4)
#  420|   	args.result = NULL;
#  421|   
#  422|-> 	if ((err = nvme_resv_report(&args))) {
#  423|   		if (may_fail)
#  424|   			log_debug("dev_find_key_nvme %s error %d", devname, err);

Error: GCC_ANALYZER_WARNING (CWE-775): [#def266]
LVM2.2.03.38/lib/device/online.c:68:14: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(&lookup_path, "r")’
LVM2.2.03.38/lib/device/online.c:384:5: enter_function: entry to ‘get_pvs_lookup’
LVM2.2.03.38/lib/device/online.c:396:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/lib/device/online.c:399:20: branch_false: ...to here
LVM2.2.03.38/lib/device/online.c:399:20: acquire_resource: opened here
LVM2.2.03.38/lib/device/online.c:399:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/lib/device/online.c:399:12: branch_false: ...to here
LVM2.2.03.38/lib/device/online.c:402:16: branch_true: following ‘true’ branch...
LVM2.2.03.38/lib/device/online.c:403:17: branch_true: ...to here
LVM2.2.03.38/lib/device/online.c:404:20: branch_false: following ‘false’ branch...
LVM2.2.03.38/lib/device/online.c:407:17: branch_false: ...to here
LVM2.2.03.38/lib/device/online.c:414:22: call_function: calling ‘online_pvid_file_read’ from ‘get_pvs_lookup’
#   66|   	int fd, rv;
#   67|   
#   68|-> 	fd = open(path, O_RDONLY);
#   69|   	if (fd < 0) {
#   70|   		log_warn("WARNING: Failed to open %s.", path);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def267]
LVM2.2.03.38/lib/device/online.c:68:14: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(&lookup_path, "r")’
LVM2.2.03.38/lib/device/online.c:384:5: enter_function: entry to ‘get_pvs_lookup’
LVM2.2.03.38/lib/device/online.c:396:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/lib/device/online.c:399:20: branch_false: ...to here
LVM2.2.03.38/lib/device/online.c:399:20: acquire_memory: allocated here
LVM2.2.03.38/lib/device/online.c:399:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/lib/device/online.c:399:12: branch_false: ...to here
LVM2.2.03.38/lib/device/online.c:402:16: branch_true: following ‘true’ branch...
LVM2.2.03.38/lib/device/online.c:403:17: branch_true: ...to here
LVM2.2.03.38/lib/device/online.c:404:20: branch_false: following ‘false’ branch...
LVM2.2.03.38/lib/device/online.c:407:17: branch_false: ...to here
LVM2.2.03.38/lib/device/online.c:414:22: call_function: calling ‘online_pvid_file_read’ from ‘get_pvs_lookup’
#   66|   	int fd, rv;
#   67|   
#   68|-> 	fd = open(path, O_RDONLY);
#   69|   	if (fd < 0) {
#   70|   		log_warn("WARNING: Failed to open %s.", path);

Error: GCC_ANALYZER_WARNING (CWE-775): [#def268]
LVM2.2.03.38/lib/device/online.c:70:17: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(&lookup_path, "r")’
LVM2.2.03.38/lib/device/online.c:384:5: enter_function: entry to ‘get_pvs_lookup’
LVM2.2.03.38/lib/device/online.c:396:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/lib/device/online.c:399:20: branch_false: ...to here
LVM2.2.03.38/lib/device/online.c:399:20: acquire_resource: opened here
LVM2.2.03.38/lib/device/online.c:399:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/lib/device/online.c:399:12: branch_false: ...to here
LVM2.2.03.38/lib/device/online.c:402:16: branch_true: following ‘true’ branch...
LVM2.2.03.38/lib/device/online.c:403:17: branch_true: ...to here
LVM2.2.03.38/lib/device/online.c:404:20: branch_false: following ‘false’ branch...
LVM2.2.03.38/lib/device/online.c:407:17: branch_false: ...to here
LVM2.2.03.38/lib/device/online.c:414:22: call_function: calling ‘online_pvid_file_read’ from ‘get_pvs_lookup’
#   68|   	fd = open(path, O_RDONLY);
#   69|   	if (fd < 0) {
#   70|-> 		log_warn("WARNING: Failed to open %s.", path);
#   71|   		return 0;
#   72|   	}

Error: GCC_ANALYZER_WARNING (CWE-401): [#def269]
LVM2.2.03.38/lib/device/online.c:70:17: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(&lookup_path, "r")’
LVM2.2.03.38/lib/device/online.c:384:5: enter_function: entry to ‘get_pvs_lookup’
LVM2.2.03.38/lib/device/online.c:396:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/lib/device/online.c:399:20: branch_false: ...to here
LVM2.2.03.38/lib/device/online.c:399:20: acquire_memory: allocated here
LVM2.2.03.38/lib/device/online.c:399:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/lib/device/online.c:399:12: branch_false: ...to here
LVM2.2.03.38/lib/device/online.c:402:16: branch_true: following ‘true’ branch...
LVM2.2.03.38/lib/device/online.c:403:17: branch_true: ...to here
LVM2.2.03.38/lib/device/online.c:404:20: branch_false: following ‘false’ branch...
LVM2.2.03.38/lib/device/online.c:407:17: branch_false: ...to here
LVM2.2.03.38/lib/device/online.c:414:22: call_function: calling ‘online_pvid_file_read’ from ‘get_pvs_lookup’
#   68|   	fd = open(path, O_RDONLY);
#   69|   	if (fd < 0) {
#   70|-> 		log_warn("WARNING: Failed to open %s.", path);
#   71|   		return 0;
#   72|   	}

Error: GCC_ANALYZER_WARNING (CWE-775): [#def270]
LVM2.2.03.38/lib/device/online.c:75:13: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘open(path, 0)’
LVM2.2.03.38/lib/device/online.c:68:14: acquire_resource: opened here
LVM2.2.03.38/lib/device/online.c:69:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/lib/device/online.c:74:14: branch_false: ...to here
LVM2.2.03.38/lib/device/online.c:75:13: danger: ‘open(path, 0)’ leaks here; was opened at [(1)](sarif:/runs/0/results/4/codeFlows/0/threadFlows/0/locations/0)
#   73|   
#   74|   	rv = read(fd, buf, sizeof(buf) - 1);
#   75|-> 	if (close(fd))
#   76|   		log_sys_debug("close", path);
#   77|   	if (!rv || rv < 0) {

Error: GCC_ANALYZER_WARNING (CWE-775): [#def271]
LVM2.2.03.38/lib/device/online.c:75:13: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(&lookup_path, "r")’
LVM2.2.03.38/lib/device/online.c:384:5: enter_function: entry to ‘get_pvs_lookup’
LVM2.2.03.38/lib/device/online.c:396:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/lib/device/online.c:399:20: branch_false: ...to here
LVM2.2.03.38/lib/device/online.c:399:20: acquire_resource: opened here
LVM2.2.03.38/lib/device/online.c:399:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/lib/device/online.c:399:12: branch_false: ...to here
LVM2.2.03.38/lib/device/online.c:402:16: branch_true: following ‘true’ branch...
LVM2.2.03.38/lib/device/online.c:403:17: branch_true: ...to here
LVM2.2.03.38/lib/device/online.c:404:20: branch_false: following ‘false’ branch...
LVM2.2.03.38/lib/device/online.c:407:17: branch_false: ...to here
LVM2.2.03.38/lib/device/online.c:414:22: call_function: calling ‘online_pvid_file_read’ from ‘get_pvs_lookup’
#   73|   
#   74|   	rv = read(fd, buf, sizeof(buf) - 1);
#   75|-> 	if (close(fd))
#   76|   		log_sys_debug("close", path);
#   77|   	if (!rv || rv < 0) {

Error: GCC_ANALYZER_WARNING (CWE-401): [#def272]
LVM2.2.03.38/lib/device/online.c:75:13: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(&lookup_path, "r")’
LVM2.2.03.38/lib/device/online.c:384:5: enter_function: entry to ‘get_pvs_lookup’
LVM2.2.03.38/lib/device/online.c:396:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/lib/device/online.c:399:20: branch_false: ...to here
LVM2.2.03.38/lib/device/online.c:399:20: acquire_memory: allocated here
LVM2.2.03.38/lib/device/online.c:399:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/lib/device/online.c:399:12: branch_false: ...to here
LVM2.2.03.38/lib/device/online.c:402:16: branch_true: following ‘true’ branch...
LVM2.2.03.38/lib/device/online.c:403:17: branch_true: ...to here
LVM2.2.03.38/lib/device/online.c:404:20: branch_false: following ‘false’ branch...
LVM2.2.03.38/lib/device/online.c:407:17: branch_false: ...to here
LVM2.2.03.38/lib/device/online.c:414:22: call_function: calling ‘online_pvid_file_read’ from ‘get_pvs_lookup’
#   73|   
#   74|   	rv = read(fd, buf, sizeof(buf) - 1);
#   75|-> 	if (close(fd))
#   76|   		log_sys_debug("close", path);
#   77|   	if (!rv || rv < 0) {

Error: GCC_ANALYZER_WARNING (CWE-775): [#def273]
LVM2.2.03.38/lib/device/online.c:76:17: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(&lookup_path, "r")’
LVM2.2.03.38/lib/device/online.c:384:5: enter_function: entry to ‘get_pvs_lookup’
LVM2.2.03.38/lib/device/online.c:396:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/lib/device/online.c:399:20: branch_false: ...to here
LVM2.2.03.38/lib/device/online.c:399:20: acquire_resource: opened here
LVM2.2.03.38/lib/device/online.c:399:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/lib/device/online.c:399:12: branch_false: ...to here
LVM2.2.03.38/lib/device/online.c:402:16: branch_true: following ‘true’ branch...
LVM2.2.03.38/lib/device/online.c:403:17: branch_true: ...to here
LVM2.2.03.38/lib/device/online.c:404:20: branch_false: following ‘false’ branch...
LVM2.2.03.38/lib/device/online.c:407:17: branch_false: ...to here
LVM2.2.03.38/lib/device/online.c:414:22: call_function: calling ‘online_pvid_file_read’ from ‘get_pvs_lookup’
#   74|   	rv = read(fd, buf, sizeof(buf) - 1);
#   75|   	if (close(fd))
#   76|-> 		log_sys_debug("close", path);
#   77|   	if (!rv || rv < 0) {
#   78|   		log_warn("WARNING: No info in %s.", path);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def274]
LVM2.2.03.38/lib/device/online.c:76:17: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(&lookup_path, "r")’
LVM2.2.03.38/lib/device/online.c:384:5: enter_function: entry to ‘get_pvs_lookup’
LVM2.2.03.38/lib/device/online.c:396:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/lib/device/online.c:399:20: branch_false: ...to here
LVM2.2.03.38/lib/device/online.c:399:20: acquire_memory: allocated here
LVM2.2.03.38/lib/device/online.c:399:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/lib/device/online.c:399:12: branch_false: ...to here
LVM2.2.03.38/lib/device/online.c:402:16: branch_true: following ‘true’ branch...
LVM2.2.03.38/lib/device/online.c:403:17: branch_true: ...to here
LVM2.2.03.38/lib/device/online.c:404:20: branch_false: following ‘false’ branch...
LVM2.2.03.38/lib/device/online.c:407:17: branch_false: ...to here
LVM2.2.03.38/lib/device/online.c:414:22: call_function: calling ‘online_pvid_file_read’ from ‘get_pvs_lookup’
#   74|   	rv = read(fd, buf, sizeof(buf) - 1);
#   75|   	if (close(fd))
#   76|-> 		log_sys_debug("close", path);
#   77|   	if (!rv || rv < 0) {
#   78|   		log_warn("WARNING: No info in %s.", path);

Error: GCC_ANALYZER_WARNING (CWE-775): [#def275]
LVM2.2.03.38/lib/device/online.c:78:17: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(&lookup_path, "r")’
LVM2.2.03.38/lib/device/online.c:384:5: enter_function: entry to ‘get_pvs_lookup’
LVM2.2.03.38/lib/device/online.c:396:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/lib/device/online.c:399:20: branch_false: ...to here
LVM2.2.03.38/lib/device/online.c:399:20: acquire_resource: opened here
LVM2.2.03.38/lib/device/online.c:399:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/lib/device/online.c:399:12: branch_false: ...to here
LVM2.2.03.38/lib/device/online.c:402:16: branch_true: following ‘true’ branch...
LVM2.2.03.38/lib/device/online.c:403:17: branch_true: ...to here
LVM2.2.03.38/lib/device/online.c:404:20: branch_false: following ‘false’ branch...
LVM2.2.03.38/lib/device/online.c:407:17: branch_false: ...to here
LVM2.2.03.38/lib/device/online.c:414:22: call_function: calling ‘online_pvid_file_read’ from ‘get_pvs_lookup’
#   76|   		log_sys_debug("close", path);
#   77|   	if (!rv || rv < 0) {
#   78|-> 		log_warn("WARNING: No info in %s.", path);
#   79|   		return 0;
#   80|   	}

Error: GCC_ANALYZER_WARNING (CWE-401): [#def276]
LVM2.2.03.38/lib/device/online.c:78:17: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(&lookup_path, "r")’
LVM2.2.03.38/lib/device/online.c:384:5: enter_function: entry to ‘get_pvs_lookup’
LVM2.2.03.38/lib/device/online.c:396:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/lib/device/online.c:399:20: branch_false: ...to here
LVM2.2.03.38/lib/device/online.c:399:20: acquire_memory: allocated here
LVM2.2.03.38/lib/device/online.c:399:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/lib/device/online.c:399:12: branch_false: ...to here
LVM2.2.03.38/lib/device/online.c:402:16: branch_true: following ‘true’ branch...
LVM2.2.03.38/lib/device/online.c:403:17: branch_true: ...to here
LVM2.2.03.38/lib/device/online.c:404:20: branch_false: following ‘false’ branch...
LVM2.2.03.38/lib/device/online.c:407:17: branch_false: ...to here
LVM2.2.03.38/lib/device/online.c:414:22: call_function: calling ‘online_pvid_file_read’ from ‘get_pvs_lookup’
#   76|   		log_sys_debug("close", path);
#   77|   	if (!rv || rv < 0) {
#   78|-> 		log_warn("WARNING: No info in %s.", path);
#   79|   		return 0;
#   80|   	}

Error: GCC_ANALYZER_WARNING (CWE-775): [#def277]
LVM2.2.03.38/lib/device/online.c:84:17: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(&lookup_path, "r")’
LVM2.2.03.38/lib/device/online.c:384:5: enter_function: entry to ‘get_pvs_lookup’
LVM2.2.03.38/lib/device/online.c:396:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/lib/device/online.c:399:20: branch_false: ...to here
LVM2.2.03.38/lib/device/online.c:399:20: acquire_resource: opened here
LVM2.2.03.38/lib/device/online.c:399:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/lib/device/online.c:399:12: branch_false: ...to here
LVM2.2.03.38/lib/device/online.c:402:16: branch_true: following ‘true’ branch...
LVM2.2.03.38/lib/device/online.c:403:17: branch_true: ...to here
LVM2.2.03.38/lib/device/online.c:404:20: branch_false: following ‘false’ branch...
LVM2.2.03.38/lib/device/online.c:407:17: branch_false: ...to here
LVM2.2.03.38/lib/device/online.c:414:22: call_function: calling ‘online_pvid_file_read’ from ‘get_pvs_lookup’
#   82|   
#   83|   	if (sscanf(buf, "%u:%u", major, minor) != 2) {
#   84|-> 		log_warn("WARNING: No device numbers in %s.", path);
#   85|   		return 0;
#   86|   	}

Error: GCC_ANALYZER_WARNING (CWE-401): [#def278]
LVM2.2.03.38/lib/device/online.c:84:17: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(&lookup_path, "r")’
LVM2.2.03.38/lib/device/online.c:384:5: enter_function: entry to ‘get_pvs_lookup’
LVM2.2.03.38/lib/device/online.c:396:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/lib/device/online.c:399:20: branch_false: ...to here
LVM2.2.03.38/lib/device/online.c:399:20: acquire_memory: allocated here
LVM2.2.03.38/lib/device/online.c:399:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/lib/device/online.c:399:12: branch_false: ...to here
LVM2.2.03.38/lib/device/online.c:402:16: branch_true: following ‘true’ branch...
LVM2.2.03.38/lib/device/online.c:403:17: branch_true: ...to here
LVM2.2.03.38/lib/device/online.c:404:20: branch_false: following ‘false’ branch...
LVM2.2.03.38/lib/device/online.c:407:17: branch_false: ...to here
LVM2.2.03.38/lib/device/online.c:414:22: call_function: calling ‘online_pvid_file_read’ from ‘get_pvs_lookup’
#   82|   
#   83|   	if (sscanf(buf, "%u:%u", major, minor) != 2) {
#   84|-> 		log_warn("WARNING: No device numbers in %s.", path);
#   85|   		return 0;
#   86|   	}

Error: GCC_ANALYZER_WARNING (CWE-775): [#def279]
LVM2.2.03.38/lib/device/online.c:90:25: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(&lookup_path, "r")’
LVM2.2.03.38/lib/device/online.c:384:5: enter_function: entry to ‘get_pvs_lookup’
LVM2.2.03.38/lib/device/online.c:396:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/lib/device/online.c:399:20: branch_false: ...to here
LVM2.2.03.38/lib/device/online.c:399:20: acquire_resource: opened here
LVM2.2.03.38/lib/device/online.c:399:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/lib/device/online.c:399:12: branch_false: ...to here
LVM2.2.03.38/lib/device/online.c:402:16: branch_true: following ‘true’ branch...
LVM2.2.03.38/lib/device/online.c:403:17: branch_true: ...to here
LVM2.2.03.38/lib/device/online.c:404:20: branch_false: following ‘false’ branch...
LVM2.2.03.38/lib/device/online.c:407:17: branch_false: ...to here
LVM2.2.03.38/lib/device/online.c:414:22: call_function: calling ‘online_pvid_file_read’ from ‘get_pvs_lookup’
#   88|   	if (vgname) {
#   89|   		if (!strstr(buf, "vg:")) {
#   90|-> 			log_debug("No vgname in %s", path);
#   91|   			vgname[0] = '\0';
#   92|   			goto copy_dev;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def280]
LVM2.2.03.38/lib/device/online.c:90:25: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(&lookup_path, "r")’
LVM2.2.03.38/lib/device/online.c:384:5: enter_function: entry to ‘get_pvs_lookup’
LVM2.2.03.38/lib/device/online.c:396:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/lib/device/online.c:399:20: branch_false: ...to here
LVM2.2.03.38/lib/device/online.c:399:20: acquire_memory: allocated here
LVM2.2.03.38/lib/device/online.c:399:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/lib/device/online.c:399:12: branch_false: ...to here
LVM2.2.03.38/lib/device/online.c:402:16: branch_true: following ‘true’ branch...
LVM2.2.03.38/lib/device/online.c:403:17: branch_true: ...to here
LVM2.2.03.38/lib/device/online.c:404:20: branch_false: following ‘false’ branch...
LVM2.2.03.38/lib/device/online.c:407:17: branch_false: ...to here
LVM2.2.03.38/lib/device/online.c:414:22: call_function: calling ‘online_pvid_file_read’ from ‘get_pvs_lookup’
#   88|   	if (vgname) {
#   89|   		if (!strstr(buf, "vg:")) {
#   90|-> 			log_debug("No vgname in %s", path);
#   91|   			vgname[0] = '\0';
#   92|   			goto copy_dev;

Error: GCC_ANALYZER_WARNING (CWE-775): [#def281]
LVM2.2.03.38/lib/device/online.c:96:25: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(&lookup_path, "r")’
LVM2.2.03.38/lib/device/online.c:384:5: enter_function: entry to ‘get_pvs_lookup’
LVM2.2.03.38/lib/device/online.c:396:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/lib/device/online.c:399:20: branch_false: ...to here
LVM2.2.03.38/lib/device/online.c:399:20: acquire_resource: opened here
LVM2.2.03.38/lib/device/online.c:399:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/lib/device/online.c:399:12: branch_false: ...to here
LVM2.2.03.38/lib/device/online.c:402:16: branch_true: following ‘true’ branch...
LVM2.2.03.38/lib/device/online.c:403:17: branch_true: ...to here
LVM2.2.03.38/lib/device/online.c:404:20: branch_false: following ‘false’ branch...
LVM2.2.03.38/lib/device/online.c:407:17: branch_false: ...to here
LVM2.2.03.38/lib/device/online.c:414:22: call_function: calling ‘online_pvid_file_read’ from ‘get_pvs_lookup’
#   94|   
#   95|   		if (!_copy_pvid_file_field("vg:", buf, MAX_PVID_FILE_SIZE, vgname, NAME_LEN)) {
#   96|-> 			log_warn("WARNING: Ignoring invalid vg field in %s.", path);
#   97|   			vgname[0] = '\0';
#   98|   			goto copy_dev;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def282]
LVM2.2.03.38/lib/device/online.c:96:25: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(&lookup_path, "r")’
LVM2.2.03.38/lib/device/online.c:384:5: enter_function: entry to ‘get_pvs_lookup’
LVM2.2.03.38/lib/device/online.c:396:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/lib/device/online.c:399:20: branch_false: ...to here
LVM2.2.03.38/lib/device/online.c:399:20: acquire_memory: allocated here
LVM2.2.03.38/lib/device/online.c:399:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/lib/device/online.c:399:12: branch_false: ...to here
LVM2.2.03.38/lib/device/online.c:402:16: branch_true: following ‘true’ branch...
LVM2.2.03.38/lib/device/online.c:403:17: branch_true: ...to here
LVM2.2.03.38/lib/device/online.c:404:20: branch_false: following ‘false’ branch...
LVM2.2.03.38/lib/device/online.c:407:17: branch_false: ...to here
LVM2.2.03.38/lib/device/online.c:414:22: call_function: calling ‘online_pvid_file_read’ from ‘get_pvs_lookup’
#   94|   
#   95|   		if (!_copy_pvid_file_field("vg:", buf, MAX_PVID_FILE_SIZE, vgname, NAME_LEN)) {
#   96|-> 			log_warn("WARNING: Ignoring invalid vg field in %s.", path);
#   97|   			vgname[0] = '\0';
#   98|   			goto copy_dev;

Error: GCC_ANALYZER_WARNING (CWE-775): [#def283]
LVM2.2.03.38/lib/device/online.c:136:9: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(&lookup_path, "r")’
LVM2.2.03.38/lib/device/online.c:384:5: enter_function: entry to ‘get_pvs_lookup’
LVM2.2.03.38/lib/device/online.c:396:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/lib/device/online.c:399:20: branch_false: ...to here
LVM2.2.03.38/lib/device/online.c:399:20: acquire_resource: opened here
LVM2.2.03.38/lib/device/online.c:399:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/lib/device/online.c:399:12: branch_false: ...to here
LVM2.2.03.38/lib/device/online.c:402:16: branch_true: following ‘true’ branch...
LVM2.2.03.38/lib/device/online.c:403:17: branch_true: ...to here
LVM2.2.03.38/lib/device/online.c:404:20: branch_true: following ‘true’ branch...
LVM2.2.03.38/lib/device/online.c:405:25: branch_true: ...to here
LVM2.2.03.38/lib/device/online.c:452:9: call_function: calling ‘free_po_list’ from ‘get_pvs_lookup’
#  134|   	struct pv_online *po, *po2;
#  135|   
#  136|-> 	dm_list_iterate_items_safe(po, po2, list) {
#  137|   		dm_list_del(&po->list);
#  138|   		free(po);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def284]
LVM2.2.03.38/lib/device/online.c:136:9: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(&lookup_path, "r")’
LVM2.2.03.38/lib/device/online.c:384:5: enter_function: entry to ‘get_pvs_lookup’
LVM2.2.03.38/lib/device/online.c:396:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/lib/device/online.c:399:20: branch_false: ...to here
LVM2.2.03.38/lib/device/online.c:399:20: acquire_memory: allocated here
LVM2.2.03.38/lib/device/online.c:399:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/lib/device/online.c:399:12: branch_false: ...to here
LVM2.2.03.38/lib/device/online.c:402:16: branch_true: following ‘true’ branch...
LVM2.2.03.38/lib/device/online.c:403:17: branch_true: ...to here
LVM2.2.03.38/lib/device/online.c:404:20: branch_true: following ‘true’ branch...
LVM2.2.03.38/lib/device/online.c:405:25: branch_true: ...to here
LVM2.2.03.38/lib/device/online.c:452:9: call_function: calling ‘free_po_list’ from ‘get_pvs_lookup’
#  134|   	struct pv_online *po, *po2;
#  135|   
#  136|-> 	dm_list_iterate_items_safe(po, po2, list) {
#  137|   		dm_list_del(&po->list);
#  138|   		free(po);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def285]
LVM2.2.03.38/lib/device/online.c:157:22: warning[-Wanalyzer-malloc-leak]: leak of ‘opendir("/run/lvm/pvs_online")’
LVM2.2.03.38/lib/device/online.c:154:21: acquire_memory: allocated here
LVM2.2.03.38/lib/device/online.c:154:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/lib/device/online.c:154:12: branch_false: ...to here
LVM2.2.03.38/lib/device/online.c:157:22: throw: if ‘readdir’ throws an exception...
LVM2.2.03.38/lib/device/online.c:157:22: danger: ‘opendir("/run/lvm/pvs_online")’ leaks here; was allocated at [(1)](sarif:/runs/0/results/21/codeFlows/0/threadFlows/0/locations/0)
#  155|   		return 0;
#  156|   
#  157|-> 	while ((de = readdir(dir))) {
#  158|   		if (de->d_name[0] == '.')
#  159|   			continue;

Error: GCC_ANALYZER_WARNING (CWE-775): [#def286]
LVM2.2.03.38/lib/device/online.c:405:25: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(&lookup_path, "r")’
LVM2.2.03.38/lib/device/online.c:396:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/lib/device/online.c:399:20: branch_false: ...to here
LVM2.2.03.38/lib/device/online.c:399:20: acquire_resource: opened here
LVM2.2.03.38/lib/device/online.c:399:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/lib/device/online.c:399:12: branch_false: ...to here
LVM2.2.03.38/lib/device/online.c:402:16: branch_true: following ‘true’ branch...
LVM2.2.03.38/lib/device/online.c:403:17: branch_true: ...to here
LVM2.2.03.38/lib/device/online.c:404:20: branch_true: following ‘true’ branch...
LVM2.2.03.38/lib/device/online.c:405:25: branch_true: ...to here
LVM2.2.03.38/lib/device/online.c:405:25: throw: if ‘print_log’ throws an exception...
LVM2.2.03.38/lib/device/online.c:405:25: danger: ‘fopen(&lookup_path, "r")’ leaks here; was opened at [(3)](sarif:/runs/0/results/22/codeFlows/0/threadFlows/0/locations/2)
#  403|   		memcpy(pvid, line, ID_LEN);
#  404|   		if (strlen(pvid) != ID_LEN)
#  405|-> 			goto_bad;
#  406|   
#  407|   		snprintf(path, sizeof(path), "%s/%s", PVS_ONLINE_DIR, pvid);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def287]
LVM2.2.03.38/lib/device/online.c:405:25: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(&lookup_path, "r")’
LVM2.2.03.38/lib/device/online.c:396:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/lib/device/online.c:399:20: branch_false: ...to here
LVM2.2.03.38/lib/device/online.c:399:20: acquire_memory: allocated here
LVM2.2.03.38/lib/device/online.c:399:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/lib/device/online.c:399:12: branch_false: ...to here
LVM2.2.03.38/lib/device/online.c:402:16: branch_true: following ‘true’ branch...
LVM2.2.03.38/lib/device/online.c:403:17: branch_true: ...to here
LVM2.2.03.38/lib/device/online.c:404:20: branch_true: following ‘true’ branch...
LVM2.2.03.38/lib/device/online.c:405:25: branch_true: ...to here
LVM2.2.03.38/lib/device/online.c:405:25: throw: if ‘print_log’ throws an exception...
LVM2.2.03.38/lib/device/online.c:405:25: danger: ‘fopen(&lookup_path, "r")’ leaks here; was allocated at [(3)](sarif:/runs/0/results/23/codeFlows/0/threadFlows/0/locations/2)
#  403|   		memcpy(pvid, line, ID_LEN);
#  404|   		if (strlen(pvid) != ID_LEN)
#  405|-> 			goto_bad;
#  406|   
#  407|   		snprintf(path, sizeof(path), "%s/%s", PVS_ONLINE_DIR, pvid);

Error: GCC_ANALYZER_WARNING (CWE-775): [#def288]
LVM2.2.03.38/lib/device/online.c:444:9: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(&lookup_path, "r")’
LVM2.2.03.38/lib/device/online.c:396:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/lib/device/online.c:399:20: branch_false: ...to here
LVM2.2.03.38/lib/device/online.c:399:20: acquire_resource: opened here
LVM2.2.03.38/lib/device/online.c:399:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/lib/device/online.c:399:12: branch_false: ...to here
LVM2.2.03.38/lib/device/online.c:402:16: branch_false: following ‘false’ branch...
LVM2.2.03.38/lib/device/online.c:444:9: branch_false: ...to here
LVM2.2.03.38/lib/device/online.c:444:9: throw: if ‘dm_list_size’ throws an exception...
LVM2.2.03.38/lib/device/online.c:444:9: danger: ‘fopen(&lookup_path, "r")’ leaks here; was opened at [(3)](sarif:/runs/0/results/24/codeFlows/0/threadFlows/0/locations/2)
#  442|   	}
#  443|   
#  444|-> 	log_debug("Found PVs online lookup %d for %s.", dm_list_size(pvs_online), vgname);
#  445|   
#  446|   	if (fclose(fp))

Error: GCC_ANALYZER_WARNING (CWE-401): [#def289]
LVM2.2.03.38/lib/device/online.c:444:9: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(&lookup_path, "r")’
LVM2.2.03.38/lib/device/online.c:396:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/lib/device/online.c:399:20: branch_false: ...to here
LVM2.2.03.38/lib/device/online.c:399:20: acquire_memory: allocated here
LVM2.2.03.38/lib/device/online.c:399:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/lib/device/online.c:399:12: branch_false: ...to here
LVM2.2.03.38/lib/device/online.c:402:16: branch_false: following ‘false’ branch...
LVM2.2.03.38/lib/device/online.c:444:9: branch_false: ...to here
LVM2.2.03.38/lib/device/online.c:444:9: throw: if ‘dm_list_size’ throws an exception...
LVM2.2.03.38/lib/device/online.c:444:9: danger: ‘fopen(&lookup_path, "r")’ leaks here; was allocated at [(3)](sarif:/runs/0/results/25/codeFlows/0/threadFlows/0/locations/2)
#  442|   	}
#  443|   
#  444|-> 	log_debug("Found PVs online lookup %d for %s.", dm_list_size(pvs_online), vgname);
#  445|   
#  446|   	if (fclose(fp))

Error: GCC_ANALYZER_WARNING (CWE-401): [#def290]
LVM2.2.03.38/lib/device/persist.c:197:22: warning[-Wanalyzer-malloc-leak]: leak of ‘opendir("/var/lib/lvm")’
LVM2.2.03.38/lib/device/persist.c:2094:5: enter_function: entry to ‘persist_vgcreate_begin’
LVM2.2.03.38/lib/device/persist.c:2106:9: call_function: calling ‘persist_key_file_remove_name’ from ‘persist_vgcreate_begin’
#  195|   		return;
#  196|   
#  197|-> 	while ((de = readdir(dir))) {
#  198|   		if (de->d_name[0] == '.')
#  199|   			continue;

Error: GCC_ANALYZER_WARNING (CWE-775): [#def291]
LVM2.2.03.38/lib/device/persist.c:280:21: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(&path, "r")’
LVM2.2.03.38/lib/device/persist.c:1094:12: enter_function: entry to ‘get_our_key_sanlock_start’
LVM2.2.03.38/lib/device/persist.c:1108:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/lib/device/persist.c:1114:14: branch_false: ...to here
LVM2.2.03.38/lib/device/persist.c:1114:14: call_function: calling ‘read_key_file’ from ‘get_our_key_sanlock_start’
#  278|   
#  279|   	while (fgets(line, sizeof(line), fp)) {
#  280|-> 		if (line[0] == '#')
#  281|   			continue;
#  282|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def292]
LVM2.2.03.38/lib/device/persist.c:280:21: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(&path, "r")’
LVM2.2.03.38/lib/device/persist.c:1094:12: enter_function: entry to ‘get_our_key_sanlock_start’
LVM2.2.03.38/lib/device/persist.c:1108:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/lib/device/persist.c:1114:14: branch_false: ...to here
LVM2.2.03.38/lib/device/persist.c:1114:14: call_function: calling ‘read_key_file’ from ‘get_our_key_sanlock_start’
#  278|   
#  279|   	while (fgets(line, sizeof(line), fp)) {
#  280|-> 		if (line[0] == '#')
#  281|   			continue;
#  282|   

Error: GCC_ANALYZER_WARNING (CWE-775): [#def293]
LVM2.2.03.38/lib/device/persist.c:617:13: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘open(dev_name(dev), 0)’
LVM2.2.03.38/lib/device/persist.c:973:5: enter_function: entry to ‘persist_is_started’
LVM2.2.03.38/lib/device/persist.c:975:16: call_function: calling ‘_is_started’ from ‘persist_is_started’
#  615|   out:
#  616|   	free(response_buf);
#  617|-> 	if (close(fd))
#  618|   		log_sys_debug("close", devname);
#  619|   

Error: COMPILER_WARNING: [#def294]
LVM2.2.03.38/lib/device/persist.c: scope_hint: In function ‘persist_start_extend’
LVM2.2.03.38/lib/device/persist.c:2323:13: warning[-Wunused-but-set-variable=]: variable ‘y’ set but not used
# 2323 |         int y = 0;
#      |             ^
# 2321|   	int errors = 0;
# 2322|   	int found = 0;
# 2323|-> 	int y = 0;
# 2324|   	int n = 0;
# 2325|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def295]
LVM2.2.03.38/lib/error/errseg.c:105:9: warning[-Wanalyzer-malloc-leak]: leak of ‘calloc(1, 72)’
LVM2.2.03.38/lib/error/errseg.c:94:22: enter_function: entry to ‘init_error_segtype’
LVM2.2.03.38/lib/error/errseg.c:96:40: call_function: inlined call to ‘zalloc’ from ‘init_error_segtype’
LVM2.2.03.38/lib/error/errseg.c:98:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/lib/error/errseg.c:101:9: branch_false: ...to here
LVM2.2.03.38/lib/error/errseg.c:105:9: throw: if ‘print_log’ throws an exception...
LVM2.2.03.38/lib/error/errseg.c:105:9: danger: ‘calloc(1, 72)’ leaks here; was allocated at [(3)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/2)
#  103|   	segtype->flags = SEG_CAN_SPLIT | SEG_VIRTUAL | SEG_CANNOT_BE_ZEROED;
#  104|   
#  105|-> 	log_very_verbose("Initialised segtype: %s", segtype->name);
#  106|   
#  107|   	return segtype;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def296]
LVM2.2.03.38/lib/filters/filter-composite.c:87:17: warning[-Wanalyzer-malloc-leak]: leak of ‘filters_copy’
LVM2.2.03.38/lib/filters/filter-composite.c:75:12: branch_false: following ‘false’ branch (when ‘filters’ is non-NULL)...
LVM2.2.03.38/lib/filters/filter-composite.c:78:56: branch_false: ...to here
LVM2.2.03.38/lib/filters/filter-composite.c:78:30: acquire_memory: allocated here
LVM2.2.03.38/lib/filters/filter-composite.c:78:12: branch_false: following ‘false’ branch (when ‘filters_copy’ is non-NULL)...
LVM2.2.03.38/lib/filters/filter-composite.c:83:9: branch_false: ...to here
LVM2.2.03.38/lib/filters/filter-composite.c:86:12: branch_true: following ‘true’ branch...
LVM2.2.03.38/lib/filters/filter-composite.c:87:17: branch_true: ...to here
LVM2.2.03.38/lib/filters/filter-composite.c:87:17: throw: if ‘print_log’ throws an exception...
LVM2.2.03.38/lib/filters/filter-composite.c:87:17: danger: ‘filters_copy’ leaks here; was allocated at [(3)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/2)
#   85|   
#   86|   	if (!(cft = zalloc(sizeof(*cft)))) {
#   87|-> 		log_error("Composite filters allocation failed.");
#   88|   		free(filters_copy);
#   89|   		return NULL;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def297]
LVM2.2.03.38/lib/filters/filter-composite.c:99:9: warning[-Wanalyzer-malloc-leak]: leak of ‘calloc(1, 48)’
LVM2.2.03.38/lib/filters/filter-composite.c:71:20: enter_function: entry to ‘composite_filter_create’
LVM2.2.03.38/lib/filters/filter-composite.c:75:12: branch_false: following ‘false’ branch (when ‘filters’ is non-NULL)...
LVM2.2.03.38/lib/filters/filter-composite.c:78:56: branch_false: ...to here
LVM2.2.03.38/lib/filters/filter-composite.c:78:12: branch_false: following ‘false’ branch (when ‘filters_copy’ is non-NULL)...
LVM2.2.03.38/lib/filters/filter-composite.c:83:9: branch_false: ...to here
LVM2.2.03.38/lib/filters/filter-composite.c:86:21: call_function: inlined call to ‘zalloc’ from ‘composite_filter_create’
LVM2.2.03.38/lib/filters/filter-composite.c:86:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/lib/filters/filter-composite.c:92:9: branch_false: ...to here
LVM2.2.03.38/lib/filters/filter-composite.c:99:9: throw: if ‘print_log’ throws an exception...
LVM2.2.03.38/lib/filters/filter-composite.c:99:9: danger: ‘calloc(1, 48)’ leaks here; was allocated at [(7)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/6)
#   97|   	cft->name = "composite";
#   98|   
#   99|-> 	log_debug_devs("Composite filter initialised.");
#  100|   
#  101|   	return cft;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def298]
LVM2.2.03.38/lib/filters/filter-composite.c:99:9: warning[-Wanalyzer-malloc-leak]: leak of ‘filters_copy’
LVM2.2.03.38/lib/filters/filter-composite.c:75:12: branch_false: following ‘false’ branch (when ‘filters’ is non-NULL)...
LVM2.2.03.38/lib/filters/filter-composite.c:78:56: branch_false: ...to here
LVM2.2.03.38/lib/filters/filter-composite.c:78:30: acquire_memory: allocated here
LVM2.2.03.38/lib/filters/filter-composite.c:78:12: branch_false: following ‘false’ branch (when ‘filters_copy’ is non-NULL)...
LVM2.2.03.38/lib/filters/filter-composite.c:83:9: branch_false: ...to here
LVM2.2.03.38/lib/filters/filter-composite.c:86:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/lib/filters/filter-composite.c:92:9: branch_false: ...to here
LVM2.2.03.38/lib/filters/filter-composite.c:99:9: throw: if ‘print_log’ throws an exception...
LVM2.2.03.38/lib/filters/filter-composite.c:99:9: danger: ‘filters_copy’ leaks here; was allocated at [(3)](sarif:/runs/0/results/2/codeFlows/0/threadFlows/0/locations/2)
#   97|   	cft->name = "composite";
#   98|   
#   99|-> 	log_debug_devs("Composite filter initialised.");
#  100|   
#  101|   	return cft;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def299]
LVM2.2.03.38/lib/filters/filter-deviceid.c:66:9: warning[-Wanalyzer-malloc-leak]: leak of ‘calloc(1, 48)’
LVM2.2.03.38/lib/filters/filter-deviceid.c:52:20: enter_function: entry to ‘deviceid_filter_create’
LVM2.2.03.38/lib/filters/filter-deviceid.c:56:19: call_function: inlined call to ‘zalloc’ from ‘deviceid_filter_create’
LVM2.2.03.38/lib/filters/filter-deviceid.c:56:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/lib/filters/filter-deviceid.c:61:9: branch_false: ...to here
LVM2.2.03.38/lib/filters/filter-deviceid.c:66:9: throw: if ‘print_log’ throws an exception...
LVM2.2.03.38/lib/filters/filter-deviceid.c:66:9: danger: ‘calloc(1, 48)’ leaks here; was allocated at [(3)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/2)
#   64|   	f->name = "deviceid";
#   65|   
#   66|-> 	log_debug_devs("deviceid filter initialised.");
#   67|   
#   68|   	return f;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def300]
LVM2.2.03.38/lib/filters/filter-fwraid.c:126:9: warning[-Wanalyzer-malloc-leak]: leak of ‘calloc(1, 48)’
LVM2.2.03.38/lib/filters/filter-fwraid.c:111:20: enter_function: entry to ‘fwraid_filter_create’
LVM2.2.03.38/lib/filters/filter-fwraid.c:115:19: call_function: inlined call to ‘zalloc’ from ‘fwraid_filter_create’
LVM2.2.03.38/lib/filters/filter-fwraid.c:115:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/lib/filters/filter-fwraid.c:120:9: branch_false: ...to here
LVM2.2.03.38/lib/filters/filter-fwraid.c:126:9: throw: if ‘print_log’ throws an exception...
LVM2.2.03.38/lib/filters/filter-fwraid.c:126:9: danger: ‘calloc(1, 48)’ leaks here; was allocated at [(3)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/2)
#  124|   	f->name = "fwraid";
#  125|   
#  126|-> 	log_debug_devs("Firmware RAID filter initialised.");
#  127|   
#  128|   	return f;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def301]
LVM2.2.03.38/lib/filters/filter-md.c:149:9: warning[-Wanalyzer-malloc-leak]: leak of ‘calloc(1, 48)’
LVM2.2.03.38/lib/filters/filter-md.c:134:20: enter_function: entry to ‘md_filter_create’
LVM2.2.03.38/lib/filters/filter-md.c:138:19: call_function: inlined call to ‘zalloc’ from ‘md_filter_create’
LVM2.2.03.38/lib/filters/filter-md.c:138:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/lib/filters/filter-md.c:143:9: branch_false: ...to here
LVM2.2.03.38/lib/filters/filter-md.c:149:9: throw: if ‘print_log’ throws an exception...
LVM2.2.03.38/lib/filters/filter-md.c:149:9: danger: ‘calloc(1, 48)’ leaks here; was allocated at [(3)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/2)
#  147|   	f->name = "md";
#  148|   
#  149|-> 	log_debug_devs("MD filter initialised.");
#  150|   
#  151|   	return f;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def302]
LVM2.2.03.38/lib/filters/filter-mpath.c:87:9: warning[-Wanalyzer-malloc-leak]: leak of ‘calloc(1, 48)’
LVM2.2.03.38/lib/filters/filter-mpath.c:67:20: enter_function: entry to ‘mpath_filter_create’
LVM2.2.03.38/lib/filters/filter-mpath.c:72:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/lib/filters/filter-mpath.c:77:19: call_function: inlined call to ‘zalloc’ from ‘mpath_filter_create’
LVM2.2.03.38/lib/filters/filter-mpath.c:77:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/lib/filters/filter-mpath.c:82:9: branch_false: ...to here
LVM2.2.03.38/lib/filters/filter-mpath.c:87:9: throw: if ‘print_log’ throws an exception...
LVM2.2.03.38/lib/filters/filter-mpath.c:87:9: danger: ‘calloc(1, 48)’ leaks here; was allocated at [(5)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/4)
#   85|   	f->name = "mpath";
#   86|   
#   87|-> 	log_debug_devs("mpath filter initialised.");
#   88|   
#   89|   	return f;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def303]
LVM2.2.03.38/lib/filters/filter-partitioned.c:68:9: warning[-Wanalyzer-malloc-leak]: leak of ‘calloc(1, 48)’
LVM2.2.03.38/lib/filters/filter-partitioned.c:54:20: enter_function: entry to ‘partitioned_filter_create’
LVM2.2.03.38/lib/filters/filter-partitioned.c:58:19: call_function: inlined call to ‘zalloc’ from ‘partitioned_filter_create’
LVM2.2.03.38/lib/filters/filter-partitioned.c:58:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/lib/filters/filter-partitioned.c:63:9: branch_false: ...to here
LVM2.2.03.38/lib/filters/filter-partitioned.c:68:9: throw: if ‘print_log’ throws an exception...
LVM2.2.03.38/lib/filters/filter-partitioned.c:68:9: danger: ‘calloc(1, 48)’ leaks here; was allocated at [(3)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/2)
#   66|   	f->name = "partitioned";
#   67|   
#   68|-> 	log_debug_devs("Partitioned filter initialised.");
#   69|   
#   70|   	return f;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def304]
LVM2.2.03.38/lib/filters/filter-persistent.c:58:13: warning[-Wanalyzer-malloc-leak]: leak of ‘calloc(1, 24)’
LVM2.2.03.38/lib/filters/filter-persistent.c:157:20: enter_function: entry to ‘persistent_filter_create’
LVM2.2.03.38/lib/filters/filter-persistent.c:162:20: call_function: inlined call to ‘zalloc’ from ‘persistent_filter_create’
LVM2.2.03.38/lib/filters/filter-persistent.c:162:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/lib/filters/filter-persistent.c:167:9: branch_false: ...to here
LVM2.2.03.38/lib/filters/filter-persistent.c:171:14: call_function: calling ‘_init_hash’ from ‘persistent_filter_create’
#   56|   static int _init_hash(struct pfilter *pf)
#   57|   {
#   58|-> 	if (pf->devices)
#   59|   		radix_tree_destroy(pf->devices);
#   60|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def305]
LVM2.2.03.38/lib/filters/filter-persistent.c:188:9: warning[-Wanalyzer-malloc-leak]: leak of ‘<unknown>’
LVM2.2.03.38/lib/filters/filter-persistent.c:157:20: enter_function: entry to ‘persistent_filter_create’
LVM2.2.03.38/lib/filters/filter-persistent.c:162:20: call_function: inlined call to ‘zalloc’ from ‘persistent_filter_create’
LVM2.2.03.38/lib/filters/filter-persistent.c:162:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/lib/filters/filter-persistent.c:167:9: branch_false: ...to here
LVM2.2.03.38/lib/filters/filter-persistent.c:171:14: call_function: calling ‘_init_hash’ from ‘persistent_filter_create’
LVM2.2.03.38/lib/filters/filter-persistent.c:171:14: return_function: returning to ‘persistent_filter_create’ from ‘_init_hash’
LVM2.2.03.38/lib/filters/filter-persistent.c:171:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/lib/filters/filter-persistent.c:176:19: call_function: inlined call to ‘zalloc’ from ‘persistent_filter_create’
LVM2.2.03.38/lib/filters/filter-persistent.c:176:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/lib/filters/filter-persistent.c:181:9: branch_false: ...to here
LVM2.2.03.38/lib/filters/filter-persistent.c:188:9: throw: if ‘print_log’ throws an exception...
LVM2.2.03.38/lib/filters/filter-persistent.c:188:9: danger: ‘<unknown>’ leaks here; was allocated at [(3)](sarif:/runs/0/results/5/codeFlows/0/threadFlows/0/locations/2)
#  186|   	f->name = "persistent";
#  187|   
#  188|-> 	log_debug_devs("Persistent filter initialised.");
#  189|   
#  190|   	return f;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def306]
LVM2.2.03.38/lib/filters/filter-persistent.c:188:9: warning[-Wanalyzer-malloc-leak]: leak of ‘calloc(1, 48)’
LVM2.2.03.38/lib/filters/filter-persistent.c:157:20: enter_function: entry to ‘persistent_filter_create’
LVM2.2.03.38/lib/filters/filter-persistent.c:162:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/lib/filters/filter-persistent.c:167:9: branch_false: ...to here
LVM2.2.03.38/lib/filters/filter-persistent.c:171:14: call_function: calling ‘_init_hash’ from ‘persistent_filter_create’
LVM2.2.03.38/lib/filters/filter-persistent.c:171:14: return_function: returning to ‘persistent_filter_create’ from ‘_init_hash’
LVM2.2.03.38/lib/filters/filter-persistent.c:171:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/lib/filters/filter-persistent.c:176:19: call_function: inlined call to ‘zalloc’ from ‘persistent_filter_create’
LVM2.2.03.38/lib/filters/filter-persistent.c:176:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/lib/filters/filter-persistent.c:181:9: branch_false: ...to here
LVM2.2.03.38/lib/filters/filter-persistent.c:188:9: throw: if ‘print_log’ throws an exception...
LVM2.2.03.38/lib/filters/filter-persistent.c:188:9: danger: ‘calloc(1, 48)’ leaks here; was allocated at [(12)](sarif:/runs/0/results/6/codeFlows/0/threadFlows/0/locations/11)
#  186|   	f->name = "persistent";
#  187|   
#  188|-> 	log_debug_devs("Persistent filter initialised.");
#  189|   
#  190|   	return f;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def307]
LVM2.2.03.38/lib/filters/filter-signature.c:88:9: warning[-Wanalyzer-malloc-leak]: leak of ‘calloc(1, 48)’
LVM2.2.03.38/lib/filters/filter-signature.c:73:20: enter_function: entry to ‘signature_filter_create’
LVM2.2.03.38/lib/filters/filter-signature.c:77:19: call_function: inlined call to ‘zalloc’ from ‘signature_filter_create’
LVM2.2.03.38/lib/filters/filter-signature.c:77:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/lib/filters/filter-signature.c:82:9: branch_false: ...to here
LVM2.2.03.38/lib/filters/filter-signature.c:88:9: throw: if ‘print_log’ throws an exception...
LVM2.2.03.38/lib/filters/filter-signature.c:88:9: danger: ‘calloc(1, 48)’ leaks here; was allocated at [(3)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/2)
#   86|   	f->name = "signature";
#   87|   
#   88|-> 	log_debug_devs("signature filter initialised.");
#   89|   
#   90|   	return f;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def308]
LVM2.2.03.38/lib/filters/filter-sysfs.c:96:16: warning[-Wanalyzer-malloc-leak]: leak of ‘calloc(1, strlen(sysfs_dir) + 49)’
LVM2.2.03.38/lib/filters/filter-sysfs.c:73:20: enter_function: entry to ‘sysfs_filter_create’
LVM2.2.03.38/lib/filters/filter-sysfs.c:78:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/lib/filters/filter-sysfs.c:84:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/lib/filters/filter-sysfs.c:87:15: branch_false: ...to here
LVM2.2.03.38/lib/filters/filter-sysfs.c:88:19: call_function: inlined call to ‘zalloc’ from ‘sysfs_filter_create’
LVM2.2.03.38/lib/filters/filter-sysfs.c:88:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/lib/filters/filter-sysfs.c:91:9: branch_false: ...to here
LVM2.2.03.38/lib/filters/filter-sysfs.c:99:9: throw: if ‘print_log’ throws an exception...
LVM2.2.03.38/lib/filters/filter-sysfs.c:96:16: danger: ‘calloc(1, strlen(sysfs_dir) + 49)’ leaks here; was allocated at [(7)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/6)
#   94|   	f->name = "sysfs";
#   95|   
#   96|-> 	memcpy(f + 1, sysfs_dir, len);
#   97|   	f->private = (f + 1);
#   98|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def309]
LVM2.2.03.38/lib/filters/filter-type.c:61:9: warning[-Wanalyzer-malloc-leak]: leak of ‘calloc(1, 48)’
LVM2.2.03.38/lib/filters/filter-type.c:46:20: enter_function: entry to ‘lvm_type_filter_create’
LVM2.2.03.38/lib/filters/filter-type.c:50:19: call_function: inlined call to ‘zalloc’ from ‘lvm_type_filter_create’
LVM2.2.03.38/lib/filters/filter-type.c:50:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/lib/filters/filter-type.c:55:9: branch_false: ...to here
LVM2.2.03.38/lib/filters/filter-type.c:61:9: throw: if ‘print_log’ throws an exception...
LVM2.2.03.38/lib/filters/filter-type.c:61:9: danger: ‘calloc(1, 48)’ leaks here; was allocated at [(3)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/2)
#   59|   	f->name = "type";
#   60|   
#   61|-> 	log_debug_devs("LVM type filter initialised.");
#   62|   
#   63|   	return f;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def310]
LVM2.2.03.38/lib/filters/filter-usable.c:99:17: warning[-Wanalyzer-malloc-leak]: leak of ‘calloc(1, 48)’
LVM2.2.03.38/lib/filters/filter-usable.c:83:20: enter_function: entry to ‘usable_filter_create’
LVM2.2.03.38/lib/filters/filter-usable.c:88:19: call_function: inlined call to ‘zalloc’ from ‘usable_filter_create’
LVM2.2.03.38/lib/filters/filter-usable.c:88:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/lib/filters/filter-usable.c:93:9: branch_false: ...to here
LVM2.2.03.38/lib/filters/filter-usable.c:98:12: branch_true: following ‘true’ branch...
LVM2.2.03.38/lib/filters/filter-usable.c:99:17: branch_true: ...to here
LVM2.2.03.38/lib/filters/filter-usable.c:99:17: throw: if ‘print_log’ throws an exception...
LVM2.2.03.38/lib/filters/filter-usable.c:99:17: danger: ‘calloc(1, 48)’ leaks here; was allocated at [(3)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/2)
#   97|   
#   98|   	if (!(data = zalloc(sizeof(*data)))) {
#   99|-> 		log_error("Usable device filter mode allocation failed");
#  100|   		free(f);
#  101|   		return NULL;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def311]
LVM2.2.03.38/lib/filters/filter-usable.c:106:33: warning[-Wanalyzer-malloc-leak]: leak of ‘calloc(1, 4)’
LVM2.2.03.38/lib/filters/filter-usable.c:83:20: enter_function: entry to ‘usable_filter_create’
LVM2.2.03.38/lib/filters/filter-usable.c:88:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/lib/filters/filter-usable.c:93:9: branch_false: ...to here
LVM2.2.03.38/lib/filters/filter-usable.c:98:22: call_function: inlined call to ‘zalloc’ from ‘usable_filter_create’
LVM2.2.03.38/lib/filters/filter-usable.c:98:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/lib/filters/filter-usable.c:104:9: branch_false: ...to here
LVM2.2.03.38/lib/filters/filter-usable.c:106:33: throw: if ‘ignore_suspended_devices’ throws an exception...
LVM2.2.03.38/lib/filters/filter-usable.c:106:33: danger: ‘calloc(1, 4)’ leaks here; was allocated at [(5)](sarif:/runs/0/results/2/codeFlows/0/threadFlows/0/locations/4)
#  104|   	data->check_empty = 1;
#  105|   	data->check_blocked = 1;
#  106|-> 	data->check_suspended = ignore_suspended_devices();
#  107|   	data->check_error_target = 1;
#  108|   	data->check_reserved = 1;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def312]
LVM2.2.03.38/lib/filters/filter-usable.c:106:33: warning[-Wanalyzer-malloc-leak]: leak of ‘calloc(1, 48)’
LVM2.2.03.38/lib/filters/filter-usable.c:83:20: enter_function: entry to ‘usable_filter_create’
LVM2.2.03.38/lib/filters/filter-usable.c:88:19: call_function: inlined call to ‘zalloc’ from ‘usable_filter_create’
LVM2.2.03.38/lib/filters/filter-usable.c:88:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/lib/filters/filter-usable.c:93:9: branch_false: ...to here
LVM2.2.03.38/lib/filters/filter-usable.c:98:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/lib/filters/filter-usable.c:104:9: branch_false: ...to here
LVM2.2.03.38/lib/filters/filter-usable.c:106:33: throw: if ‘ignore_suspended_devices’ throws an exception...
LVM2.2.03.38/lib/filters/filter-usable.c:106:33: danger: ‘calloc(1, 48)’ leaks here; was allocated at [(3)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/2)
#  104|   	data->check_empty = 1;
#  105|   	data->check_blocked = 1;
#  106|-> 	data->check_suspended = ignore_suspended_devices();
#  107|   	data->check_error_target = 1;
#  108|   	data->check_reserved = 1;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def313]
LVM2.2.03.38/lib/filters/filter-usable.c:113:9: warning[-Wanalyzer-malloc-leak]: leak of ‘<unknown>’
LVM2.2.03.38/lib/filters/filter-usable.c:83:20: enter_function: entry to ‘usable_filter_create’
LVM2.2.03.38/lib/filters/filter-usable.c:88:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/lib/filters/filter-usable.c:93:9: branch_false: ...to here
LVM2.2.03.38/lib/filters/filter-usable.c:98:22: call_function: inlined call to ‘zalloc’ from ‘usable_filter_create’
LVM2.2.03.38/lib/filters/filter-usable.c:98:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/lib/filters/filter-usable.c:104:9: branch_false: ...to here
LVM2.2.03.38/lib/filters/filter-usable.c:113:9: throw: if ‘print_log’ throws an exception...
LVM2.2.03.38/lib/filters/filter-usable.c:113:9: danger: ‘<unknown>’ leaks here; was allocated at [(5)](sarif:/runs/0/results/6/codeFlows/0/threadFlows/0/locations/4)
#  111|   	f->private = data;
#  112|   
#  113|-> 	log_debug_devs("Usable device filter initialised (scan_lvs %d).", !data->check_lv);
#  114|   
#  115|   	return f;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def314]
LVM2.2.03.38/lib/format_text/archive.c:256:14: warning[-Wanalyzer-malloc-leak]: leak of ‘fp’
LVM2.2.03.38/lib/format_text/archive.c:243:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/lib/format_text/archive.c:249:20: branch_false: ...to here
LVM2.2.03.38/lib/format_text/archive.c:249:20: acquire_memory: allocated here
LVM2.2.03.38/lib/format_text/archive.c:249:12: branch_false: following ‘false’ branch (when ‘fp’ is non-NULL)...
LVM2.2.03.38/lib/format_text/archive.c:256:14: branch_false: ...to here
LVM2.2.03.38/lib/format_text/archive.c:256:14: throw: if ‘text_vg_export_file’ throws an exception...
LVM2.2.03.38/lib/format_text/archive.c:256:14: danger: ‘fp’ leaks here; was allocated at [(3)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/2)
#  254|   	}
#  255|   
#  256|-> 	if (!text_vg_export_file(vg, desc, fp)) {
#  257|   		if (fclose(fp))
#  258|   			log_sys_error("fclose", temp_file);

Error: GCC_ANALYZER_WARNING (CWE-404): [#def315]
LVM2.2.03.38/lib/format_text/export.c:310:9: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
LVM2.2.03.38/lib/format_text/export.c:693:12: enter_function: entry to ‘_print_timestamp’
LVM2.2.03.38/lib/format_text/export.c:699:12: branch_true: following ‘true’ branch...
LVM2.2.03.38/lib/format_text/export.c:700:21: branch_true: ...to here
LVM2.2.03.38/lib/format_text/export.c:710:17: call_function: calling ‘out_text_with_comment’ from ‘_print_timestamp’
#  308|   	int r;
#  309|   
#  310|-> 	_out_with_comment(f, comment, fmt, ap);
#  311|   
#  312|   	return r;

Error: GCC_ANALYZER_WARNING (CWE-404): [#def316]
LVM2.2.03.38/lib/format_text/export.c:323:9: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
LVM2.2.03.38/lib/format_text/export.c:930:12: enter_function: entry to ‘_print_historical_lvs’
LVM2.2.03.38/lib/format_text/export.c:934:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/lib/format_text/export.c:937:9: branch_false: ...to here
LVM2.2.03.38/lib/format_text/export.c:937:9: call_function: calling ‘out_text’ from ‘_print_historical_lvs’
#  321|   	int r;
#  322|   
#  323|-> 	_out_with_comment(f, NULL, fmt, ap);
#  324|   
#  325|   	return r;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def317]
LVM2.2.03.38/lib/format_text/export.c:400:22: warning[-Wanalyzer-malloc-leak]: leak of ‘buf’
LVM2.2.03.38/lib/format_text/export.c:412:12: enter_function: entry to ‘_out_list’
LVM2.2.03.38/lib/format_text/export.c:418:32: call_function: calling ‘_alloc_printed_str_list’ from ‘_out_list’
#  398|   
#  399|   	dm_list_iterate_items(sl, list) {
#  400|-> 		if (!emit_to_buffer(&buf, &size, "%s\"%s\"",
#  401|   				    (!first) ? ", " : "",
#  402|   				    sl->str)) {

Error: GCC_ANALYZER_WARNING (CWE-401): [#def318]
LVM2.2.03.38/lib/format_text/export.c:962:27: warning[-Wanalyzer-malloc-leak]: leak of ‘f.data.fp’
LVM2.2.03.38/lib/format_text/export.c:1047:8: enter_function: entry to ‘text_vg_export_raw’
LVM2.2.03.38/lib/format_text/export.c:1060:34: call_function: inlined call to ‘zalloc’ from ‘text_vg_export_raw’
LVM2.2.03.38/lib/format_text/export.c:1060:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/lib/format_text/export.c:1065:14: branch_false: ...to here
LVM2.2.03.38/lib/format_text/export.c:1065:14: call_function: calling ‘_text_vg_export’ from ‘text_vg_export_raw’
#  960|   	struct physical_volume *pv;
#  961|   
#  962|-> 	if (!(f->pv_idx = radix_tree_create(NULL, NULL)))
#  963|   		return_0;
#  964|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def319]
LVM2.2.03.38/lib/format_text/export.c:963:17: warning[-Wanalyzer-malloc-leak]: leak of ‘f.data.fp’
LVM2.2.03.38/lib/format_text/export.c:1047:8: enter_function: entry to ‘text_vg_export_raw’
LVM2.2.03.38/lib/format_text/export.c:1060:34: call_function: inlined call to ‘zalloc’ from ‘text_vg_export_raw’
LVM2.2.03.38/lib/format_text/export.c:1060:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/lib/format_text/export.c:1065:14: branch_false: ...to here
LVM2.2.03.38/lib/format_text/export.c:1065:14: call_function: calling ‘_text_vg_export’ from ‘text_vg_export_raw’
#  961|   
#  962|   	if (!(f->pv_idx = radix_tree_create(NULL, NULL)))
#  963|-> 		return_0;
#  964|   
#  965|   	dm_list_iterate_items(pvl, &vg->pvs) {

Error: GCC_ANALYZER_WARNING (CWE-401): [#def320]
LVM2.2.03.38/lib/format_text/export.c:969:22: warning[-Wanalyzer-malloc-leak]: leak of ‘f.data.fp’
LVM2.2.03.38/lib/format_text/export.c:1047:8: enter_function: entry to ‘text_vg_export_raw’
LVM2.2.03.38/lib/format_text/export.c:1060:34: call_function: inlined call to ‘zalloc’ from ‘text_vg_export_raw’
LVM2.2.03.38/lib/format_text/export.c:1060:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/lib/format_text/export.c:1065:14: branch_false: ...to here
LVM2.2.03.38/lib/format_text/export.c:1065:14: call_function: calling ‘_text_vg_export’ from ‘text_vg_export_raw’
#  967|   
#  968|   		/* FIXME But skip if there's already an LV called pv%d ! */
#  969|-> 		if (!radix_tree_insert(f->pv_idx, &pv, sizeof(pv), count))
#  970|   			return_0;
#  971|   		count.n++;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def321]
LVM2.2.03.38/lib/format_text/export.c:970:25: warning[-Wanalyzer-malloc-leak]: leak of ‘f.data.fp’
LVM2.2.03.38/lib/format_text/export.c:1047:8: enter_function: entry to ‘text_vg_export_raw’
LVM2.2.03.38/lib/format_text/export.c:1060:34: call_function: inlined call to ‘zalloc’ from ‘text_vg_export_raw’
LVM2.2.03.38/lib/format_text/export.c:1060:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/lib/format_text/export.c:1065:14: branch_false: ...to here
LVM2.2.03.38/lib/format_text/export.c:1065:14: call_function: calling ‘_text_vg_export’ from ‘text_vg_export_raw’
#  968|   		/* FIXME But skip if there's already an LV called pv%d ! */
#  969|   		if (!radix_tree_insert(f->pv_idx, &pv, sizeof(pv), count))
#  970|-> 			return_0;
#  971|   		count.n++;
#  972|   	}

Error: GCC_ANALYZER_WARNING (CWE-401): [#def322]
LVM2.2.03.38/lib/format_text/export.c:983:17: warning[-Wanalyzer-malloc-leak]: leak of ‘f.data.fp’
LVM2.2.03.38/lib/format_text/export.c:1047:8: enter_function: entry to ‘text_vg_export_raw’
LVM2.2.03.38/lib/format_text/export.c:1060:34: call_function: inlined call to ‘zalloc’ from ‘text_vg_export_raw’
LVM2.2.03.38/lib/format_text/export.c:1060:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/lib/format_text/export.c:1065:14: branch_false: ...to here
LVM2.2.03.38/lib/format_text/export.c:1065:14: call_function: calling ‘_text_vg_export’ from ‘text_vg_export_raw’
#  981|   
#  982|   	if (!_build_pv_idx(f, vg))
#  983|-> 		goto_out;
#  984|   
#  985|   	if (f->header && !_print_header(vg->cmd, f, desc))

Error: GCC_ANALYZER_WARNING (CWE-401): [#def323]
LVM2.2.03.38/lib/format_text/format-text.c:1328:9: warning[-Wanalyzer-malloc-leak]: leak of ‘fp’
LVM2.2.03.38/lib/format_text/format-text.c:1315:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/lib/format_text/format-text.c:1321:20: branch_false: ...to here
LVM2.2.03.38/lib/format_text/format-text.c:1321:20: acquire_memory: allocated here
LVM2.2.03.38/lib/format_text/format-text.c:1321:12: branch_false: following ‘false’ branch (when ‘fp’ is non-NULL)...
LVM2.2.03.38/lib/format_text/format-text.c:1328:9: branch_false: ...to here
LVM2.2.03.38/lib/format_text/format-text.c:1328:9: throw: if ‘print_log’ throws an exception...
LVM2.2.03.38/lib/format_text/format-text.c:1328:9: danger: ‘fp’ leaks here; was allocated at [(3)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/2)
# 1326|   	}
# 1327|   
# 1328|-> 	log_debug_metadata("Writing %s metadata to %s", vg->name, temp_file);
# 1329|   
# 1330|   	if (!text_vg_export_file(vg, tc->desc, fp)) {

Error: GCC_ANALYZER_WARNING (CWE-401): [#def324]
LVM2.2.03.38/lib/format_text/format-text.c:1330:14: warning[-Wanalyzer-malloc-leak]: leak of ‘fp’
LVM2.2.03.38/lib/format_text/format-text.c:1315:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/lib/format_text/format-text.c:1321:20: branch_false: ...to here
LVM2.2.03.38/lib/format_text/format-text.c:1321:20: acquire_memory: allocated here
LVM2.2.03.38/lib/format_text/format-text.c:1321:12: branch_false: following ‘false’ branch (when ‘fp’ is non-NULL)...
LVM2.2.03.38/lib/format_text/format-text.c:1328:9: branch_false: ...to here
LVM2.2.03.38/lib/format_text/format-text.c:1330:14: throw: if ‘text_vg_export_file’ throws an exception...
LVM2.2.03.38/lib/format_text/format-text.c:1330:14: danger: ‘fp’ leaks here; was allocated at [(3)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/2)
# 1328|   	log_debug_metadata("Writing %s metadata to %s", vg->name, temp_file);
# 1329|   
# 1330|-> 	if (!text_vg_export_file(vg, tc->desc, fp)) {
# 1331|   		log_error("Failed to write metadata to %s.", temp_file);
# 1332|   		if (fclose(fp))

Error: GCC_ANALYZER_WARNING (CWE-401): [#def325]
LVM2.2.03.38/lib/format_text/format-text.c:2608:17: warning[-Wanalyzer-malloc-leak]: leak of ‘calloc(1, 120)’
LVM2.2.03.38/lib/format_text/format-text.c:2592:21: enter_function: entry to ‘create_text_format’
LVM2.2.03.38/lib/format_text/format-text.c:2599:21: call_function: inlined call to ‘zalloc’ from ‘create_text_format’
LVM2.2.03.38/lib/format_text/format-text.c:2599:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/lib/format_text/format-text.c:2604:9: branch_false: ...to here
LVM2.2.03.38/lib/format_text/format-text.c:2614:12: branch_true: following ‘true’ branch (when ‘mda_lists’ is NULL)...
LVM2.2.03.38/lib/format_text/format-text.c:2615:17: branch_true: ...to here
LVM2.2.03.38/lib/format_text/format-text.c:2615:17: throw: if ‘print_log’ throws an exception...
LVM2.2.03.38/lib/format_text/format-text.c:2608:17: danger: ‘calloc(1, 120)’ leaks here; was allocated at [(3)](sarif:/runs/0/results/2/codeFlows/0/threadFlows/0/locations/2)
# 2606|   	fmt->name = FMT_TEXT_NAME;
# 2607|   	fmt->alias = FMT_TEXT_ALIAS;
# 2608|-> 	strncpy(fmt->orphan_vg_name, ORPHAN_VG_NAME(FMT_TEXT_NAME), sizeof(fmt->orphan_vg_name));
# 2609|   	fmt->features = FMT_SEGMENTS | FMT_TAGS | FMT_PRECOMMIT |
# 2610|   			FMT_UNLIMITED_VOLS | FMT_RESIZE_PV |

Error: GCC_ANALYZER_WARNING (CWE-401): [#def326]
LVM2.2.03.38/lib/format_text/format-text.c:2624:31: warning[-Wanalyzer-malloc-leak]: leak of ‘mda_lists’
LVM2.2.03.38/lib/format_text/format-text.c:2599:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/lib/format_text/format-text.c:2604:9: branch_false: ...to here
LVM2.2.03.38/lib/format_text/format-text.c:2614:27: acquire_memory: allocated here
LVM2.2.03.38/lib/format_text/format-text.c:2614:12: branch_false: following ‘false’ branch (when ‘mda_lists’ is non-NULL)...
LVM2.2.03.38/lib/format_text/format-text.c:2620:9: branch_false: ...to here
LVM2.2.03.38/lib/format_text/format-text.c:2624:31: throw: if ‘text_labeller_create’ throws an exception...
LVM2.2.03.38/lib/format_text/format-text.c:2624:31: danger: ‘mda_lists’ leaks here; was allocated at [(4)](sarif:/runs/0/results/11/codeFlows/0/threadFlows/0/locations/3)
# 2622|   	fmt->private = (void *) mda_lists;
# 2623|   
# 2624|-> 	if (!(fmt->labeller = text_labeller_create(fmt))) {
# 2625|   		log_error("Couldn't create text label handler.");
# 2626|   		goto bad;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def327]
LVM2.2.03.38/lib/format_text/text_label.c:216:9: warning[-Wanalyzer-malloc-leak]: leak of ‘dal’
LVM2.2.03.38/lib/format_text/text_label.c:201:12: branch_true: following ‘true’ branch (when ‘mem’ is NULL)...
LVM2.2.03.38/lib/format_text/text_label.c:202:29: branch_true: ...to here
LVM2.2.03.38/lib/format_text/text_label.c:202:29: acquire_memory: allocated here
LVM2.2.03.38/lib/format_text/text_label.c:202:20: branch_false: following ‘false’ branch (when ‘dal’ is non-NULL)...
LVM2.2.03.38/lib/format_text/text_label.c:213:9: branch_false: ...to here
LVM2.2.03.38/lib/format_text/text_label.c:216:9: throw: if ‘dm_list_add’ throws an exception...
LVM2.2.03.38/lib/format_text/text_label.c:216:9: danger: ‘dal’ leaks here; was allocated at [(3)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/2)
#  214|   	dal->disk_locn.size = size;
#  215|   
#  216|-> 	dm_list_add(das, &dal->list);
#  217|   
#  218|   	return 1;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def328]
LVM2.2.03.38/lib/format_text/text_label.c:259:25: warning[-Wanalyzer-malloc-leak]: leak of ‘mdal’
LVM2.2.03.38/lib/format_text/text_label.c:252:12: branch_true: following ‘true’ branch (when ‘mem’ is NULL)...
LVM2.2.03.38/lib/format_text/text_label.c:253:30: branch_true: ...to here
LVM2.2.03.38/lib/format_text/text_label.c:253:30: acquire_memory: allocated here
LVM2.2.03.38/lib/format_text/text_label.c:253:20: branch_false: following ‘false’ branch (when ‘mdal’ is non-NULL)...
LVM2.2.03.38/lib/format_text/text_label.c:258:30: branch_false: ...to here
LVM2.2.03.38/lib/format_text/text_label.c:258:20: branch_true: following ‘true’ branch (when ‘mdac’ is NULL)...
LVM2.2.03.38/lib/format_text/text_label.c:259:25: branch_true: ...to here
LVM2.2.03.38/lib/format_text/text_label.c:259:25: throw: if ‘print_log’ throws an exception...
LVM2.2.03.38/lib/format_text/text_label.c:259:25: danger: ‘mdal’ leaks here; was allocated at [(3)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/2)
#  257|   
#  258|   		if (!(mdac = malloc(sizeof(struct mda_context)))) {
#  259|-> 			log_error("struct mda_context allocation failed");
#  260|   			free(mdal);
#  261|   			return 0;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def329]
LVM2.2.03.38/lib/format_text/text_label.c:294:9: warning[-Wanalyzer-malloc-leak]: leak of ‘mdac’
LVM2.2.03.38/lib/format_text/text_label.c:252:12: branch_true: following ‘true’ branch (when ‘mem’ is NULL)...
LVM2.2.03.38/lib/format_text/text_label.c:253:30: branch_true: ...to here
LVM2.2.03.38/lib/format_text/text_label.c:253:20: branch_false: following ‘false’ branch (when ‘mdal’ is non-NULL)...
LVM2.2.03.38/lib/format_text/text_label.c:258:30: branch_false: ...to here
LVM2.2.03.38/lib/format_text/text_label.c:258:30: acquire_memory: allocated here
LVM2.2.03.38/lib/format_text/text_label.c:258:20: branch_false: following ‘false’ branch (when ‘mdac’ is non-NULL)...
LVM2.2.03.38/lib/format_text/text_label.c:275:21: branch_false: ...to here
LVM2.2.03.38/lib/format_text/text_label.c:294:9: throw: if ‘mda_set_ignored’ throws an exception...
LVM2.2.03.38/lib/format_text/text_label.c:294:9: danger: ‘mdac’ leaks here; was allocated at [(5)](sarif:/runs/0/results/3/codeFlows/0/threadFlows/0/locations/4)
#  292|   	}
#  293|   
#  294|-> 	mda_set_ignored(mdal, ignored);
#  295|   
#  296|   	dm_list_add(mdas, &mdal->list);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def330]
LVM2.2.03.38/lib/format_text/text_label.c:294:9: warning[-Wanalyzer-malloc-leak]: leak of ‘mdal’
LVM2.2.03.38/lib/format_text/text_label.c:252:12: branch_true: following ‘true’ branch (when ‘mem’ is NULL)...
LVM2.2.03.38/lib/format_text/text_label.c:253:30: branch_true: ...to here
LVM2.2.03.38/lib/format_text/text_label.c:253:30: acquire_memory: allocated here
LVM2.2.03.38/lib/format_text/text_label.c:253:20: branch_false: following ‘false’ branch (when ‘mdal’ is non-NULL)...
LVM2.2.03.38/lib/format_text/text_label.c:258:30: branch_false: ...to here
LVM2.2.03.38/lib/format_text/text_label.c:258:20: branch_false: following ‘false’ branch (when ‘mdac’ is non-NULL)...
LVM2.2.03.38/lib/format_text/text_label.c:275:21: branch_false: ...to here
LVM2.2.03.38/lib/format_text/text_label.c:294:9: throw: if ‘mda_set_ignored’ throws an exception...
LVM2.2.03.38/lib/format_text/text_label.c:294:9: danger: ‘mdal’ leaks here; was allocated at [(3)](sarif:/runs/0/results/2/codeFlows/0/threadFlows/0/locations/2)
#  292|   	}
#  293|   
#  294|-> 	mda_set_ignored(mdal, ignored);
#  295|   
#  296|   	dm_list_add(mdas, &mdal->list);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def331]
LVM2.2.03.38/lib/freeseg/freeseg.c:40:9: warning[-Wanalyzer-malloc-leak]: leak of ‘calloc(1, 72)’
LVM2.2.03.38/lib/freeseg/freeseg.c:29:22: enter_function: entry to ‘init_free_segtype’
LVM2.2.03.38/lib/freeseg/freeseg.c:31:40: call_function: inlined call to ‘zalloc’ from ‘init_free_segtype’
LVM2.2.03.38/lib/freeseg/freeseg.c:33:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/lib/freeseg/freeseg.c:36:9: branch_false: ...to here
LVM2.2.03.38/lib/freeseg/freeseg.c:40:9: throw: if ‘print_log’ throws an exception...
LVM2.2.03.38/lib/freeseg/freeseg.c:40:9: danger: ‘calloc(1, 72)’ leaks here; was allocated at [(3)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/2)
#   38|   	segtype->flags = SEG_VIRTUAL | SEG_CANNOT_BE_ZEROED;
#   39|   
#   40|-> 	log_very_verbose("Initialised segtype: %s", segtype->name);
#   41|   
#   42|   	return segtype;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def332]
LVM2.2.03.38/lib/integrity/integrity.c:344:14: warning[-Wanalyzer-malloc-leak]: leak of ‘calloc(1, 72)’
LVM2.2.03.38/lib/integrity/integrity.c:330:5: enter_function: entry to ‘init_integrity_segtypes’
LVM2.2.03.38/lib/integrity/integrity.c:333:40: call_function: inlined call to ‘zalloc’ from ‘init_integrity_segtypes’
LVM2.2.03.38/lib/integrity/integrity.c:335:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/lib/integrity/integrity.c:340:9: branch_false: ...to here
LVM2.2.03.38/lib/integrity/integrity.c:344:14: throw: if ‘lvm_register_segtype’ throws an exception...
LVM2.2.03.38/lib/integrity/integrity.c:344:14: danger: ‘calloc(1, 72)’ leaks here; was allocated at [(3)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/2)
#  342|   	segtype->ops = &_integrity_ops;
#  343|   
#  344|-> 	if (!lvm_register_segtype(seglib, segtype))
#  345|   		return_0;
#  346|   	log_very_verbose("Initialised segtype: %s", segtype->name);

Error: GCC_ANALYZER_WARNING (CWE-775): [#def333]
LVM2.2.03.38/lib/label/hints.c:299:9: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(&_hints_file, "w")’
LVM2.2.03.38/lib/label/hints.c:1184:6: enter_function: entry to ‘clear_hint_file’
LVM2.2.03.38/lib/label/hints.c:1187:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/lib/label/hints.c:1190:9: branch_false: ...to here
LVM2.2.03.38/lib/label/hints.c:1207:14: call_function: calling ‘_clear_hints’ from ‘clear_hint_file’
#  297|   	t = time(NULL);
#  298|   
#  299|-> 	fprintf(fp, "# Created empty by %s pid %d %s", cmd->name, getpid(), ctime(&t));
#  300|   
#  301|   	if (fflush(fp))

Error: GCC_ANALYZER_WARNING (CWE-401): [#def334]
LVM2.2.03.38/lib/label/hints.c:299:9: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(&_hints_file, "w")’
LVM2.2.03.38/lib/label/hints.c:1184:6: enter_function: entry to ‘clear_hint_file’
LVM2.2.03.38/lib/label/hints.c:1187:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/lib/label/hints.c:1190:9: branch_false: ...to here
LVM2.2.03.38/lib/label/hints.c:1207:14: call_function: calling ‘_clear_hints’ from ‘clear_hint_file’
#  297|   	t = time(NULL);
#  298|   
#  299|-> 	fprintf(fp, "# Created empty by %s pid %d %s", cmd->name, getpid(), ctime(&t));
#  300|   
#  301|   	if (fflush(fp))

Error: GCC_ANALYZER_WARNING (CWE-775): [#def335]
LVM2.2.03.38/lib/label/hints.c:716:9: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(&_hints_file, "r")’
LVM2.2.03.38/lib/label/hints.c:713:20: acquire_resource: opened here
LVM2.2.03.38/lib/label/hints.c:713:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/lib/label/hints.c:716:9: branch_false: ...to here
LVM2.2.03.38/lib/label/hints.c:716:9: throw: if ‘print_log’ throws an exception...
LVM2.2.03.38/lib/label/hints.c:716:9: danger: ‘fopen(&_hints_file, "r")’ leaks here; was opened at [(1)](sarif:/runs/0/results/4/codeFlows/0/threadFlows/0/locations/0)
#  714|   		return 0;
#  715|   
#  716|-> 	log_debug("Reading hint file");
#  717|   
#  718|   	for (i = 0; i < HINT_LINE_WORDS; i++)

Error: GCC_ANALYZER_WARNING (CWE-401): [#def336]
LVM2.2.03.38/lib/label/hints.c:716:9: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(&_hints_file, "r")’
LVM2.2.03.38/lib/label/hints.c:713:20: acquire_memory: allocated here
LVM2.2.03.38/lib/label/hints.c:713:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/lib/label/hints.c:716:9: branch_false: ...to here
LVM2.2.03.38/lib/label/hints.c:716:9: throw: if ‘print_log’ throws an exception...
LVM2.2.03.38/lib/label/hints.c:716:9: danger: ‘fopen(&_hints_file, "r")’ leaks here; was allocated at [(1)](sarif:/runs/0/results/5/codeFlows/0/threadFlows/0/locations/0)
#  714|   		return 0;
#  715|   
#  716|-> 	log_debug("Reading hint file");
#  717|   
#  718|   	for (i = 0; i < HINT_LINE_WORDS; i++)

Error: GCC_ANALYZER_WARNING (CWE-775): [#def337]
LVM2.2.03.38/lib/label/hints.c:723:21: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(&_hints_file, "r")’
LVM2.2.03.38/lib/label/hints.c:713:20: acquire_resource: opened here
LVM2.2.03.38/lib/label/hints.c:713:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/lib/label/hints.c:716:9: branch_false: ...to here
LVM2.2.03.38/lib/label/hints.c:718:21: branch_true: following ‘true’ branch (when ‘i != 4’)...
LVM2.2.03.38/lib/label/hints.c:719:17: branch_true: ...to here
LVM2.2.03.38/lib/label/hints.c:721:16: branch_true: following ‘true’ branch...
LVM2.2.03.38/lib/label/hints.c:722:17: branch_true: ...to here
LVM2.2.03.38/lib/label/hints.c:726:20: branch_false: following ‘false’ branch (when ‘p’ is NULL)...
LVM2.2.03.38/lib/label/hints.c:740:22: branch_false: ...to here
LVM2.2.03.38/lib/label/hints.c:740:20: branch_true: following ‘true’ branch...
LVM2.2.03.38/lib/label/hints.c:741:29: branch_true: ...to here
LVM2.2.03.38/lib/label/hints.c:741:28: branch_true: following ‘true’ branch...
LVM2.2.03.38/lib/label/hints.c:742:33: branch_true: ...to here
LVM2.2.03.38/lib/label/hints.c:742:33: throw: if ‘print_log’ throws an exception...
LVM2.2.03.38/lib/label/hints.c:723:21: danger: ‘fopen(&_hints_file, "r")’ leaks here; was opened at [(1)](sarif:/runs/0/results/6/codeFlows/0/threadFlows/0/locations/0)
#  721|   	while (fgets(_hint_line, sizeof(_hint_line), fp)) {
#  722|   		memset(&hint, 0, sizeof(hint));
#  723|-> 		if (_hint_line[0] == '#')
#  724|   			continue;
#  725|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def338]
LVM2.2.03.38/lib/label/hints.c:723:21: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(&_hints_file, "r")’
LVM2.2.03.38/lib/label/hints.c:713:20: acquire_memory: allocated here
LVM2.2.03.38/lib/label/hints.c:713:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/lib/label/hints.c:716:9: branch_false: ...to here
LVM2.2.03.38/lib/label/hints.c:718:21: branch_true: following ‘true’ branch (when ‘i != 4’)...
LVM2.2.03.38/lib/label/hints.c:719:17: branch_true: ...to here
LVM2.2.03.38/lib/label/hints.c:721:16: branch_true: following ‘true’ branch...
LVM2.2.03.38/lib/label/hints.c:722:17: branch_true: ...to here
LVM2.2.03.38/lib/label/hints.c:726:20: branch_false: following ‘false’ branch (when ‘p’ is NULL)...
LVM2.2.03.38/lib/label/hints.c:740:22: branch_false: ...to here
LVM2.2.03.38/lib/label/hints.c:740:20: branch_true: following ‘true’ branch...
LVM2.2.03.38/lib/label/hints.c:741:29: branch_true: ...to here
LVM2.2.03.38/lib/label/hints.c:741:28: branch_true: following ‘true’ branch...
LVM2.2.03.38/lib/label/hints.c:742:33: branch_true: ...to here
LVM2.2.03.38/lib/label/hints.c:742:33: throw: if ‘print_log’ throws an exception...
LVM2.2.03.38/lib/label/hints.c:723:21: danger: ‘fopen(&_hints_file, "r")’ leaks here; was allocated at [(1)](sarif:/runs/0/results/7/codeFlows/0/threadFlows/0/locations/0)
#  721|   	while (fgets(_hint_line, sizeof(_hint_line), fp)) {
#  722|   		memset(&hint, 0, sizeof(hint));
#  723|-> 		if (_hint_line[0] == '#')
#  724|   			continue;
#  725|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def339]
LVM2.2.03.38/lib/label/hints.c:859:17: warning[-Wanalyzer-malloc-leak]: leak of ‘calloc(1, 4288)’
LVM2.2.03.38/lib/label/hints.c:691:12: enter_function: entry to ‘_read_hint_file’
LVM2.2.03.38/lib/label/hints.c:713:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/lib/label/hints.c:716:9: branch_false: ...to here
LVM2.2.03.38/lib/label/hints.c:718:21: branch_true: following ‘true’ branch (when ‘i != 4’)...
LVM2.2.03.38/lib/label/hints.c:719:17: branch_true: ...to here
LVM2.2.03.38/lib/label/hints.c:721:16: branch_true: following ‘true’ branch...
LVM2.2.03.38/lib/label/hints.c:722:17: branch_true: ...to here
LVM2.2.03.38/lib/label/hints.c:726:20: branch_false: following ‘false’ branch (when ‘p’ is NULL)...
LVM2.2.03.38/lib/label/hints.c:740:22: branch_false: ...to here
LVM2.2.03.38/lib/label/hints.c:740:20: branch_false: following ‘false’ branch...
LVM2.2.03.38/lib/label/hints.c:757:22: branch_false: ...to here
LVM2.2.03.38/lib/label/hints.c:757:20: branch_false: following ‘false’ branch...
LVM2.2.03.38/lib/label/hints.c:770:22: branch_false: ...to here
LVM2.2.03.38/lib/label/hints.c:770:20: branch_false: following ‘false’ branch...
LVM2.2.03.38/lib/label/hints.c:783:22: branch_false: ...to here
LVM2.2.03.38/lib/label/hints.c:783:20: branch_false: following ‘false’ branch...
LVM2.2.03.38/lib/label/hints.c:795:22: branch_false: ...to here
LVM2.2.03.38/lib/label/hints.c:795:20: branch_false: following ‘false’ branch...
LVM2.2.03.38/lib/label/hints.c:814:22: branch_false: ...to here
LVM2.2.03.38/lib/label/hints.c:814:20: branch_false: following ‘false’ branch...
LVM2.2.03.38/lib/label/hints.c:827:21: branch_false: ...to here
LVM2.2.03.38/lib/label/hints.c:827:20: branch_false: following ‘false’ branch...
LVM2.2.03.38/lib/label/hints.c:830:21: branch_false: ...to here
LVM2.2.03.38/lib/label/hints.c:830:20: branch_false: following ‘false’ branch...
LVM2.2.03.38/lib/label/hints.c:833:17: branch_false: ...to here
LVM2.2.03.38/lib/label/hints.c:853:36: call_function: inlined call to ‘zalloc’ from ‘_read_hint_file’
LVM2.2.03.38/lib/label/hints.c:853:20: branch_false: following ‘false’ branch...
LVM2.2.03.38/lib/label/hints.c:857:17: branch_false: ...to here
LVM2.2.03.38/lib/label/hints.c:859:17: throw: if ‘print_log’ throws an exception...
LVM2.2.03.38/lib/label/hints.c:859:17: danger: ‘calloc(1, 4288)’ leaks here; was allocated at [(28)](sarif:/runs/0/results/38/codeFlows/0/threadFlows/0/locations/27)
#  857|   		memcpy(alloc_hint, &hint, sizeof(hint));
#  858|   
#  859|-> 		log_debug("add hint %s %s %d:%d %s", hint.name, hint.pvid, major, minor, vgname);
#  860|   		dm_list_add(hints, &alloc_hint->list);
#  861|   		found++;

Error: GCC_ANALYZER_WARNING (CWE-775): [#def340]
LVM2.2.03.38/lib/label/hints.c:1009:13: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(&_hints_file, "w")’
LVM2.2.03.38/lib/label/hints.c:981:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/lib/label/hints.c:985:13: branch_false: ...to here
LVM2.2.03.38/lib/label/hints.c:996:20: branch_false: following ‘false’ branch (when ‘newhints != 4’)...
LVM2.2.03.38/lib/label/hints.c:1000:9: branch_false: ...to here
LVM2.2.03.38/lib/label/hints.c:1002:20: acquire_resource: opened here
LVM2.2.03.38/lib/label/hints.c:1002:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/lib/label/hints.c:1007:13: branch_false: ...to here
LVM2.2.03.38/lib/label/hints.c:1009:13: throw: if ‘lvmcache_has_duplicate_devs’ throws an exception...
LVM2.2.03.38/lib/label/hints.c:1009:13: danger: ‘fopen(&_hints_file, "w")’ leaks here; was opened at [(5)](sarif:/runs/0/results/39/codeFlows/0/threadFlows/0/locations/4)
# 1007|   	t = time(NULL);
# 1008|   
# 1009|-> 	if (lvmcache_has_duplicate_devs() || lvmcache_found_duplicate_vgnames()) {
# 1010|   		fprintf(fp, "# Created empty by %s pid %d %s", cmd->name, getpid(), ctime(&t));
# 1011|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def341]
LVM2.2.03.38/lib/label/hints.c:1009:13: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(&_hints_file, "w")’
LVM2.2.03.38/lib/label/hints.c:981:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/lib/label/hints.c:985:13: branch_false: ...to here
LVM2.2.03.38/lib/label/hints.c:996:20: branch_false: following ‘false’ branch (when ‘newhints != 4’)...
LVM2.2.03.38/lib/label/hints.c:1000:9: branch_false: ...to here
LVM2.2.03.38/lib/label/hints.c:1002:20: acquire_memory: allocated here
LVM2.2.03.38/lib/label/hints.c:1002:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/lib/label/hints.c:1007:13: branch_false: ...to here
LVM2.2.03.38/lib/label/hints.c:1009:13: throw: if ‘lvmcache_has_duplicate_devs’ throws an exception...
LVM2.2.03.38/lib/label/hints.c:1009:13: danger: ‘fopen(&_hints_file, "w")’ leaks here; was allocated at [(5)](sarif:/runs/0/results/40/codeFlows/0/threadFlows/0/locations/4)
# 1007|   	t = time(NULL);
# 1008|   
# 1009|-> 	if (lvmcache_has_duplicate_devs() || lvmcache_found_duplicate_vgnames()) {
# 1010|   		fprintf(fp, "# Created empty by %s pid %d %s", cmd->name, getpid(), ctime(&t));
# 1011|   

Error: GCC_ANALYZER_WARNING (CWE-775): [#def342]
LVM2.2.03.38/lib/label/hints.c:1009:46: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(&_hints_file, "w")’
LVM2.2.03.38/lib/label/hints.c:981:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/lib/label/hints.c:985:13: branch_false: ...to here
LVM2.2.03.38/lib/label/hints.c:996:20: branch_false: following ‘false’ branch (when ‘newhints != 4’)...
LVM2.2.03.38/lib/label/hints.c:1000:9: branch_false: ...to here
LVM2.2.03.38/lib/label/hints.c:1002:20: acquire_resource: opened here
LVM2.2.03.38/lib/label/hints.c:1002:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/lib/label/hints.c:1007:13: branch_false: ...to here
LVM2.2.03.38/lib/label/hints.c:1009:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/lib/label/hints.c:1009:46: branch_false: ...to here
LVM2.2.03.38/lib/label/hints.c:1009:46: throw: if ‘lvmcache_found_duplicate_vgnames’ throws an exception...
LVM2.2.03.38/lib/label/hints.c:1009:46: danger: ‘fopen(&_hints_file, "w")’ leaks here; was opened at [(5)](sarif:/runs/0/results/41/codeFlows/0/threadFlows/0/locations/4)
# 1007|   	t = time(NULL);
# 1008|   
# 1009|-> 	if (lvmcache_has_duplicate_devs() || lvmcache_found_duplicate_vgnames()) {
# 1010|   		fprintf(fp, "# Created empty by %s pid %d %s", cmd->name, getpid(), ctime(&t));
# 1011|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def343]
LVM2.2.03.38/lib/label/hints.c:1009:46: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(&_hints_file, "w")’
LVM2.2.03.38/lib/label/hints.c:981:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/lib/label/hints.c:985:13: branch_false: ...to here
LVM2.2.03.38/lib/label/hints.c:996:20: branch_false: following ‘false’ branch (when ‘newhints != 4’)...
LVM2.2.03.38/lib/label/hints.c:1000:9: branch_false: ...to here
LVM2.2.03.38/lib/label/hints.c:1002:20: acquire_memory: allocated here
LVM2.2.03.38/lib/label/hints.c:1002:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/lib/label/hints.c:1007:13: branch_false: ...to here
LVM2.2.03.38/lib/label/hints.c:1009:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/lib/label/hints.c:1009:46: branch_false: ...to here
LVM2.2.03.38/lib/label/hints.c:1009:46: throw: if ‘lvmcache_found_duplicate_vgnames’ throws an exception...
LVM2.2.03.38/lib/label/hints.c:1009:46: danger: ‘fopen(&_hints_file, "w")’ leaks here; was allocated at [(5)](sarif:/runs/0/results/42/codeFlows/0/threadFlows/0/locations/4)
# 1007|   	t = time(NULL);
# 1008|   
# 1009|-> 	if (lvmcache_has_duplicate_devs() || lvmcache_found_duplicate_vgnames()) {
# 1010|   		fprintf(fp, "# Created empty by %s pid %d %s", cmd->name, getpid(), ctime(&t));
# 1011|   

Error: GCC_ANALYZER_WARNING (CWE-775): [#def344]
LVM2.2.03.38/lib/label/hints.c:1010:17: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(&_hints_file, "w")’
LVM2.2.03.38/lib/label/hints.c:981:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/lib/label/hints.c:985:13: branch_false: ...to here
LVM2.2.03.38/lib/label/hints.c:996:20: branch_false: following ‘false’ branch (when ‘newhints != 4’)...
LVM2.2.03.38/lib/label/hints.c:1000:9: branch_false: ...to here
LVM2.2.03.38/lib/label/hints.c:1002:20: acquire_resource: opened here
LVM2.2.03.38/lib/label/hints.c:1002:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/lib/label/hints.c:1007:13: branch_false: ...to here
LVM2.2.03.38/lib/label/hints.c:1013:21: throw: if ‘lvmcache_has_duplicate_devs’ throws an exception...
LVM2.2.03.38/lib/label/hints.c:1010:17: danger: ‘fopen(&_hints_file, "w")’ leaks here; was opened at [(5)](sarif:/runs/0/results/43/codeFlows/0/threadFlows/0/locations/4)
# 1008|   
# 1009|   	if (lvmcache_has_duplicate_devs() || lvmcache_found_duplicate_vgnames()) {
# 1010|-> 		fprintf(fp, "# Created empty by %s pid %d %s", cmd->name, getpid(), ctime(&t));
# 1011|   
# 1012|   		/* leave a comment about why it's empty in case someone is curious */

Error: GCC_ANALYZER_WARNING (CWE-401): [#def345]
LVM2.2.03.38/lib/label/hints.c:1010:17: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(&_hints_file, "w")’
LVM2.2.03.38/lib/label/hints.c:981:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/lib/label/hints.c:985:13: branch_false: ...to here
LVM2.2.03.38/lib/label/hints.c:996:20: branch_false: following ‘false’ branch (when ‘newhints != 4’)...
LVM2.2.03.38/lib/label/hints.c:1000:9: branch_false: ...to here
LVM2.2.03.38/lib/label/hints.c:1002:20: acquire_memory: allocated here
LVM2.2.03.38/lib/label/hints.c:1002:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/lib/label/hints.c:1007:13: branch_false: ...to here
LVM2.2.03.38/lib/label/hints.c:1013:21: throw: if ‘lvmcache_has_duplicate_devs’ throws an exception...
LVM2.2.03.38/lib/label/hints.c:1010:17: danger: ‘fopen(&_hints_file, "w")’ leaks here; was allocated at [(5)](sarif:/runs/0/results/44/codeFlows/0/threadFlows/0/locations/4)
# 1008|   
# 1009|   	if (lvmcache_has_duplicate_devs() || lvmcache_found_duplicate_vgnames()) {
# 1010|-> 		fprintf(fp, "# Created empty by %s pid %d %s", cmd->name, getpid(), ctime(&t));
# 1011|   
# 1012|   		/* leave a comment about why it's empty in case someone is curious */

Error: GCC_ANALYZER_WARNING (CWE-775): [#def346]
LVM2.2.03.38/lib/label/hints.c:1020:9: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(&_hints_file, "w")’
LVM2.2.03.38/lib/label/hints.c:963:5: enter_function: entry to ‘write_hint_file’
LVM2.2.03.38/lib/label/hints.c:981:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/lib/label/hints.c:985:13: branch_false: ...to here
LVM2.2.03.38/lib/label/hints.c:996:20: branch_false: following ‘false’ branch (when ‘newhints != 4’)...
LVM2.2.03.38/lib/label/hints.c:1000:9: branch_false: ...to here
LVM2.2.03.38/lib/label/hints.c:1002:20: acquire_resource: opened here
LVM2.2.03.38/lib/label/hints.c:1002:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/lib/label/hints.c:1007:13: branch_false: ...to here
LVM2.2.03.38/lib/label/hints.c:1009:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/lib/label/hints.c:1023:9: call_function: calling ‘_filter_to_str’ from ‘write_hint_file’
# 1018|   	}
# 1019|   
# 1020|-> 	fprintf(fp, "# Created by %s pid %d %s", cmd->name, getpid(), ctime(&t));
# 1021|   	fprintf(fp, "hints_version: %d.%d\n", HINTS_VERSION_MAJOR, HINTS_VERSION_MINOR);
# 1022|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def347]
LVM2.2.03.38/lib/label/hints.c:1020:9: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(&_hints_file, "w")’
LVM2.2.03.38/lib/label/hints.c:963:5: enter_function: entry to ‘write_hint_file’
LVM2.2.03.38/lib/label/hints.c:981:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/lib/label/hints.c:985:13: branch_false: ...to here
LVM2.2.03.38/lib/label/hints.c:996:20: branch_false: following ‘false’ branch (when ‘newhints != 4’)...
LVM2.2.03.38/lib/label/hints.c:1000:9: branch_false: ...to here
LVM2.2.03.38/lib/label/hints.c:1002:20: acquire_memory: allocated here
LVM2.2.03.38/lib/label/hints.c:1002:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/lib/label/hints.c:1007:13: branch_false: ...to here
LVM2.2.03.38/lib/label/hints.c:1009:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/lib/label/hints.c:1023:9: call_function: calling ‘_filter_to_str’ from ‘write_hint_file’
# 1018|   	}
# 1019|   
# 1020|-> 	fprintf(fp, "# Created by %s pid %d %s", cmd->name, getpid(), ctime(&t));
# 1021|   	fprintf(fp, "hints_version: %d.%d\n", HINTS_VERSION_MAJOR, HINTS_VERSION_MINOR);
# 1022|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def348]
LVM2.2.03.38/lib/label/label.c:1735:9: warning[-Wanalyzer-malloc-leak]: leak of ‘calloc(1, 24)’
LVM2.2.03.38/lib/label/label.c:1725:5: enter_function: entry to ‘label_scan_dev’
LVM2.2.03.38/lib/label/label.c:1732:22: call_function: inlined call to ‘zalloc’ from ‘label_scan_dev’
LVM2.2.03.38/lib/label/label.c:1732:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/lib/label/label.c:1734:9: branch_false: ...to here
LVM2.2.03.38/lib/label/label.c:1735:9: throw: if ‘dm_list_init’ throws an exception...
LVM2.2.03.38/lib/label/label.c:1735:9: danger: ‘calloc(1, 24)’ leaks here; was allocated at [(3)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/2)
# 1733|   		return 0;
# 1734|   	devl->dev = dev;
# 1735|-> 	dm_list_init(&one_dev);
# 1736|   	dm_list_add(&one_dev, &devl->list);
# 1737|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def349]
LVM2.2.03.38/lib/label/label.c:1736:9: warning[-Wanalyzer-malloc-leak]: leak of ‘calloc(1, 24)’
LVM2.2.03.38/lib/label/label.c:1725:5: enter_function: entry to ‘label_scan_dev’
LVM2.2.03.38/lib/label/label.c:1732:22: call_function: inlined call to ‘zalloc’ from ‘label_scan_dev’
LVM2.2.03.38/lib/label/label.c:1732:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/lib/label/label.c:1734:9: branch_false: ...to here
LVM2.2.03.38/lib/label/label.c:1736:9: throw: if ‘dm_list_add’ throws an exception...
LVM2.2.03.38/lib/label/label.c:1736:9: danger: ‘calloc(1, 24)’ leaks here; was allocated at [(3)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/2)
# 1734|   	devl->dev = dev;
# 1735|   	dm_list_init(&one_dev);
# 1736|-> 	dm_list_add(&one_dev, &devl->list);
# 1737|   
# 1738|   	label_scan_invalidate(dev);

Error: GCC_ANALYZER_WARNING (CWE-404): [#def350]
LVM2.2.03.38/lib/locking/lvmlockd.c:388:9: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
LVM2.2.03.38/lib/locking/lvmlockd.c:967:12: enter_function: entry to ‘_init_vg’
LVM2.2.03.38/lib/locking/lvmlockd.c:981:17: call_function: calling ‘_lockd_send_with_pvs’ from ‘_init_vg’
#  386|   
#  387|   	va_start(ap, lock_pvs);
#  388|-> 	daemon_request_extend_v(req, ap);
#  389|   	va_end(ap);
#  390|   

Error: GCC_ANALYZER_WARNING (CWE-404): [#def351]
LVM2.2.03.38/lib/log/log.c:582:17: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
LVM2.2.03.38/lib/log/log.c:799:6: enter_function: entry to ‘print_log’
LVM2.2.03.38/lib/log/log.c:804:9: acquire_resource: ‘va_start’ called here
LVM2.2.03.38/lib/log/log.c:805:9: call_function: calling ‘_vprint_log’ from ‘print_log’
#  580|   
#  581|   	if (level <= _LOG_ERR)
#  582|-> 		init_error_message_produced(1);
#  583|   
#  584|   	trformat = _(format);

Error: GCC_ANALYZER_WARNING (CWE-404): [#def352]
LVM2.2.03.38/lib/log/log.c:729:29: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
LVM2.2.03.38/lib/log/log.c:809:6: enter_function: entry to ‘print_log_libdm’
LVM2.2.03.38/lib/log/log.c:827:9: call_function: calling ‘_vprint_log’ from ‘print_log_libdm’
#  727|   		switch (level) {
#  728|   		case _LOG_DEBUG:
#  729|-> 			if (verbose_level() < _LOG_DEBUG)
#  730|   				break;
#  731|   			if (!debug_class_is_logged(dm_errno_or_class))

Error: GCC_ANALYZER_WARNING (CWE-404): [#def353]
LVM2.2.03.38/lib/log/log.c:731:30: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
LVM2.2.03.38/lib/log/log.c:809:6: enter_function: entry to ‘print_log_libdm’
LVM2.2.03.38/lib/log/log.c:827:9: call_function: calling ‘_vprint_log’ from ‘print_log_libdm’
#  729|   			if (verbose_level() < _LOG_DEBUG)
#  730|   				break;
#  731|-> 			if (!debug_class_is_logged(dm_errno_or_class))
#  732|   				break;
#  733|   			if ((verbose_level() == level) &&

Error: GCC_ANALYZER_WARNING (CWE-404): [#def354]
LVM2.2.03.38/lib/log/log.c:733:30: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
LVM2.2.03.38/lib/log/log.c:809:6: enter_function: entry to ‘print_log_libdm’
LVM2.2.03.38/lib/log/log.c:827:9: call_function: calling ‘_vprint_log’ from ‘print_log_libdm’
#  731|   			if (!debug_class_is_logged(dm_errno_or_class))
#  732|   				break;
#  733|-> 			if ((verbose_level() == level) &&
#  734|   			    (strcmp("<backtrace>", format) == 0))
#  735|   				break;

Error: GCC_ANALYZER_WARNING (CWE-404): [#def355]
LVM2.2.03.38/lib/log/log.c:741:40: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
LVM2.2.03.38/lib/log/log.c:917:10: enter_function: entry to ‘log_journal_str_to_val’
LVM2.2.03.38/lib/log/log.c:919:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/lib/log/log.c:921:14: branch_false: ...to here
LVM2.2.03.38/lib/log/log.c:921:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/lib/log/log.c:923:14: branch_false: ...to here
LVM2.2.03.38/lib/log/log.c:923:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/lib/log/log.c:925:9: branch_false: ...to here
LVM2.2.03.38/lib/log/log.c:925:9: call_function: calling ‘print_log’ from ‘log_journal_str_to_val’
#  739|   			stream = (use_stderr || (level != _LOG_WARN)) ? err_stream : out_stream;
#  740|   			if (stream == err_stream)
#  741|-> 				(void) fflush(out_stream);
#  742|   			fprintf(stream, "%s%s%s", buf, _msg_prefix, indent_spaces);
#  743|   			vfprintf(stream, trformat, ap);

Error: GCC_ANALYZER_WARNING (CWE-404): [#def356]
LVM2.2.03.38/lib/log/log.c:791:17: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
LVM2.2.03.38/lib/log/log.c:809:6: enter_function: entry to ‘print_log_libdm’
LVM2.2.03.38/lib/log/log.c:827:9: call_function: calling ‘_vprint_log’ from ‘print_log_libdm’
#  789|   	if (_syslog && (_log_while_suspended || !critical_section())) {
#  790|   		va_copy(ap, orig_ap);
#  791|-> 		vsyslog(level, trformat, ap);
#  792|   		va_end(ap);
#  793|   	}

Error: COMPILER_WARNING: [#def357]
LVM2.2.03.38/lib/metadata/integrity_manip.c:535:38: warning[-Wunused-but-set-variable=]: variable ‘lbs_unknown’ set but not used
#  535 |         int lbs_4k = 0, lbs_512 = 0, lbs_unknown = 0;
#      |                                      ^~~~~~~~~~~
#  533|   	uint32_t area_count, s;
#  534|   	uint32_t revert_meta_lvs = 0;
#  535|-> 	int lbs_4k = 0, lbs_512 = 0, lbs_unknown = 0;
#  536|   	int pbs_4k = 0, pbs_512 = 0, pbs_unknown = 0;
#  537|   	int is_active;

Error: COMPILER_WARNING: [#def358]
LVM2.2.03.38/lib/metadata/integrity_manip.c: scope_hint: In function ‘lv_add_integrity_to_raid’
LVM2.2.03.38/lib/metadata/integrity_manip.c:536:38: warning[-Wunused-but-set-variable=]: variable ‘pbs_unknown’ set but not used
#  536 |         int pbs_4k = 0, pbs_512 = 0, pbs_unknown = 0;
#      |                                      ^~~~~~~~~~~
#  534|   	uint32_t revert_meta_lvs = 0;
#  535|   	int lbs_4k = 0, lbs_512 = 0, lbs_unknown = 0;
#  536|-> 	int pbs_4k = 0, pbs_512 = 0, pbs_unknown = 0;
#  537|   	int is_active;
#  538|   	int r;

Error: GCC_ANALYZER_WARNING (CWE-121): [#def359]
LVM2.2.03.38/lib/metadata/mirror.c:1739:9: warning[-Wanalyzer-out-of-bounds]: stack-based buffer overflow
LVM2.2.03.38/lib/metadata/mirror.c:1757:31: enter_function: entry to ‘_set_up_mirror_log’
LVM2.2.03.38/lib/metadata/mirror.c:1786:19: branch_false: following ‘false’ branch (when ‘lv_name’ is NULL)...
LVM2.2.03.38/lib/metadata/mirror.c:1798:24: branch_false: ...to here
LVM2.2.03.38/lib/metadata/mirror.c:1798:24: call_function: calling ‘_create_mirror_log’ from ‘_set_up_mirror_log’
LVM2.2.03.38/lib/metadata/mirror.c:1798:24: return_function: returning to ‘_set_up_mirror_log’ from ‘_create_mirror_log’
LVM2.2.03.38/lib/metadata/mirror.c:1798:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/lib/metadata/mirror.c:1803:12: branch_false: ...to here
LVM2.2.03.38/lib/metadata/mirror.c:1803:12: branch_true: following ‘true’ branch (when ‘log_count > 1’)...
LVM2.2.03.38/lib/metadata/mirror.c:1805:21: branch_true: ...to here
LVM2.2.03.38/lib/metadata/mirror.c:1805:20: branch_false: following ‘false’ branch...
LVM2.2.03.38/lib/metadata/mirror.c:1811:22: branch_false: ...to here
LVM2.2.03.38/lib/metadata/mirror.c:1811:22: call_function: calling ‘_form_mirror’ from ‘_set_up_mirror_log’
# 1737|   	 */
# 1738|   	img_lvs = alloca(sizeof(*img_lvs) * (mirrors + 1));
# 1739|-> 	memset(img_lvs, 0, sizeof(*img_lvs) * mirrors);
# 1740|   
# 1741|   	if (!_create_mimage_lvs(ah, mirrors, stripes, stripe_size, lv, img_lvs, log))

Error: COMPILER_WARNING: [#def360]
LVM2.2.03.38/lib/metadata/raid_manip.c: scope_hint: In function ‘_reorder_raid10_near_seg_areas’
LVM2.2.03.38/lib/metadata/raid_manip.c:769:18: warning[-Wunused-but-set-variable=]: variable ‘i’ set but not used
#  769 |         unsigned i = 0;
#      |                  ^
#  767|   	uint32_t data_copies = seg->data_copies;
#  768|   	uint32_t *idx, stripes = seg->area_count;
#  769|-> 	unsigned i = 0;
#  770|   
#  771|   	if (!stripes) {

Error: GCC_ANALYZER_WARNING (CWE-401): [#def361]
LVM2.2.03.38/lib/metadata/thin_manip.c:513:28: warning[-Wanalyzer-malloc-leak]: leak of ‘tmpfile()’
LVM2.2.03.38/lib/metadata/thin_manip.c:483:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/lib/metadata/thin_manip.c:490:14: branch_false: ...to here
LVM2.2.03.38/lib/metadata/thin_manip.c:490:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/lib/metadata/thin_manip.c:493:13: branch_false: ...to here
LVM2.2.03.38/lib/metadata/thin_manip.c:493:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/lib/metadata/thin_manip.c:498:14: branch_false: ...to here
LVM2.2.03.38/lib/metadata/thin_manip.c:498:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/lib/metadata/thin_manip.c:503:9: branch_false: ...to here
LVM2.2.03.38/lib/metadata/thin_manip.c:506:19: acquire_memory: allocated here
LVM2.2.03.38/lib/metadata/thin_manip.c:506:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/lib/metadata/thin_manip.c:512:16: branch_false: ...to here
LVM2.2.03.38/lib/metadata/thin_manip.c:512:16: throw: if ‘dm_snprintf’ throws an exception...
LVM2.2.03.38/lib/metadata/thin_manip.c:513:28: danger: ‘tmpfile()’ leaks here; was allocated at [(9)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/8)
#  511|   	/* Build path for 'thin_restore' app with this 'hidden/deleted' tmpfile */
#  512|   	(void) dm_snprintf(md_path, sizeof(md_path), "%s/%u/fd/%u",
#  513|-> 			   cmd->proc_dir, getpid(), fileno(f));
#  514|   
#  515|   	argv[++args] = "-i";

Error: GCC_ANALYZER_WARNING (CWE-775): [#def362]
LVM2.2.03.38/lib/metadata/vdo_manip.c:188:17: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘fd’
LVM2.2.03.38/lib/metadata/vdo_manip.c:167:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/lib/metadata/vdo_manip.c:173:19: branch_false: ...to here
LVM2.2.03.38/lib/metadata/vdo_manip.c:173:19: acquire_resource: opened here
LVM2.2.03.38/lib/metadata/vdo_manip.c:173:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/lib/metadata/vdo_manip.c:187:21: branch_false: ...to here
LVM2.2.03.38/lib/metadata/vdo_manip.c:187:12: branch_true: following ‘true’ branch (when ‘size < 0’)...
LVM2.2.03.38/lib/metadata/vdo_manip.c:188:17: branch_true: ...to here
LVM2.2.03.38/lib/metadata/vdo_manip.c:188:17: throw: if ‘print_log’ throws an exception...
LVM2.2.03.38/lib/metadata/vdo_manip.c:188:17: danger: ‘fd’ leaks here; was opened at [(3)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/2)
#  186|   
#  187|   	if ((size = read(fd, temp, sizeof(temp) - 1)) < 0) {
#  188|-> 		log_sys_debug("read", path);
#  189|   		goto bad;
#  190|   	}

Error: GCC_ANALYZER_WARNING (CWE-775): [#def363]
LVM2.2.03.38/lib/metadata/vdo_manip.c:195:17: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘fd’
LVM2.2.03.38/lib/metadata/vdo_manip.c:167:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/lib/metadata/vdo_manip.c:173:19: branch_false: ...to here
LVM2.2.03.38/lib/metadata/vdo_manip.c:173:19: acquire_resource: opened here
LVM2.2.03.38/lib/metadata/vdo_manip.c:173:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/lib/metadata/vdo_manip.c:187:21: branch_false: ...to here
LVM2.2.03.38/lib/metadata/vdo_manip.c:187:12: branch_false: following ‘false’ branch (when ‘size >= 0’)...
LVM2.2.03.38/lib/metadata/vdo_manip.c:191:9: branch_false: ...to here
LVM2.2.03.38/lib/metadata/vdo_manip.c:194:12: branch_true: following ‘true’ branch...
LVM2.2.03.38/lib/metadata/vdo_manip.c:195:17: branch_true: ...to here
LVM2.2.03.38/lib/metadata/vdo_manip.c:195:17: throw: if ‘print_log’ throws an exception...
LVM2.2.03.38/lib/metadata/vdo_manip.c:195:17: danger: ‘fd’ leaks here; was opened at [(3)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/2)
#  193|   	*value = strtoll(temp, NULL, 0);
#  194|   	if (errno) {
#  195|-> 		log_sys_debug("strtool", path);
#  196|   		goto bad;
#  197|   	}

Error: GCC_ANALYZER_WARNING (CWE-775): [#def364]
LVM2.2.03.38/lib/metadata/vdo_manip.c:201:24: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘fd’
LVM2.2.03.38/lib/metadata/vdo_manip.c:167:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/lib/metadata/vdo_manip.c:173:19: branch_false: ...to here
LVM2.2.03.38/lib/metadata/vdo_manip.c:173:19: acquire_resource: opened here
LVM2.2.03.38/lib/metadata/vdo_manip.c:173:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/lib/metadata/vdo_manip.c:187:21: branch_false: ...to here
LVM2.2.03.38/lib/metadata/vdo_manip.c:201:12: branch_true: following ‘true’ branch (when ‘fd >= 0’)...
LVM2.2.03.38/lib/metadata/vdo_manip.c:201:24: branch_true: ...to here
LVM2.2.03.38/lib/metadata/vdo_manip.c:201:24: throw: if ‘close’ throws an exception...
LVM2.2.03.38/lib/metadata/vdo_manip.c:201:24: danger: ‘fd’ leaks here; was opened at [(3)](sarif:/runs/0/results/2/codeFlows/0/threadFlows/0/locations/2)
#  199|   	r = 1;
#  200|   bad:
#  201|-> 	if (fd >= 0 && close(fd))
#  202|   		log_sys_debug("close", path);
#  203|   

Error: GCC_ANALYZER_WARNING (CWE-775): [#def365]
LVM2.2.03.38/lib/metadata/vdo_manip.c:712:31: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(&proc_meminfo, "r")’
LVM2.2.03.38/lib/metadata/vdo_manip.c:703:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/lib/metadata/vdo_manip.c:705:20: branch_false: ...to here
LVM2.2.03.38/lib/metadata/vdo_manip.c:705:20: acquire_resource: opened here
LVM2.2.03.38/lib/metadata/vdo_manip.c:703:13: branch_false: following ‘false’ branch...
LVM2.2.03.38/lib/metadata/vdo_manip.c:703:13: branch_false: ...to here
LVM2.2.03.38/lib/metadata/vdo_manip.c:708:16: branch_true: following ‘true’ branch...
LVM2.2.03.38/lib/metadata/vdo_manip.c:709:27: branch_true: ...to here
LVM2.2.03.38/lib/metadata/vdo_manip.c:709:20: branch_false: following ‘false’ branch (when ‘e’ is non-NULL)...
LVM2.2.03.38/lib/metadata/vdo_manip.c:712:20: branch_false: ...to here
LVM2.2.03.38/lib/metadata/vdo_manip.c:715:17: throw: if ‘dm_strncpy’ throws an exception...
LVM2.2.03.38/lib/metadata/vdo_manip.c:712:31: danger: ‘fopen(&proc_meminfo, "r")’ leaks here; was opened at [(3)](sarif:/runs/0/results/3/codeFlows/0/threadFlows/0/locations/2)
#  710|   			break;
#  711|   
#  712|-> 		if ((unsigned)(++e - line) > sizeof(namebuf))
#  713|   			continue; // something too long
#  714|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def366]
LVM2.2.03.38/lib/metadata/vdo_manip.c:712:31: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(&proc_meminfo, "r")’
LVM2.2.03.38/lib/metadata/vdo_manip.c:703:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/lib/metadata/vdo_manip.c:705:20: branch_false: ...to here
LVM2.2.03.38/lib/metadata/vdo_manip.c:705:20: acquire_memory: allocated here
LVM2.2.03.38/lib/metadata/vdo_manip.c:703:13: branch_false: following ‘false’ branch...
LVM2.2.03.38/lib/metadata/vdo_manip.c:703:13: branch_false: ...to here
LVM2.2.03.38/lib/metadata/vdo_manip.c:708:16: branch_true: following ‘true’ branch...
LVM2.2.03.38/lib/metadata/vdo_manip.c:709:27: branch_true: ...to here
LVM2.2.03.38/lib/metadata/vdo_manip.c:709:20: branch_false: following ‘false’ branch (when ‘e’ is non-NULL)...
LVM2.2.03.38/lib/metadata/vdo_manip.c:712:20: branch_false: ...to here
LVM2.2.03.38/lib/metadata/vdo_manip.c:715:17: throw: if ‘dm_strncpy’ throws an exception...
LVM2.2.03.38/lib/metadata/vdo_manip.c:712:31: danger: ‘fopen(&proc_meminfo, "r")’ leaks here; was allocated at [(3)](sarif:/runs/0/results/4/codeFlows/0/threadFlows/0/locations/2)
#  710|   			break;
#  711|   
#  712|-> 		if ((unsigned)(++e - line) > sizeof(namebuf))
#  713|   			continue; // something too long
#  714|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def367]
LVM2.2.03.38/lib/mirror/mirrored.c:531:24: warning[-Wanalyzer-malloc-leak]: leak of ‘calloc(1, 72)’
LVM2.2.03.38/lib/mirror/mirrored.c:514:22: enter_function: entry to ‘init_mirrored_segtype’
LVM2.2.03.38/lib/mirror/mirrored.c:520:40: call_function: inlined call to ‘zalloc’ from ‘init_mirrored_segtype’
LVM2.2.03.38/lib/mirror/mirrored.c:522:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/lib/mirror/mirrored.c:525:9: branch_false: ...to here
LVM2.2.03.38/lib/mirror/mirrored.c:531:24: throw: if ‘get_monitor_dso_path’ throws an exception...
LVM2.2.03.38/lib/mirror/mirrored.c:531:24: danger: ‘calloc(1, 72)’ leaks here; was allocated at [(3)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/2)
#  529|   #ifdef DEVMAPPER_SUPPORT
#  530|   #  ifdef DMEVENTD
#  531|-> 	segtype->dso = get_monitor_dso_path(cmd, dmeventd_mirror_library_CFG);
#  532|   
#  533|   	if (segtype->dso)

Error: GCC_ANALYZER_WARNING (CWE-401): [#def368]
LVM2.2.03.38/lib/mirror/mirrored.c:538:9: warning[-Wanalyzer-malloc-leak]: leak of ‘calloc(1, 72)’
LVM2.2.03.38/lib/mirror/mirrored.c:514:22: enter_function: entry to ‘init_mirrored_segtype’
LVM2.2.03.38/lib/mirror/mirrored.c:520:40: call_function: inlined call to ‘zalloc’ from ‘init_mirrored_segtype’
LVM2.2.03.38/lib/mirror/mirrored.c:522:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/lib/mirror/mirrored.c:525:9: branch_false: ...to here
LVM2.2.03.38/lib/mirror/mirrored.c:538:9: throw: if ‘print_log’ throws an exception...
LVM2.2.03.38/lib/mirror/mirrored.c:538:9: danger: ‘calloc(1, 72)’ leaks here; was allocated at [(3)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/2)
#  536|   #endif
#  537|   
#  538|-> 	log_very_verbose("Initialised segtype: %s", segtype->name);
#  539|   
#  540|   	return segtype;

Error: GCC_ANALYZER_WARNING (CWE-775): [#def369]
LVM2.2.03.38/lib/misc/lvm-exec.c:36:28: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘pipefd[0]’
LVM2.2.03.38/lib/misc/lvm-exec.c:144:7: enter_function: entry to ‘pipe_open’
LVM2.2.03.38/lib/misc/lvm-exec.c:154:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/lib/misc/lvm-exec.c:159:9: branch_false: ...to here
LVM2.2.03.38/lib/misc/lvm-exec.c:159:9: call_function: calling ‘_verbose_args’ from ‘pipe_open’
#   34|   	buf[0] = '\0';
#   35|   	for (i = 0; argv[i]; i++) {
#   36|-> 		if ((len = dm_snprintf(buf + pos, sz - pos,
#   37|   				       " %s", argv[i])) < 0)
#   38|   			/* Truncated */

Error: GCC_ANALYZER_WARNING (CWE-775): [#def370]
LVM2.2.03.38/lib/misc/lvm-exec.c:36:28: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘pipefd[1]’
LVM2.2.03.38/lib/misc/lvm-exec.c:144:7: enter_function: entry to ‘pipe_open’
LVM2.2.03.38/lib/misc/lvm-exec.c:154:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/lib/misc/lvm-exec.c:159:9: branch_false: ...to here
LVM2.2.03.38/lib/misc/lvm-exec.c:159:9: call_function: calling ‘_verbose_args’ from ‘pipe_open’
#   34|   	buf[0] = '\0';
#   35|   	for (i = 0; argv[i]; i++) {
#   36|-> 		if ((len = dm_snprintf(buf + pos, sz - pos,
#   37|   				       " %s", argv[i])) < 0)
#   38|   			/* Truncated */

Error: GCC_ANALYZER_WARNING (CWE-775): [#def371]
LVM2.2.03.38/lib/misc/lvm-exec.c:119:24: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘pipefd[0]’
LVM2.2.03.38/lib/misc/lvm-exec.c:144:7: enter_function: entry to ‘pipe_open’
LVM2.2.03.38/lib/misc/lvm-exec.c:154:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/lib/misc/lvm-exec.c:159:9: branch_false: ...to here
LVM2.2.03.38/lib/misc/lvm-exec.c:161:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/lib/misc/lvm-exec.c:170:12: branch_false: ...to here
LVM2.2.03.38/lib/misc/lvm-exec.c:170:12: branch_true: following ‘true’ branch...
LVM2.2.03.38/lib/misc/lvm-exec.c:172:22: branch_true: ...to here
LVM2.2.03.38/lib/misc/lvm-exec.c:172:22: call_function: calling ‘_reopen_fd_to_null’ from ‘pipe_open’
#  117|   	int r = 0;
#  118|   
#  119|-> 	if ((null_fd = open("/dev/null", O_RDWR)) == -1) {
#  120|   		log_sys_error("open", "/dev/null");
#  121|   		return 0;

Error: GCC_ANALYZER_WARNING (CWE-775): [#def372]
LVM2.2.03.38/lib/misc/lvm-exec.c:119:24: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘pipefd[1]’
LVM2.2.03.38/lib/misc/lvm-exec.c:144:7: enter_function: entry to ‘pipe_open’
LVM2.2.03.38/lib/misc/lvm-exec.c:154:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/lib/misc/lvm-exec.c:159:9: branch_false: ...to here
LVM2.2.03.38/lib/misc/lvm-exec.c:161:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/lib/misc/lvm-exec.c:170:12: branch_false: ...to here
LVM2.2.03.38/lib/misc/lvm-exec.c:170:12: branch_true: following ‘true’ branch...
LVM2.2.03.38/lib/misc/lvm-exec.c:172:22: branch_true: ...to here
LVM2.2.03.38/lib/misc/lvm-exec.c:172:22: call_function: calling ‘_reopen_fd_to_null’ from ‘pipe_open’
#  117|   	int r = 0;
#  118|   
#  119|-> 	if ((null_fd = open("/dev/null", O_RDWR)) == -1) {
#  120|   		log_sys_error("open", "/dev/null");
#  121|   		return 0;

Error: GCC_ANALYZER_WARNING (CWE-775): [#def373]
LVM2.2.03.38/lib/misc/lvm-exec.c:120:17: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘pipefd[0]’
LVM2.2.03.38/lib/misc/lvm-exec.c:144:7: enter_function: entry to ‘pipe_open’
LVM2.2.03.38/lib/misc/lvm-exec.c:154:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/lib/misc/lvm-exec.c:159:9: branch_false: ...to here
LVM2.2.03.38/lib/misc/lvm-exec.c:161:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/lib/misc/lvm-exec.c:170:12: branch_false: ...to here
LVM2.2.03.38/lib/misc/lvm-exec.c:170:12: branch_true: following ‘true’ branch...
LVM2.2.03.38/lib/misc/lvm-exec.c:172:22: branch_true: ...to here
LVM2.2.03.38/lib/misc/lvm-exec.c:172:22: call_function: calling ‘_reopen_fd_to_null’ from ‘pipe_open’
#  118|   
#  119|   	if ((null_fd = open("/dev/null", O_RDWR)) == -1) {
#  120|-> 		log_sys_error("open", "/dev/null");
#  121|   		return 0;
#  122|   	}

Error: GCC_ANALYZER_WARNING (CWE-775): [#def374]
LVM2.2.03.38/lib/misc/lvm-exec.c:120:17: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘pipefd[1]’
LVM2.2.03.38/lib/misc/lvm-exec.c:144:7: enter_function: entry to ‘pipe_open’
LVM2.2.03.38/lib/misc/lvm-exec.c:154:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/lib/misc/lvm-exec.c:159:9: branch_false: ...to here
LVM2.2.03.38/lib/misc/lvm-exec.c:161:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/lib/misc/lvm-exec.c:170:12: branch_false: ...to here
LVM2.2.03.38/lib/misc/lvm-exec.c:170:12: branch_true: following ‘true’ branch...
LVM2.2.03.38/lib/misc/lvm-exec.c:172:22: branch_true: ...to here
LVM2.2.03.38/lib/misc/lvm-exec.c:172:22: call_function: calling ‘_reopen_fd_to_null’ from ‘pipe_open’
#  118|   
#  119|   	if ((null_fd = open("/dev/null", O_RDWR)) == -1) {
#  120|-> 		log_sys_error("open", "/dev/null");
#  121|   		return 0;
#  122|   	}

Error: GCC_ANALYZER_WARNING (CWE-775): [#def375]
LVM2.2.03.38/lib/misc/lvm-exec.c:124:32: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘open("/dev/null", 2)’
LVM2.2.03.38/lib/misc/lvm-exec.c:119:24: acquire_resource: opened here
LVM2.2.03.38/lib/misc/lvm-exec.c:119:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/lib/misc/lvm-exec.c:124:12: branch_false: ...to here
LVM2.2.03.38/lib/misc/lvm-exec.c:124:12: branch_true: following ‘true’ branch...
LVM2.2.03.38/lib/misc/lvm-exec.c:124:32: branch_true: ...to here
LVM2.2.03.38/lib/misc/lvm-exec.c:124:32: throw: if ‘close’ throws an exception...
LVM2.2.03.38/lib/misc/lvm-exec.c:124:32: danger: ‘open("/dev/null", 2)’ leaks here; was opened at [(1)](sarif:/runs/0/results/6/codeFlows/0/threadFlows/0/locations/0)
#  122|   	}
#  123|   
#  124|-> 	if ((null_fd != fd) && close(fd)) {
#  125|   		log_sys_error("close", "");
#  126|   		goto out;

Error: GCC_ANALYZER_WARNING (CWE-775): [#def376]
LVM2.2.03.38/lib/misc/lvm-exec.c:124:32: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘pipefd[0]’
LVM2.2.03.38/lib/misc/lvm-exec.c:144:7: enter_function: entry to ‘pipe_open’
LVM2.2.03.38/lib/misc/lvm-exec.c:154:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/lib/misc/lvm-exec.c:159:9: branch_false: ...to here
LVM2.2.03.38/lib/misc/lvm-exec.c:161:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/lib/misc/lvm-exec.c:170:12: branch_false: ...to here
LVM2.2.03.38/lib/misc/lvm-exec.c:170:12: branch_true: following ‘true’ branch...
LVM2.2.03.38/lib/misc/lvm-exec.c:172:22: branch_true: ...to here
LVM2.2.03.38/lib/misc/lvm-exec.c:172:22: call_function: calling ‘_reopen_fd_to_null’ from ‘pipe_open’
#  122|   	}
#  123|   
#  124|-> 	if ((null_fd != fd) && close(fd)) {
#  125|   		log_sys_error("close", "");
#  126|   		goto out;

Error: GCC_ANALYZER_WARNING (CWE-775): [#def377]
LVM2.2.03.38/lib/misc/lvm-exec.c:124:32: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘pipefd[1]’
LVM2.2.03.38/lib/misc/lvm-exec.c:144:7: enter_function: entry to ‘pipe_open’
LVM2.2.03.38/lib/misc/lvm-exec.c:154:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/lib/misc/lvm-exec.c:159:9: branch_false: ...to here
LVM2.2.03.38/lib/misc/lvm-exec.c:161:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/lib/misc/lvm-exec.c:170:12: branch_false: ...to here
LVM2.2.03.38/lib/misc/lvm-exec.c:170:12: branch_true: following ‘true’ branch...
LVM2.2.03.38/lib/misc/lvm-exec.c:172:22: branch_true: ...to here
LVM2.2.03.38/lib/misc/lvm-exec.c:172:22: call_function: calling ‘_reopen_fd_to_null’ from ‘pipe_open’
#  122|   	}
#  123|   
#  124|-> 	if ((null_fd != fd) && close(fd)) {
#  125|   		log_sys_error("close", "");
#  126|   		goto out;

Error: GCC_ANALYZER_WARNING (CWE-775): [#def378]
LVM2.2.03.38/lib/misc/lvm-exec.c:125:17: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘open("/dev/null", 2)’
LVM2.2.03.38/lib/misc/lvm-exec.c:119:24: acquire_resource: opened here
LVM2.2.03.38/lib/misc/lvm-exec.c:119:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/lib/misc/lvm-exec.c:124:12: branch_false: ...to here
LVM2.2.03.38/lib/misc/lvm-exec.c:124:12: branch_true: following ‘true’ branch...
LVM2.2.03.38/lib/misc/lvm-exec.c:125:17: throw: if ‘print_log’ throws an exception...
LVM2.2.03.38/lib/misc/lvm-exec.c:125:17: danger: ‘open("/dev/null", 2)’ leaks here; was opened at [(1)](sarif:/runs/0/results/9/codeFlows/0/threadFlows/0/locations/0)
#  123|   
#  124|   	if ((null_fd != fd) && close(fd)) {
#  125|-> 		log_sys_error("close", "");
#  126|   		goto out;
#  127|   	}

Error: GCC_ANALYZER_WARNING (CWE-775): [#def379]
LVM2.2.03.38/lib/misc/lvm-exec.c:125:17: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘pipefd[0]’
LVM2.2.03.38/lib/misc/lvm-exec.c:144:7: enter_function: entry to ‘pipe_open’
LVM2.2.03.38/lib/misc/lvm-exec.c:154:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/lib/misc/lvm-exec.c:159:9: branch_false: ...to here
LVM2.2.03.38/lib/misc/lvm-exec.c:161:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/lib/misc/lvm-exec.c:170:12: branch_false: ...to here
LVM2.2.03.38/lib/misc/lvm-exec.c:170:12: branch_true: following ‘true’ branch...
LVM2.2.03.38/lib/misc/lvm-exec.c:172:22: branch_true: ...to here
LVM2.2.03.38/lib/misc/lvm-exec.c:172:22: call_function: calling ‘_reopen_fd_to_null’ from ‘pipe_open’
#  123|   
#  124|   	if ((null_fd != fd) && close(fd)) {
#  125|-> 		log_sys_error("close", "");
#  126|   		goto out;
#  127|   	}

Error: GCC_ANALYZER_WARNING (CWE-775): [#def380]
LVM2.2.03.38/lib/misc/lvm-exec.c:125:17: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘pipefd[1]’
LVM2.2.03.38/lib/misc/lvm-exec.c:144:7: enter_function: entry to ‘pipe_open’
LVM2.2.03.38/lib/misc/lvm-exec.c:154:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/lib/misc/lvm-exec.c:159:9: branch_false: ...to here
LVM2.2.03.38/lib/misc/lvm-exec.c:161:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/lib/misc/lvm-exec.c:170:12: branch_false: ...to here
LVM2.2.03.38/lib/misc/lvm-exec.c:170:12: branch_true: following ‘true’ branch...
LVM2.2.03.38/lib/misc/lvm-exec.c:172:22: branch_true: ...to here
LVM2.2.03.38/lib/misc/lvm-exec.c:172:22: call_function: calling ‘_reopen_fd_to_null’ from ‘pipe_open’
#  123|   
#  124|   	if ((null_fd != fd) && close(fd)) {
#  125|-> 		log_sys_error("close", "");
#  126|   		goto out;
#  127|   	}

Error: GCC_ANALYZER_WARNING (CWE-775): [#def381]
LVM2.2.03.38/lib/misc/lvm-exec.c:129:12: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘dup2(open("/dev/null", 2), fd)’
LVM2.2.03.38/lib/misc/lvm-exec.c:119:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/lib/misc/lvm-exec.c:124:12: branch_false: ...to here
LVM2.2.03.38/lib/misc/lvm-exec.c:124:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/lib/misc/lvm-exec.c:129:13: branch_false: ...to here
LVM2.2.03.38/lib/misc/lvm-exec.c:129:13: acquire_resource: opened here
LVM2.2.03.38/lib/misc/lvm-exec.c:129:12: danger: ‘dup2(open("/dev/null", 2), fd)’ leaks here; was opened at [(5)](sarif:/runs/0/results/13/codeFlows/0/threadFlows/0/locations/4)
#  127|   	}
#  128|   
#  129|-> 	if (dup2(null_fd, fd) == -1) {
#  130|   		log_sys_error("dup2", "");
#  131|   		goto out;

Error: GCC_ANALYZER_WARNING: [#def382]
LVM2.2.03.38/lib/misc/lvm-exec.c:129:13: warning[-Wanalyzer-fd-use-without-check]: ‘dup2’ on possibly invalid file descriptor ‘fd’
LVM2.2.03.38/lib/misc/lvm-exec.c:119:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/lib/misc/lvm-exec.c:124:12: branch_false: ...to here
LVM2.2.03.38/lib/misc/lvm-exec.c:124:12: branch_true: following ‘true’ branch...
LVM2.2.03.38/lib/misc/lvm-exec.c:124:32: branch_true: ...to here
LVM2.2.03.38/lib/misc/lvm-exec.c:124:32: release_resource: closed here
LVM2.2.03.38/lib/misc/lvm-exec.c:124:13: branch_false: following ‘false’ branch...
LVM2.2.03.38/lib/misc/lvm-exec.c:129:13: branch_false: ...to here
LVM2.2.03.38/lib/misc/lvm-exec.c:129:13: danger: ‘fd’ could be invalid
#  127|   	}
#  128|   
#  129|-> 	if (dup2(null_fd, fd) == -1) {
#  130|   		log_sys_error("dup2", "");
#  131|   		goto out;

Error: GCC_ANALYZER_WARNING (CWE-775): [#def383]
LVM2.2.03.38/lib/misc/lvm-exec.c:130:17: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘open("/dev/null", 2)’
LVM2.2.03.38/lib/misc/lvm-exec.c:119:24: acquire_resource: opened here
LVM2.2.03.38/lib/misc/lvm-exec.c:119:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/lib/misc/lvm-exec.c:124:12: branch_false: ...to here
LVM2.2.03.38/lib/misc/lvm-exec.c:124:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/lib/misc/lvm-exec.c:129:13: branch_false: ...to here
LVM2.2.03.38/lib/misc/lvm-exec.c:129:12: branch_true: following ‘true’ branch...
LVM2.2.03.38/lib/misc/lvm-exec.c:130:17: branch_true: ...to here
LVM2.2.03.38/lib/misc/lvm-exec.c:130:17: throw: if ‘print_log’ throws an exception...
LVM2.2.03.38/lib/misc/lvm-exec.c:130:17: danger: ‘open("/dev/null", 2)’ leaks here; was opened at [(1)](sarif:/runs/0/results/15/codeFlows/0/threadFlows/0/locations/0)
#  128|   
#  129|   	if (dup2(null_fd, fd) == -1) {
#  130|-> 		log_sys_error("dup2", "");
#  131|   		goto out;
#  132|   	}

Error: GCC_ANALYZER_WARNING (CWE-775): [#def384]
LVM2.2.03.38/lib/misc/lvm-exec.c:130:17: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘pipefd[0]’
LVM2.2.03.38/lib/misc/lvm-exec.c:144:7: enter_function: entry to ‘pipe_open’
LVM2.2.03.38/lib/misc/lvm-exec.c:154:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/lib/misc/lvm-exec.c:159:9: branch_false: ...to here
LVM2.2.03.38/lib/misc/lvm-exec.c:161:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/lib/misc/lvm-exec.c:170:12: branch_false: ...to here
LVM2.2.03.38/lib/misc/lvm-exec.c:170:12: branch_true: following ‘true’ branch...
LVM2.2.03.38/lib/misc/lvm-exec.c:172:22: branch_true: ...to here
LVM2.2.03.38/lib/misc/lvm-exec.c:172:22: call_function: calling ‘_reopen_fd_to_null’ from ‘pipe_open’
#  128|   
#  129|   	if (dup2(null_fd, fd) == -1) {
#  130|-> 		log_sys_error("dup2", "");
#  131|   		goto out;
#  132|   	}

Error: GCC_ANALYZER_WARNING (CWE-775): [#def385]
LVM2.2.03.38/lib/misc/lvm-exec.c:130:17: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘pipefd[1]’
LVM2.2.03.38/lib/misc/lvm-exec.c:144:7: enter_function: entry to ‘pipe_open’
LVM2.2.03.38/lib/misc/lvm-exec.c:154:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/lib/misc/lvm-exec.c:159:9: branch_false: ...to here
LVM2.2.03.38/lib/misc/lvm-exec.c:161:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/lib/misc/lvm-exec.c:170:12: branch_false: ...to here
LVM2.2.03.38/lib/misc/lvm-exec.c:170:12: branch_true: following ‘true’ branch...
LVM2.2.03.38/lib/misc/lvm-exec.c:172:22: branch_true: ...to here
LVM2.2.03.38/lib/misc/lvm-exec.c:172:22: call_function: calling ‘_reopen_fd_to_null’ from ‘pipe_open’
#  128|   
#  129|   	if (dup2(null_fd, fd) == -1) {
#  130|-> 		log_sys_error("dup2", "");
#  131|   		goto out;
#  132|   	}

Error: GCC_ANALYZER_WARNING (CWE-775): [#def386]
LVM2.2.03.38/lib/misc/lvm-exec.c:136:13: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘open("/dev/null", 2)’
LVM2.2.03.38/lib/misc/lvm-exec.c:119:24: acquire_resource: opened here
LVM2.2.03.38/lib/misc/lvm-exec.c:119:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/lib/misc/lvm-exec.c:124:12: branch_false: ...to here
LVM2.2.03.38/lib/misc/lvm-exec.c:124:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/lib/misc/lvm-exec.c:129:13: branch_false: ...to here
LVM2.2.03.38/lib/misc/lvm-exec.c:136:13: danger: ‘open("/dev/null", 2)’ leaks here; was opened at [(1)](sarif:/runs/0/results/19/codeFlows/0/threadFlows/0/locations/0)
#  134|   	r = 1;
#  135|   out:
#  136|-> 	if (close(null_fd)) {
#  137|   		log_sys_error("dup2", "");
#  138|   		return 0;

Error: GCC_ANALYZER_WARNING (CWE-775): [#def387]
LVM2.2.03.38/lib/misc/lvm-exec.c:136:13: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘pipefd[0]’
LVM2.2.03.38/lib/misc/lvm-exec.c:144:7: enter_function: entry to ‘pipe_open’
LVM2.2.03.38/lib/misc/lvm-exec.c:154:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/lib/misc/lvm-exec.c:159:9: branch_false: ...to here
LVM2.2.03.38/lib/misc/lvm-exec.c:161:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/lib/misc/lvm-exec.c:170:12: branch_false: ...to here
LVM2.2.03.38/lib/misc/lvm-exec.c:170:12: branch_true: following ‘true’ branch...
LVM2.2.03.38/lib/misc/lvm-exec.c:172:22: branch_true: ...to here
LVM2.2.03.38/lib/misc/lvm-exec.c:172:22: call_function: calling ‘_reopen_fd_to_null’ from ‘pipe_open’
#  134|   	r = 1;
#  135|   out:
#  136|-> 	if (close(null_fd)) {
#  137|   		log_sys_error("dup2", "");
#  138|   		return 0;

Error: GCC_ANALYZER_WARNING (CWE-775): [#def388]
LVM2.2.03.38/lib/misc/lvm-exec.c:136:13: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘pipefd[1]’
LVM2.2.03.38/lib/misc/lvm-exec.c:144:7: enter_function: entry to ‘pipe_open’
LVM2.2.03.38/lib/misc/lvm-exec.c:154:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/lib/misc/lvm-exec.c:159:9: branch_false: ...to here
LVM2.2.03.38/lib/misc/lvm-exec.c:161:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/lib/misc/lvm-exec.c:170:12: branch_false: ...to here
LVM2.2.03.38/lib/misc/lvm-exec.c:170:12: branch_true: following ‘true’ branch...
LVM2.2.03.38/lib/misc/lvm-exec.c:172:22: branch_true: ...to here
LVM2.2.03.38/lib/misc/lvm-exec.c:172:22: call_function: calling ‘_reopen_fd_to_null’ from ‘pipe_open’
#  134|   	r = 1;
#  135|   out:
#  136|-> 	if (close(null_fd)) {
#  137|   		log_sys_error("dup2", "");
#  138|   		return 0;

Error: GCC_ANALYZER_WARNING (CWE-775): [#def389]
LVM2.2.03.38/lib/misc/lvm-exec.c:159:9: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘pipefd[0]’
LVM2.2.03.38/lib/misc/lvm-exec.c:154:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/lib/misc/lvm-exec.c:159:9: branch_false: ...to here
LVM2.2.03.38/lib/misc/lvm-exec.c:159:9: throw: if ‘print_log’ throws an exception...
LVM2.2.03.38/lib/misc/lvm-exec.c:159:9: danger: ‘pipefd[0]’ leaks here
#  157|   	}
#  158|   
#  159|-> 	log_verbose("Piping:%s", _verbose_args(argv, buf, sizeof(buf)));
#  160|   
#  161|   	if ((pdata->pid = fork()) == -1) {

Error: GCC_ANALYZER_WARNING (CWE-775): [#def390]
LVM2.2.03.38/lib/misc/lvm-exec.c:159:9: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘pipefd[1]’
LVM2.2.03.38/lib/misc/lvm-exec.c:154:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/lib/misc/lvm-exec.c:159:9: branch_false: ...to here
LVM2.2.03.38/lib/misc/lvm-exec.c:159:9: throw: if ‘print_log’ throws an exception...
LVM2.2.03.38/lib/misc/lvm-exec.c:159:9: danger: ‘pipefd[1]’ leaks here
#  157|   	}
#  158|   
#  159|-> 	log_verbose("Piping:%s", _verbose_args(argv, buf, sizeof(buf)));
#  160|   
#  161|   	if ((pdata->pid = fork()) == -1) {

Error: GCC_ANALYZER_WARNING (CWE-775): [#def391]
LVM2.2.03.38/lib/misc/lvm-exec.c:162:17: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘pipefd[0]’
LVM2.2.03.38/lib/misc/lvm-exec.c:154:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/lib/misc/lvm-exec.c:159:9: branch_false: ...to here
LVM2.2.03.38/lib/misc/lvm-exec.c:161:12: branch_true: following ‘true’ branch...
LVM2.2.03.38/lib/misc/lvm-exec.c:162:17: branch_true: ...to here
LVM2.2.03.38/lib/misc/lvm-exec.c:162:17: throw: if ‘print_log’ throws an exception...
LVM2.2.03.38/lib/misc/lvm-exec.c:162:17: danger: ‘pipefd[0]’ leaks here
#  160|   
#  161|   	if ((pdata->pid = fork()) == -1) {
#  162|-> 		log_sys_error("fork", "");
#  163|   		if (close(pipefd[0]))
#  164|   			log_sys_debug("close", "STDOUT");

Error: GCC_ANALYZER_WARNING (CWE-775): [#def392]
LVM2.2.03.38/lib/misc/lvm-exec.c:162:17: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘pipefd[1]’
LVM2.2.03.38/lib/misc/lvm-exec.c:154:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/lib/misc/lvm-exec.c:159:9: branch_false: ...to here
LVM2.2.03.38/lib/misc/lvm-exec.c:161:12: branch_true: following ‘true’ branch...
LVM2.2.03.38/lib/misc/lvm-exec.c:162:17: branch_true: ...to here
LVM2.2.03.38/lib/misc/lvm-exec.c:162:17: throw: if ‘print_log’ throws an exception...
LVM2.2.03.38/lib/misc/lvm-exec.c:162:17: danger: ‘pipefd[1]’ leaks here
#  160|   
#  161|   	if ((pdata->pid = fork()) == -1) {
#  162|-> 		log_sys_error("fork", "");
#  163|   		if (close(pipefd[0]))
#  164|   			log_sys_debug("close", "STDOUT");

Error: GCC_ANALYZER_WARNING (CWE-775): [#def393]
LVM2.2.03.38/lib/misc/lvm-exec.c:163:21: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘pipefd[0]’
LVM2.2.03.38/lib/misc/lvm-exec.c:154:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/lib/misc/lvm-exec.c:159:9: branch_false: ...to here
LVM2.2.03.38/lib/misc/lvm-exec.c:161:12: branch_true: following ‘true’ branch...
LVM2.2.03.38/lib/misc/lvm-exec.c:162:17: branch_true: ...to here
LVM2.2.03.38/lib/misc/lvm-exec.c:163:21: throw: if ‘close’ throws an exception...
LVM2.2.03.38/lib/misc/lvm-exec.c:163:21: danger: ‘pipefd[0]’ leaks here
#  161|   	if ((pdata->pid = fork()) == -1) {
#  162|   		log_sys_error("fork", "");
#  163|-> 		if (close(pipefd[0]))
#  164|   			log_sys_debug("close", "STDOUT");
#  165|   		if (close(pipefd[1]))

Error: GCC_ANALYZER_WARNING (CWE-775): [#def394]
LVM2.2.03.38/lib/misc/lvm-exec.c:163:21: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘pipefd[1]’
LVM2.2.03.38/lib/misc/lvm-exec.c:154:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/lib/misc/lvm-exec.c:159:9: branch_false: ...to here
LVM2.2.03.38/lib/misc/lvm-exec.c:161:12: branch_true: following ‘true’ branch...
LVM2.2.03.38/lib/misc/lvm-exec.c:162:17: branch_true: ...to here
LVM2.2.03.38/lib/misc/lvm-exec.c:163:21: throw: if ‘close’ throws an exception...
LVM2.2.03.38/lib/misc/lvm-exec.c:163:21: danger: ‘pipefd[1]’ leaks here
#  161|   	if ((pdata->pid = fork()) == -1) {
#  162|   		log_sys_error("fork", "");
#  163|-> 		if (close(pipefd[0]))
#  164|   			log_sys_debug("close", "STDOUT");
#  165|   		if (close(pipefd[1]))

Error: GCC_ANALYZER_WARNING (CWE-775): [#def395]
LVM2.2.03.38/lib/misc/lvm-exec.c:164:25: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘pipefd[1]’
LVM2.2.03.38/lib/misc/lvm-exec.c:154:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/lib/misc/lvm-exec.c:159:9: branch_false: ...to here
LVM2.2.03.38/lib/misc/lvm-exec.c:161:12: branch_true: following ‘true’ branch...
LVM2.2.03.38/lib/misc/lvm-exec.c:162:17: branch_true: ...to here
LVM2.2.03.38/lib/misc/lvm-exec.c:163:20: branch_true: following ‘true’ branch...
LVM2.2.03.38/lib/misc/lvm-exec.c:164:25: branch_true: ...to here
LVM2.2.03.38/lib/misc/lvm-exec.c:164:25: throw: if ‘print_log’ throws an exception...
LVM2.2.03.38/lib/misc/lvm-exec.c:164:25: danger: ‘pipefd[1]’ leaks here
#  162|   		log_sys_error("fork", "");
#  163|   		if (close(pipefd[0]))
#  164|-> 			log_sys_debug("close", "STDOUT");
#  165|   		if (close(pipefd[1]))
#  166|   			log_sys_debug("close", "STDIN");

Error: GCC_ANALYZER_WARNING (CWE-775): [#def396]
LVM2.2.03.38/lib/misc/lvm-exec.c:165:21: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘pipefd[1]’
LVM2.2.03.38/lib/misc/lvm-exec.c:154:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/lib/misc/lvm-exec.c:159:9: branch_false: ...to here
LVM2.2.03.38/lib/misc/lvm-exec.c:161:12: branch_true: following ‘true’ branch...
LVM2.2.03.38/lib/misc/lvm-exec.c:162:17: branch_true: ...to here
LVM2.2.03.38/lib/misc/lvm-exec.c:165:21: throw: if ‘close’ throws an exception...
LVM2.2.03.38/lib/misc/lvm-exec.c:165:21: danger: ‘pipefd[1]’ leaks here
#  163|   		if (close(pipefd[0]))
#  164|   			log_sys_debug("close", "STDOUT");
#  165|-> 		if (close(pipefd[1]))
#  166|   			log_sys_debug("close", "STDIN");
#  167|   		return 0;

Error: GCC_ANALYZER_WARNING (CWE-775): [#def397]
LVM2.2.03.38/lib/misc/lvm-exec.c:190:13: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘pipefd[0]’
LVM2.2.03.38/lib/misc/lvm-exec.c:154:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/lib/misc/lvm-exec.c:159:9: branch_false: ...to here
LVM2.2.03.38/lib/misc/lvm-exec.c:161:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/lib/misc/lvm-exec.c:170:12: branch_false: ...to here
LVM2.2.03.38/lib/misc/lvm-exec.c:170:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/lib/misc/lvm-exec.c:190:13: branch_false: ...to here
LVM2.2.03.38/lib/misc/lvm-exec.c:190:13: throw: if ‘close’ throws an exception...
LVM2.2.03.38/lib/misc/lvm-exec.c:190:13: danger: ‘pipefd[0]’ leaks here
#  188|   
#  189|   	/* Parent -> reader */
#  190|-> 	if (close(pipefd[1 /*write*/])) {
#  191|   		log_sys_error("close", "STDOUT");
#  192|   		if (close(pipefd[0 /*read*/]))

Error: GCC_ANALYZER_WARNING (CWE-775): [#def398]
LVM2.2.03.38/lib/misc/lvm-exec.c:190:13: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘pipefd[1]’
LVM2.2.03.38/lib/misc/lvm-exec.c:154:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/lib/misc/lvm-exec.c:159:9: branch_false: ...to here
LVM2.2.03.38/lib/misc/lvm-exec.c:161:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/lib/misc/lvm-exec.c:170:12: branch_false: ...to here
LVM2.2.03.38/lib/misc/lvm-exec.c:170:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/lib/misc/lvm-exec.c:190:13: branch_false: ...to here
LVM2.2.03.38/lib/misc/lvm-exec.c:190:13: throw: if ‘close’ throws an exception...
LVM2.2.03.38/lib/misc/lvm-exec.c:190:13: danger: ‘pipefd[1]’ leaks here
#  188|   
#  189|   	/* Parent -> reader */
#  190|-> 	if (close(pipefd[1 /*write*/])) {
#  191|   		log_sys_error("close", "STDOUT");
#  192|   		if (close(pipefd[0 /*read*/]))

Error: GCC_ANALYZER_WARNING (CWE-775): [#def399]
LVM2.2.03.38/lib/misc/lvm-exec.c:191:17: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘pipefd[0]’
LVM2.2.03.38/lib/misc/lvm-exec.c:154:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/lib/misc/lvm-exec.c:159:9: branch_false: ...to here
LVM2.2.03.38/lib/misc/lvm-exec.c:161:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/lib/misc/lvm-exec.c:170:12: branch_false: ...to here
LVM2.2.03.38/lib/misc/lvm-exec.c:170:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/lib/misc/lvm-exec.c:190:13: branch_false: ...to here
LVM2.2.03.38/lib/misc/lvm-exec.c:190:12: branch_true: following ‘true’ branch...
LVM2.2.03.38/lib/misc/lvm-exec.c:191:17: branch_true: ...to here
LVM2.2.03.38/lib/misc/lvm-exec.c:191:17: throw: if ‘print_log’ throws an exception...
LVM2.2.03.38/lib/misc/lvm-exec.c:191:17: danger: ‘pipefd[0]’ leaks here
#  189|   	/* Parent -> reader */
#  190|   	if (close(pipefd[1 /*write*/])) {
#  191|-> 		log_sys_error("close", "STDOUT");
#  192|   		if (close(pipefd[0 /*read*/]))
#  193|   			log_sys_debug("close", "pipe[0]");

Error: GCC_ANALYZER_WARNING (CWE-775): [#def400]
LVM2.2.03.38/lib/misc/lvm-exec.c:192:21: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘pipefd[0]’
LVM2.2.03.38/lib/misc/lvm-exec.c:154:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/lib/misc/lvm-exec.c:159:9: branch_false: ...to here
LVM2.2.03.38/lib/misc/lvm-exec.c:161:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/lib/misc/lvm-exec.c:170:12: branch_false: ...to here
LVM2.2.03.38/lib/misc/lvm-exec.c:170:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/lib/misc/lvm-exec.c:190:13: branch_false: ...to here
LVM2.2.03.38/lib/misc/lvm-exec.c:190:12: branch_true: following ‘true’ branch...
LVM2.2.03.38/lib/misc/lvm-exec.c:191:17: branch_true: ...to here
LVM2.2.03.38/lib/misc/lvm-exec.c:192:21: throw: if ‘close’ throws an exception...
LVM2.2.03.38/lib/misc/lvm-exec.c:192:21: danger: ‘pipefd[0]’ leaks here
#  190|   	if (close(pipefd[1 /*write*/])) {
#  191|   		log_sys_error("close", "STDOUT");
#  192|-> 		if (close(pipefd[0 /*read*/]))
#  193|   			log_sys_debug("close", "pipe[0]");
#  194|   		return NULL;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def401]
LVM2.2.03.38/lib/misc/lvm-file.c:147:9: warning[-Wanalyzer-malloc-leak]: leak of ‘s’
LVM2.2.03.38/lib/misc/lvm-file.c:167:5: enter_function: entry to ‘dir_create_recursive’
LVM2.2.03.38/lib/misc/lvm-file.c:172:20: acquire_memory: allocated here
LVM2.2.03.38/lib/misc/lvm-file.c:173:12: branch_false: following ‘false’ branch (when ‘s’ is non-NULL)...
LVM2.2.03.38/lib/misc/lvm-file.c:173:12: branch_false: ...to here
LVM2.2.03.38/lib/misc/lvm-file.c:178:16: branch_true: following ‘true’ branch (when ‘s’ is non-NULL)...
LVM2.2.03.38/lib/misc/lvm-file.c:179:17: branch_true: ...to here
LVM2.2.03.38/lib/misc/lvm-file.c:180:20: branch_true: following ‘true’ branch...
LVM2.2.03.38/lib/misc/lvm-file.c:180:52: call_function: calling ‘_dir_create’ from ‘dir_create_recursive’
#  145|   	int r;
#  146|   
#  147|-> 	log_debug("Creating directory %s.", path);
#  148|   
#  149|   	dm_prepare_selinux_context(path, S_IFDIR);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def402]
LVM2.2.03.38/lib/misc/lvm-file.c:215:19: warning[-Wanalyzer-malloc-leak]: leak of ‘dir’
LVM2.2.03.38/lib/misc/lvm-file.c:199:21: acquire_memory: allocated here
LVM2.2.03.38/lib/misc/lvm-file.c:199:12: branch_false: following ‘false’ branch (when ‘dir’ is non-NULL)...
LVM2.2.03.38/lib/misc/lvm-file.c:204:14: branch_false: ...to here
LVM2.2.03.38/lib/misc/lvm-file.c:204:12: branch_true: following ‘true’ branch...
LVM2.2.03.38/lib/misc/lvm-file.c:205:27: branch_true: ...to here
LVM2.2.03.38/lib/misc/lvm-file.c:215:19: throw: if ‘open’ throws an exception...
LVM2.2.03.38/lib/misc/lvm-file.c:215:19: danger: ‘dir’ leaks here; was allocated at [(1)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/0)
#  213|   	}
#  214|   
#  215|-> 	if ((fd = open(dir, O_RDONLY)) == -1) {
#  216|   		log_sys_error("open", dir);
#  217|   		goto out;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def403]
LVM2.2.03.38/lib/misc/lvm-file.c:216:17: warning[-Wanalyzer-malloc-leak]: leak of ‘dir’
LVM2.2.03.38/lib/misc/lvm-file.c:199:21: acquire_memory: allocated here
LVM2.2.03.38/lib/misc/lvm-file.c:199:12: branch_false: following ‘false’ branch (when ‘dir’ is non-NULL)...
LVM2.2.03.38/lib/misc/lvm-file.c:204:14: branch_false: ...to here
LVM2.2.03.38/lib/misc/lvm-file.c:204:12: branch_true: following ‘true’ branch...
LVM2.2.03.38/lib/misc/lvm-file.c:205:27: branch_true: ...to here
LVM2.2.03.38/lib/misc/lvm-file.c:215:12: branch_true: following ‘true’ branch...
LVM2.2.03.38/lib/misc/lvm-file.c:216:17: branch_true: ...to here
LVM2.2.03.38/lib/misc/lvm-file.c:216:17: throw: if ‘print_log’ throws an exception...
LVM2.2.03.38/lib/misc/lvm-file.c:216:17: danger: ‘dir’ leaks here; was allocated at [(1)](sarif:/runs/0/results/2/codeFlows/0/threadFlows/0/locations/0)
#  214|   
#  215|   	if ((fd = open(dir, O_RDONLY)) == -1) {
#  216|-> 		log_sys_error("open", dir);
#  217|   		goto out;
#  218|   	}

Error: GCC_ANALYZER_WARNING (CWE-775): [#def404]
LVM2.2.03.38/lib/misc/lvm-file.c:220:13: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘open(dir, 0)’
LVM2.2.03.38/lib/misc/lvm-file.c:199:12: branch_false: following ‘false’ branch (when ‘dir’ is non-NULL)...
LVM2.2.03.38/lib/misc/lvm-file.c:204:14: branch_false: ...to here
LVM2.2.03.38/lib/misc/lvm-file.c:204:12: branch_true: following ‘true’ branch...
LVM2.2.03.38/lib/misc/lvm-file.c:205:27: branch_true: ...to here
LVM2.2.03.38/lib/misc/lvm-file.c:215:19: acquire_resource: opened here
LVM2.2.03.38/lib/misc/lvm-file.c:215:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/lib/misc/lvm-file.c:220:13: branch_false: ...to here
LVM2.2.03.38/lib/misc/lvm-file.c:220:13: throw: if ‘fsync’ throws an exception...
LVM2.2.03.38/lib/misc/lvm-file.c:220:13: danger: ‘open(dir, 0)’ leaks here; was opened at [(5)](sarif:/runs/0/results/3/codeFlows/0/threadFlows/0/locations/4)
#  218|   	}
#  219|   
#  220|-> 	if (fsync(fd) && (errno != EROFS) && (errno != EINVAL))
#  221|   		log_sys_error("fsync", dir);
#  222|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def405]
LVM2.2.03.38/lib/misc/lvm-file.c:220:13: warning[-Wanalyzer-malloc-leak]: leak of ‘dir’
LVM2.2.03.38/lib/misc/lvm-file.c:199:21: acquire_memory: allocated here
LVM2.2.03.38/lib/misc/lvm-file.c:199:12: branch_false: following ‘false’ branch (when ‘dir’ is non-NULL)...
LVM2.2.03.38/lib/misc/lvm-file.c:204:14: branch_false: ...to here
LVM2.2.03.38/lib/misc/lvm-file.c:204:12: branch_true: following ‘true’ branch...
LVM2.2.03.38/lib/misc/lvm-file.c:205:27: branch_true: ...to here
LVM2.2.03.38/lib/misc/lvm-file.c:215:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/lib/misc/lvm-file.c:220:13: branch_false: ...to here
LVM2.2.03.38/lib/misc/lvm-file.c:220:13: throw: if ‘fsync’ throws an exception...
LVM2.2.03.38/lib/misc/lvm-file.c:220:13: danger: ‘dir’ leaks here; was allocated at [(1)](sarif:/runs/0/results/4/codeFlows/0/threadFlows/0/locations/0)
#  218|   	}
#  219|   
#  220|-> 	if (fsync(fd) && (errno != EROFS) && (errno != EINVAL))
#  221|   		log_sys_error("fsync", dir);
#  222|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def406]
LVM2.2.03.38/lib/misc/lvm-file.c:221:17: warning[-Wanalyzer-malloc-leak]: leak of ‘dir’
LVM2.2.03.38/lib/misc/lvm-file.c:199:21: acquire_memory: allocated here
LVM2.2.03.38/lib/misc/lvm-file.c:199:12: branch_false: following ‘false’ branch (when ‘dir’ is non-NULL)...
LVM2.2.03.38/lib/misc/lvm-file.c:204:14: branch_false: ...to here
LVM2.2.03.38/lib/misc/lvm-file.c:204:12: branch_true: following ‘true’ branch...
LVM2.2.03.38/lib/misc/lvm-file.c:205:27: branch_true: ...to here
LVM2.2.03.38/lib/misc/lvm-file.c:215:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/lib/misc/lvm-file.c:220:13: branch_false: ...to here
LVM2.2.03.38/lib/misc/lvm-file.c:220:12: branch_true: following ‘true’ branch...
LVM2.2.03.38/lib/misc/lvm-file.c:221:17: throw: if ‘print_log’ throws an exception...
LVM2.2.03.38/lib/misc/lvm-file.c:221:17: danger: ‘dir’ leaks here; was allocated at [(1)](sarif:/runs/0/results/5/codeFlows/0/threadFlows/0/locations/0)
#  219|   
#  220|   	if (fsync(fd) && (errno != EROFS) && (errno != EINVAL))
#  221|-> 		log_sys_error("fsync", dir);
#  222|   
#  223|   	if (close(fd))

Error: GCC_ANALYZER_WARNING (CWE-401): [#def407]
LVM2.2.03.38/lib/misc/lvm-file.c:223:13: warning[-Wanalyzer-malloc-leak]: leak of ‘dir’
LVM2.2.03.38/lib/misc/lvm-file.c:199:21: acquire_memory: allocated here
LVM2.2.03.38/lib/misc/lvm-file.c:199:12: branch_false: following ‘false’ branch (when ‘dir’ is non-NULL)...
LVM2.2.03.38/lib/misc/lvm-file.c:204:14: branch_false: ...to here
LVM2.2.03.38/lib/misc/lvm-file.c:204:12: branch_true: following ‘true’ branch...
LVM2.2.03.38/lib/misc/lvm-file.c:205:27: branch_true: ...to here
LVM2.2.03.38/lib/misc/lvm-file.c:215:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/lib/misc/lvm-file.c:220:13: branch_false: ...to here
LVM2.2.03.38/lib/misc/lvm-file.c:223:13: throw: if ‘close’ throws an exception...
LVM2.2.03.38/lib/misc/lvm-file.c:223:13: danger: ‘dir’ leaks here; was allocated at [(1)](sarif:/runs/0/results/6/codeFlows/0/threadFlows/0/locations/0)
#  221|   		log_sys_error("fsync", dir);
#  222|   
#  223|-> 	if (close(fd))
#  224|   		log_sys_error("close", dir);
#  225|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def408]
LVM2.2.03.38/lib/misc/lvm-file.c:224:17: warning[-Wanalyzer-malloc-leak]: leak of ‘dir’
LVM2.2.03.38/lib/misc/lvm-file.c:199:21: acquire_memory: allocated here
LVM2.2.03.38/lib/misc/lvm-file.c:199:12: branch_false: following ‘false’ branch (when ‘dir’ is non-NULL)...
LVM2.2.03.38/lib/misc/lvm-file.c:204:14: branch_false: ...to here
LVM2.2.03.38/lib/misc/lvm-file.c:204:12: branch_true: following ‘true’ branch...
LVM2.2.03.38/lib/misc/lvm-file.c:205:27: branch_true: ...to here
LVM2.2.03.38/lib/misc/lvm-file.c:215:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/lib/misc/lvm-file.c:220:13: branch_false: ...to here
LVM2.2.03.38/lib/misc/lvm-file.c:223:12: branch_true: following ‘true’ branch...
LVM2.2.03.38/lib/misc/lvm-file.c:224:17: branch_true: ...to here
LVM2.2.03.38/lib/misc/lvm-file.c:224:17: throw: if ‘print_log’ throws an exception...
LVM2.2.03.38/lib/misc/lvm-file.c:224:17: danger: ‘dir’ leaks here; was allocated at [(1)](sarif:/runs/0/results/7/codeFlows/0/threadFlows/0/locations/0)
#  222|   
#  223|   	if (close(fd))
#  224|-> 		log_sys_error("close", dir);
#  225|   
#  226|         out:

Error: GCC_ANALYZER_WARNING (CWE-401): [#def409]
LVM2.2.03.38/lib/misc/lvm-file.c:251:14: warning[-Wanalyzer-malloc-leak]: leak of ‘dir’
LVM2.2.03.38/lib/misc/lvm-file.c:243:21: acquire_memory: allocated here
LVM2.2.03.38/lib/misc/lvm-file.c:243:12: branch_false: following ‘false’ branch (when ‘dir’ is non-NULL)...
LVM2.2.03.38/lib/misc/lvm-file.c:248:18: branch_false: ...to here
LVM2.2.03.38/lib/misc/lvm-file.c:248:12: branch_false: following ‘false’ branch (when ‘c’ is NULL)...
LVM2.2.03.38/lib/misc/lvm-file.c:251:14: branch_false: ...to here
LVM2.2.03.38/lib/misc/lvm-file.c:251:14: throw: if ‘dm_create_dir’ throws an exception...
LVM2.2.03.38/lib/misc/lvm-file.c:251:14: danger: ‘dir’ leaks here; was allocated at [(1)](sarif:/runs/0/results/8/codeFlows/0/threadFlows/0/locations/0)
#  249|   		*c = '\0';
#  250|   
#  251|-> 	if (!dm_create_dir(dir)) {
#  252|   		free(dir);
#  253|   		return -1;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def410]
LVM2.2.03.38/lib/misc/lvm-flock.c:113:9: warning[-Wanalyzer-malloc-leak]: leak of ‘ll’
LVM2.2.03.38/lib/misc/lvm-flock.c:179:5: enter_function: entry to ‘lock_file’
LVM2.2.03.38/lib/misc/lvm-flock.c:204:12: branch_false: following ‘false’ branch (when ‘convert == 0’)...
LVM2.2.03.38/lib/misc/lvm-flock.c:218:20: branch_false: ...to here
LVM2.2.03.38/lib/misc/lvm-flock.c:218:20: acquire_memory: allocated here
LVM2.2.03.38/lib/misc/lvm-flock.c:218:12: branch_false: following ‘false’ branch (when ‘ll’ is non-NULL)...
LVM2.2.03.38/lib/misc/lvm-flock.c:221:25: branch_false: ...to here
LVM2.2.03.38/lib/misc/lvm-flock.c:221:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/lib/misc/lvm-flock.c:226:9: branch_false: ...to here
LVM2.2.03.38/lib/misc/lvm-flock.c:232:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/lib/misc/lvm-flock.c:235:21: branch_false: ...to here
LVM2.2.03.38/lib/misc/lvm-flock.c:235:21: call_function: calling ‘_do_flock’ from ‘lock_file’
#  111|   	struct stat buf1, buf2;
#  112|   
#  113|-> 	log_debug_locking("_do_flock %s %c%c", file,
#  114|   			  operation == LOCK_EX ? 'W' : 'R', nonblock ? ' ' : 'B');
#  115|   	do {

Error: GCC_ANALYZER_WARNING (CWE-401): [#def411]
LVM2.2.03.38/lib/misc/lvm-flock.c:116:35: warning[-Wanalyzer-malloc-leak]: leak of ‘ll’
LVM2.2.03.38/lib/misc/lvm-flock.c:179:5: enter_function: entry to ‘lock_file’
LVM2.2.03.38/lib/misc/lvm-flock.c:204:12: branch_false: following ‘false’ branch (when ‘convert == 0’)...
LVM2.2.03.38/lib/misc/lvm-flock.c:218:20: branch_false: ...to here
LVM2.2.03.38/lib/misc/lvm-flock.c:218:20: acquire_memory: allocated here
LVM2.2.03.38/lib/misc/lvm-flock.c:218:12: branch_false: following ‘false’ branch (when ‘ll’ is non-NULL)...
LVM2.2.03.38/lib/misc/lvm-flock.c:221:25: branch_false: ...to here
LVM2.2.03.38/lib/misc/lvm-flock.c:221:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/lib/misc/lvm-flock.c:226:9: branch_false: ...to here
LVM2.2.03.38/lib/misc/lvm-flock.c:232:12: branch_true: following ‘true’ branch...
LVM2.2.03.38/lib/misc/lvm-flock.c:233:21: branch_true: ...to here
LVM2.2.03.38/lib/misc/lvm-flock.c:233:21: call_function: calling ‘_do_write_priority_flock’ from ‘lock_file’
#  114|   			  operation == LOCK_EX ? 'W' : 'R', nonblock ? ' ' : 'B');
#  115|   	do {
#  116|-> 		if ((*fd > -1) && close(*fd))
#  117|   			log_sys_debug("close", file);
#  118|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def412]
LVM2.2.03.38/lib/misc/lvm-flock.c:117:25: warning[-Wanalyzer-malloc-leak]: leak of ‘ll’
LVM2.2.03.38/lib/misc/lvm-flock.c:179:5: enter_function: entry to ‘lock_file’
LVM2.2.03.38/lib/misc/lvm-flock.c:204:12: branch_false: following ‘false’ branch (when ‘convert == 0’)...
LVM2.2.03.38/lib/misc/lvm-flock.c:218:20: branch_false: ...to here
LVM2.2.03.38/lib/misc/lvm-flock.c:218:20: acquire_memory: allocated here
LVM2.2.03.38/lib/misc/lvm-flock.c:218:12: branch_false: following ‘false’ branch (when ‘ll’ is non-NULL)...
LVM2.2.03.38/lib/misc/lvm-flock.c:221:25: branch_false: ...to here
LVM2.2.03.38/lib/misc/lvm-flock.c:221:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/lib/misc/lvm-flock.c:226:9: branch_false: ...to here
LVM2.2.03.38/lib/misc/lvm-flock.c:232:12: branch_true: following ‘true’ branch...
LVM2.2.03.38/lib/misc/lvm-flock.c:233:21: branch_true: ...to here
LVM2.2.03.38/lib/misc/lvm-flock.c:233:21: call_function: calling ‘_do_write_priority_flock’ from ‘lock_file’
#  115|   	do {
#  116|   		if ((*fd > -1) && close(*fd))
#  117|-> 			log_sys_debug("close", file);
#  118|   
#  119|   		if ((*fd = open(file, O_CREAT | O_APPEND | O_RDWR, 0777)) < 0) {

Error: GCC_ANALYZER_WARNING (CWE-401): [#def413]
LVM2.2.03.38/lib/misc/lvm-flock.c:119:28: warning[-Wanalyzer-malloc-leak]: leak of ‘ll’
LVM2.2.03.38/lib/misc/lvm-flock.c:179:5: enter_function: entry to ‘lock_file’
LVM2.2.03.38/lib/misc/lvm-flock.c:204:12: branch_false: following ‘false’ branch (when ‘convert == 0’)...
LVM2.2.03.38/lib/misc/lvm-flock.c:218:20: branch_false: ...to here
LVM2.2.03.38/lib/misc/lvm-flock.c:218:20: acquire_memory: allocated here
LVM2.2.03.38/lib/misc/lvm-flock.c:218:12: branch_false: following ‘false’ branch (when ‘ll’ is non-NULL)...
LVM2.2.03.38/lib/misc/lvm-flock.c:221:25: branch_false: ...to here
LVM2.2.03.38/lib/misc/lvm-flock.c:221:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/lib/misc/lvm-flock.c:226:9: branch_false: ...to here
LVM2.2.03.38/lib/misc/lvm-flock.c:232:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/lib/misc/lvm-flock.c:235:21: branch_false: ...to here
LVM2.2.03.38/lib/misc/lvm-flock.c:235:21: call_function: calling ‘_do_flock’ from ‘lock_file’
#  117|   			log_sys_debug("close", file);
#  118|   
#  119|-> 		if ((*fd = open(file, O_CREAT | O_APPEND | O_RDWR, 0777)) < 0) {
#  120|   			log_sys_error("open", file);
#  121|   			return 0;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def414]
LVM2.2.03.38/lib/misc/lvm-flock.c:132:25: warning[-Wanalyzer-malloc-leak]: leak of ‘ll’
LVM2.2.03.38/lib/misc/lvm-flock.c:179:5: enter_function: entry to ‘lock_file’
LVM2.2.03.38/lib/misc/lvm-flock.c:204:12: branch_false: following ‘false’ branch (when ‘convert == 0’)...
LVM2.2.03.38/lib/misc/lvm-flock.c:218:20: branch_false: ...to here
LVM2.2.03.38/lib/misc/lvm-flock.c:218:20: acquire_memory: allocated here
LVM2.2.03.38/lib/misc/lvm-flock.c:218:12: branch_false: following ‘false’ branch (when ‘ll’ is non-NULL)...
LVM2.2.03.38/lib/misc/lvm-flock.c:221:25: branch_false: ...to here
LVM2.2.03.38/lib/misc/lvm-flock.c:221:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/lib/misc/lvm-flock.c:226:9: branch_false: ...to here
LVM2.2.03.38/lib/misc/lvm-flock.c:232:12: branch_true: following ‘true’ branch...
LVM2.2.03.38/lib/misc/lvm-flock.c:233:21: branch_true: ...to here
LVM2.2.03.38/lib/misc/lvm-flock.c:233:21: call_function: calling ‘_do_write_priority_flock’ from ‘lock_file’
#  130|   		old_errno = errno;
#  131|   		if (!nonblock) {
#  132|-> 			sigint_restore();
#  133|   			if (sigint_caught()) {
#  134|   				log_error("Giving up waiting for lock.");

Error: GCC_ANALYZER_WARNING (CWE-401): [#def415]
LVM2.2.03.38/lib/misc/lvm-flock.c:133:29: warning[-Wanalyzer-malloc-leak]: leak of ‘ll’
LVM2.2.03.38/lib/misc/lvm-flock.c:179:5: enter_function: entry to ‘lock_file’
LVM2.2.03.38/lib/misc/lvm-flock.c:204:12: branch_false: following ‘false’ branch (when ‘convert == 0’)...
LVM2.2.03.38/lib/misc/lvm-flock.c:218:20: branch_false: ...to here
LVM2.2.03.38/lib/misc/lvm-flock.c:218:20: acquire_memory: allocated here
LVM2.2.03.38/lib/misc/lvm-flock.c:218:12: branch_false: following ‘false’ branch (when ‘ll’ is non-NULL)...
LVM2.2.03.38/lib/misc/lvm-flock.c:221:25: branch_false: ...to here
LVM2.2.03.38/lib/misc/lvm-flock.c:221:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/lib/misc/lvm-flock.c:226:9: branch_false: ...to here
LVM2.2.03.38/lib/misc/lvm-flock.c:232:12: branch_true: following ‘true’ branch...
LVM2.2.03.38/lib/misc/lvm-flock.c:233:21: branch_true: ...to here
LVM2.2.03.38/lib/misc/lvm-flock.c:233:21: call_function: calling ‘_do_write_priority_flock’ from ‘lock_file’
#  131|   		if (!nonblock) {
#  132|   			sigint_restore();
#  133|-> 			if (sigint_caught()) {
#  134|   				log_error("Giving up waiting for lock.");
#  135|   				break;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def416]
LVM2.2.03.38/lib/misc/lvm-flock.c:228:9: warning[-Wanalyzer-malloc-leak]: leak of ‘<unknown>’
LVM2.2.03.38/lib/misc/lvm-flock.c:204:12: branch_false: following ‘false’ branch (when ‘convert == 0’)...
LVM2.2.03.38/lib/misc/lvm-flock.c:218:20: branch_false: ...to here
LVM2.2.03.38/lib/misc/lvm-flock.c:218:12: branch_false: following ‘false’ branch (when ‘ll’ is non-NULL)...
LVM2.2.03.38/lib/misc/lvm-flock.c:221:25: branch_false: ...to here
LVM2.2.03.38/lib/misc/lvm-flock.c:221:25: acquire_memory: allocated here
LVM2.2.03.38/lib/misc/lvm-flock.c:221:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/lib/misc/lvm-flock.c:226:9: branch_false: ...to here
LVM2.2.03.38/lib/misc/lvm-flock.c:228:9: throw: if ‘print_log’ throws an exception...
LVM2.2.03.38/lib/misc/lvm-flock.c:228:9: danger: ‘<unknown>’ leaks here; was allocated at [(5)](sarif:/runs/0/results/7/codeFlows/0/threadFlows/0/locations/4)
#  226|   	ll->lf = -1;
#  227|   
#  228|-> 	log_very_verbose("Locking %s %c%c", ll->res, state,
#  229|   			 nonblock ? ' ' : 'B');
#  230|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def417]
LVM2.2.03.38/lib/misc/lvm-flock.c:228:9: warning[-Wanalyzer-malloc-leak]: leak of ‘ll’
LVM2.2.03.38/lib/misc/lvm-flock.c:204:12: branch_false: following ‘false’ branch (when ‘convert == 0’)...
LVM2.2.03.38/lib/misc/lvm-flock.c:218:20: branch_false: ...to here
LVM2.2.03.38/lib/misc/lvm-flock.c:218:20: acquire_memory: allocated here
LVM2.2.03.38/lib/misc/lvm-flock.c:218:12: branch_false: following ‘false’ branch (when ‘ll’ is non-NULL)...
LVM2.2.03.38/lib/misc/lvm-flock.c:221:25: branch_false: ...to here
LVM2.2.03.38/lib/misc/lvm-flock.c:221:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/lib/misc/lvm-flock.c:226:9: branch_false: ...to here
LVM2.2.03.38/lib/misc/lvm-flock.c:228:9: throw: if ‘print_log’ throws an exception...
LVM2.2.03.38/lib/misc/lvm-flock.c:228:9: danger: ‘ll’ leaks here; was allocated at [(3)](sarif:/runs/0/results/6/codeFlows/0/threadFlows/0/locations/2)
#  226|   	ll->lf = -1;
#  227|   
#  228|-> 	log_very_verbose("Locking %s %c%c", ll->res, state,
#  229|   			 nonblock ? ' ' : 'B');
#  230|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def418]
LVM2.2.03.38/lib/misc/lvm-flock.c:231:16: warning[-Wanalyzer-malloc-leak]: leak of ‘ll’
LVM2.2.03.38/lib/misc/lvm-flock.c:204:12: branch_false: following ‘false’ branch (when ‘convert == 0’)...
LVM2.2.03.38/lib/misc/lvm-flock.c:218:20: branch_false: ...to here
LVM2.2.03.38/lib/misc/lvm-flock.c:218:20: acquire_memory: allocated here
LVM2.2.03.38/lib/misc/lvm-flock.c:218:12: branch_false: following ‘false’ branch (when ‘ll’ is non-NULL)...
LVM2.2.03.38/lib/misc/lvm-flock.c:221:25: branch_false: ...to here
LVM2.2.03.38/lib/misc/lvm-flock.c:221:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/lib/misc/lvm-flock.c:226:9: branch_false: ...to here
LVM2.2.03.38/lib/misc/lvm-flock.c:231:16: throw: if ‘dm_prepare_selinux_context’ throws an exception...
LVM2.2.03.38/lib/misc/lvm-flock.c:231:16: danger: ‘ll’ leaks here; was allocated at [(3)](sarif:/runs/0/results/8/codeFlows/0/threadFlows/0/locations/2)
#  229|   			 nonblock ? ' ' : 'B');
#  230|   
#  231|-> 	(void) dm_prepare_selinux_context(file, S_IFREG);
#  232|   	if (_prioritise_write_locks)
#  233|   		r = _do_write_priority_flock(file, &ll->lf, operation, nonblock);

Error: GCC_ANALYZER_WARNING (CWE-775): [#def419]
LVM2.2.03.38/lib/misc/lvm-wrappers.c:123:13: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘open("/dev/urandom", 0)’
LVM2.2.03.38/lib/misc/lvm-wrappers.c:118:19: acquire_resource: opened here
LVM2.2.03.38/lib/misc/lvm-wrappers.c:118:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/lib/misc/lvm-wrappers.c:123:13: branch_false: ...to here
LVM2.2.03.38/lib/misc/lvm-wrappers.c:123:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/lib/misc/lvm-wrappers.c:130:13: branch_false: ...to here
LVM2.2.03.38/lib/misc/lvm-wrappers.c:123:13: danger: ‘open("/dev/urandom", 0)’ leaks here; was opened at [(1)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/0)
#  121|   	}
#  122|   
#  123|-> 	if (read(fd, buf, len) != (ssize_t) len) {
#  124|   		log_sys_error("read", "read_urandom: /dev/urandom");
#  125|   		if (close(fd))

Error: GCC_ANALYZER_WARNING (CWE-775): [#def420]
LVM2.2.03.38/lib/misc/util.h:42:16: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘socket(1, 1, 0)’
LVM2.2.03.38/libdaemon/client/daemon-client.c:25:15: enter_function: entry to ‘daemon_open’
LVM2.2.03.38/libdaemon/client/daemon-client.c:34:28: acquire_resource: stream socket created here
LVM2.2.03.38/libdaemon/client/daemon-client.c:34:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/libdaemon/client/daemon-client.c:40:14: call_function: inlined call to ‘_dm_strncpy’ from ‘daemon_open’
#   40|   	int _dm_strncpy(char *dest, const char *src, size_t n)
#   41|   {
#   42|-> 	return dm_strncpy(dest, src, n);
#   43|   }
#   44|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def421]
LVM2.2.03.38/lib/mm/memlock.c:152:27: warning[-Wanalyzer-malloc-leak]: leak of ‘malloc(_size_malloc_tmp)’
LVM2.2.03.38/lib/mm/memlock.c:607:13: enter_function: entry to ‘_lock_mem_if_needed’
LVM2.2.03.38/lib/mm/memlock.c:611:13: branch_true: following ‘true’ branch...
LVM2.2.03.38/lib/mm/memlock.c:613:17: branch_true: ...to here
LVM2.2.03.38/lib/mm/memlock.c:614:17: call_function: calling ‘_lock_mem’ from ‘_lock_mem_if_needed’
#  150|   static void _touch_memory(void *mem, size_t size)
#  151|   {
#  152|-> 	size_t pagesize = lvm_getpagesize();
#  153|   	char *pos = mem;
#  154|   	char *end = pos + size - sizeof(long);

Error: GCC_ANALYZER_WARNING (CWE-775): [#def422]
LVM2.2.03.38/lib/notify/lvmnotify.c:71:14: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘open(lockfile, 2)’
LVM2.2.03.38/lib/notify/lvmnotify.c:57:14: acquire_resource: opened here
LVM2.2.03.38/lib/notify/lvmnotify.c:58:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/lib/notify/lvmnotify.c:70:9: branch_false: ...to here
LVM2.2.03.38/lib/notify/lvmnotify.c:71:14: throw: if ‘lockf’ throws an exception...
LVM2.2.03.38/lib/notify/lvmnotify.c:71:14: danger: ‘open(lockfile, 2)’ leaks here; was opened at [(1)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/0)
#   69|   	/* Need to ensure we close lock FD now */
#   70|   	errno = 0;
#   71|-> 	rc = lockf(fd, F_TLOCK|F_TEST, 0);
#   72|   	if (-1 != rc) {
#   73|   		/* Not locked, thus not running */

Error: GCC_ANALYZER_WARNING (CWE-401): [#def423]
LVM2.2.03.38/lib/raid/raid.c:681:25: warning[-Wanalyzer-malloc-leak]: leak of ‘_init_raid_segtype(cmd, & _raid_types[i], get_monitor_dso_path(cmd, 285), monitored)’
LVM2.2.03.38/lib/raid/raid.c:699:5: enter_function: entry to ‘init_raid_segtypes’
LVM2.2.03.38/lib/raid/raid.c:721:21: branch_true: following ‘true’ branch (when ‘i != 21’)...
LVM2.2.03.38/lib/raid/raid.c:722:32: branch_true: ...to here
LVM2.2.03.38/lib/raid/raid.c:722:32: call_function: calling ‘_init_raid_segtype’ from ‘init_raid_segtypes’
LVM2.2.03.38/lib/raid/raid.c:722:32: return_function: returning to ‘init_raid_segtypes’ from ‘_init_raid_segtype’
LVM2.2.03.38/lib/raid/raid.c:722:20: branch_true: following ‘true’ branch...
LVM2.2.03.38/lib/raid/raid.c:723:22: branch_true: ...to here
LVM2.2.03.38/lib/raid/raid.c:681:25: danger: ‘_init_raid_segtype(cmd, & _raid_types[i], get_monitor_dso_path(cmd, 285), monitored)’ leaks here; was allocated at [(7)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/6)
#  679|   
#  680|   	segtype->ops = &_raid_ops;
#  681|-> 	segtype->name = rt->name;
#  682|   	segtype->flags = SEG_RAID | SEG_ONLY_EXCLUSIVE | rt->extra_flags;
#  683|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def424]
LVM2.2.03.38/lib/raid/raid.c:681:25: warning[-Wanalyzer-malloc-leak]: leak of ‘calloc(1, 72)’
LVM2.2.03.38/lib/raid/raid.c:667:29: enter_function: entry to ‘_init_raid_segtype’
LVM2.2.03.38/lib/raid/raid.c:672:40: call_function: inlined call to ‘zalloc’ from ‘_init_raid_segtype’
LVM2.2.03.38/lib/raid/raid.c:674:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/lib/raid/raid.c:680:9: branch_false: ...to here
LVM2.2.03.38/lib/raid/raid.c:693:9: throw: if ‘print_log’ throws an exception...
LVM2.2.03.38/lib/raid/raid.c:681:25: danger: ‘calloc(1, 72)’ leaks here; was allocated at [(3)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/2)
#  679|   
#  680|   	segtype->ops = &_raid_ops;
#  681|-> 	segtype->name = rt->name;
#  682|   	segtype->flags = SEG_RAID | SEG_ONLY_EXCLUSIVE | rt->extra_flags;
#  683|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def425]
LVM2.2.03.38/lib/raid/raid.c:693:9: warning[-Wanalyzer-malloc-leak]: leak of ‘dso’
LVM2.2.03.38/lib/raid/raid.c:674:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/lib/raid/raid.c:680:9: branch_false: ...to here
LVM2.2.03.38/lib/raid/raid.c:685:12: branch_true: following ‘true’ branch...
LVM2.2.03.38/lib/raid/raid.c:686:27: acquire_memory: allocated here
LVM2.2.03.38/lib/raid/raid.c:685:13: branch_true: following ‘true’ branch (when ‘dso’ is non-NULL)...
LVM2.2.03.38/lib/raid/raid.c:687:17: branch_true: ...to here
LVM2.2.03.38/lib/raid/raid.c:693:9: throw: if ‘print_log’ throws an exception...
LVM2.2.03.38/lib/raid/raid.c:693:9: danger: ‘dso’ leaks here; was allocated at [(5)](sarif:/runs/0/results/2/codeFlows/0/threadFlows/0/locations/4)
#  691|   	segtype->parity_devs = rt->parity;
#  692|   
#  693|-> 	log_very_verbose("Initialised segtype: %s", segtype->name);
#  694|   
#  695|   	return segtype;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def426]
LVM2.2.03.38/lib/snapshot/snapshot.c:266:24: warning[-Wanalyzer-malloc-leak]: leak of ‘calloc(1, 72)’
LVM2.2.03.38/lib/snapshot/snapshot.c:249:22: enter_function: entry to ‘init_snapshot_segtype’
LVM2.2.03.38/lib/snapshot/snapshot.c:255:40: call_function: inlined call to ‘zalloc’ from ‘init_snapshot_segtype’
LVM2.2.03.38/lib/snapshot/snapshot.c:257:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/lib/snapshot/snapshot.c:260:9: branch_false: ...to here
LVM2.2.03.38/lib/snapshot/snapshot.c:266:24: throw: if ‘get_monitor_dso_path’ throws an exception...
LVM2.2.03.38/lib/snapshot/snapshot.c:266:24: danger: ‘calloc(1, 72)’ leaks here; was allocated at [(3)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/2)
#  264|   #ifdef DEVMAPPER_SUPPORT
#  265|   #  ifdef DMEVENTD
#  266|-> 	segtype->dso = get_monitor_dso_path(cmd, dmeventd_snapshot_library_CFG);
#  267|   
#  268|   	if (segtype->dso)

Error: GCC_ANALYZER_WARNING (CWE-401): [#def427]
LVM2.2.03.38/lib/snapshot/snapshot.c:272:9: warning[-Wanalyzer-malloc-leak]: leak of ‘calloc(1, 72)’
LVM2.2.03.38/lib/snapshot/snapshot.c:249:22: enter_function: entry to ‘init_snapshot_segtype’
LVM2.2.03.38/lib/snapshot/snapshot.c:255:40: call_function: inlined call to ‘zalloc’ from ‘init_snapshot_segtype’
LVM2.2.03.38/lib/snapshot/snapshot.c:257:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/lib/snapshot/snapshot.c:260:9: branch_false: ...to here
LVM2.2.03.38/lib/snapshot/snapshot.c:272:9: throw: if ‘print_log’ throws an exception...
LVM2.2.03.38/lib/snapshot/snapshot.c:272:9: danger: ‘calloc(1, 72)’ leaks here; was allocated at [(3)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/2)
#  270|   #  endif	/* DMEVENTD */
#  271|   #endif
#  272|-> 	log_very_verbose("Initialised segtype: %s", segtype->name);
#  273|   
#  274|   	return segtype;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def428]
LVM2.2.03.38/lib/striped/striped.c:242:26: warning[-Wanalyzer-malloc-leak]: leak of ‘calloc(1, 72)’
LVM2.2.03.38/lib/striped/striped.c:233:29: enter_function: entry to ‘_init_segtype’
LVM2.2.03.38/lib/striped/striped.c:235:40: call_function: inlined call to ‘zalloc’ from ‘_init_segtype’
LVM2.2.03.38/lib/striped/striped.c:237:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/lib/striped/striped.c:240:9: branch_false: ...to here
LVM2.2.03.38/lib/striped/striped.c:244:9: throw: if ‘print_log’ throws an exception...
LVM2.2.03.38/lib/striped/striped.c:242:26: danger: ‘calloc(1, 72)’ leaks here; was allocated at [(3)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/2)
#  240|   	segtype->ops = &_striped_ops;
#  241|   	segtype->name = name;
#  242|-> 	segtype->flags = target | SEG_CAN_SPLIT | SEG_AREAS_STRIPED;
#  243|   
#  244|   	log_very_verbose("Initialised segtype: %s", segtype->name);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def429]
LVM2.2.03.38/lib/thin/thin.c:806:32: warning[-Wanalyzer-malloc-leak]: leak of ‘calloc(1, 72)’
LVM2.2.03.38/lib/thin/thin.c:777:5: enter_function: entry to ‘init_thin_segtypes’
LVM2.2.03.38/lib/thin/thin.c:797:21: branch_true: following ‘true’ branch (when ‘i != 2’)...
LVM2.2.03.38/lib/thin/thin.c:798:27: call_function: inlined call to ‘zalloc’ from ‘init_thin_segtypes’
LVM2.2.03.38/lib/thin/thin.c:800:20: branch_false: following ‘false’ branch...
LVM2.2.03.38/lib/thin/thin.c:806:32: branch_false: ...to here
LVM2.2.03.38/lib/thin/thin.c:812:32: throw: if ‘get_monitor_dso_path’ throws an exception...
LVM2.2.03.38/lib/thin/thin.c:806:32: danger: ‘calloc(1, 72)’ leaks here; was allocated at [(5)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/4)
#  804|   		}
#  805|   
#  806|-> 		segtype->ops = _reg_segtypes[i].ops;
#  807|   		segtype->name = _reg_segtypes[i].name;
#  808|   		segtype->flags = _reg_segtypes[i].flags;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def430]
LVM2.2.03.38/lib/unknown/unknown.c:72:17: warning[-Wanalyzer-malloc-leak]: leak of ‘calloc(1, 72)’
LVM2.2.03.38/lib/unknown/unknown.c:61:22: enter_function: entry to ‘init_unknown_segtype’
LVM2.2.03.38/lib/unknown/unknown.c:63:40: call_function: inlined call to ‘zalloc’ from ‘init_unknown_segtype’
LVM2.2.03.38/lib/unknown/unknown.c:65:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/lib/unknown/unknown.c:70:9: branch_false: ...to here
LVM2.2.03.38/lib/unknown/unknown.c:71:12: branch_true: following ‘true’ branch...
LVM2.2.03.38/lib/unknown/unknown.c:72:17: branch_true: ...to here
LVM2.2.03.38/lib/unknown/unknown.c:72:17: throw: if ‘print_log’ throws an exception...
LVM2.2.03.38/lib/unknown/unknown.c:72:17: danger: ‘calloc(1, 72)’ leaks here; was allocated at [(3)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/2)
#   70|   	segtype->ops = &_unknown_ops;
#   71|   	if (!(segtype->name = strdup(name))) {
#   72|-> 		log_error("Failed to allocate name.");
#   73|   		free(segtype);
#   74|   		return NULL;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def431]
LVM2.2.03.38/lib/unknown/unknown.c:79:9: warning[-Wanalyzer-malloc-leak]: leak of ‘<unknown>’
LVM2.2.03.38/lib/unknown/unknown.c:65:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/lib/unknown/unknown.c:70:9: branch_false: ...to here
LVM2.2.03.38/lib/unknown/unknown.c:71:31: acquire_memory: allocated here
LVM2.2.03.38/lib/unknown/unknown.c:71:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/lib/unknown/unknown.c:77:9: branch_false: ...to here
LVM2.2.03.38/lib/unknown/unknown.c:79:9: throw: if ‘print_log’ throws an exception...
LVM2.2.03.38/lib/unknown/unknown.c:79:9: danger: ‘<unknown>’ leaks here; was allocated at [(3)](sarif:/runs/0/results/2/codeFlows/0/threadFlows/0/locations/2)
#   77|   	segtype->flags = SEG_UNKNOWN | SEG_VIRTUAL | SEG_CANNOT_BE_ZEROED;
#   78|   
#   79|-> 	log_very_verbose("Initialised segtype: %s", segtype->name);
#   80|   
#   81|   	return segtype;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def432]
LVM2.2.03.38/lib/unknown/unknown.c:79:9: warning[-Wanalyzer-malloc-leak]: leak of ‘calloc(1, 72)’
LVM2.2.03.38/lib/unknown/unknown.c:61:22: enter_function: entry to ‘init_unknown_segtype’
LVM2.2.03.38/lib/unknown/unknown.c:63:40: call_function: inlined call to ‘zalloc’ from ‘init_unknown_segtype’
LVM2.2.03.38/lib/unknown/unknown.c:65:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/lib/unknown/unknown.c:70:9: branch_false: ...to here
LVM2.2.03.38/lib/unknown/unknown.c:71:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/lib/unknown/unknown.c:77:9: branch_false: ...to here
LVM2.2.03.38/lib/unknown/unknown.c:79:9: throw: if ‘print_log’ throws an exception...
LVM2.2.03.38/lib/unknown/unknown.c:79:9: danger: ‘calloc(1, 72)’ leaks here; was allocated at [(3)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/2)
#   77|   	segtype->flags = SEG_UNKNOWN | SEG_VIRTUAL | SEG_CANNOT_BE_ZEROED;
#   78|   
#   79|-> 	log_very_verbose("Initialised segtype: %s", segtype->name);
#   80|   
#   81|   	return segtype;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def433]
LVM2.2.03.38/lib/vdo/vdo.c:610:17: warning[-Wanalyzer-malloc-leak]: leak of ‘calloc(1, 72)’
LVM2.2.03.38/lib/vdo/vdo.c:603:5: enter_function: entry to ‘init_vdo_segtypes’
LVM2.2.03.38/lib/vdo/vdo.c:608:25: call_function: inlined call to ‘zalloc’ from ‘init_vdo_segtypes’
LVM2.2.03.38/lib/vdo/vdo.c:608:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/lib/vdo/vdo.c:609:30: call_function: inlined call to ‘zalloc’ from ‘init_vdo_segtypes’
LVM2.2.03.38/lib/vdo/vdo.c:608:13: branch_true: following ‘true’ branch...
LVM2.2.03.38/lib/vdo/vdo.c:610:17: branch_true: ...to here
LVM2.2.03.38/lib/vdo/vdo.c:610:17: throw: if ‘print_log’ throws an exception...
LVM2.2.03.38/lib/vdo/vdo.c:610:17: danger: ‘calloc(1, 72)’ leaks here; was allocated at [(3)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/2)
#  608|   	if (!(segtype = zalloc(sizeof(*segtype))) ||
#  609|   	    !(pool_segtype = zalloc(sizeof(*segtype)))) {
#  610|-> 		log_error("Failed to allocate memory for VDO segtypes.");
#  611|   		free(segtype);
#  612|   		return 0;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def434]
LVM2.2.03.38/lib/vdo/vdo.c:619:14: warning[-Wanalyzer-malloc-leak]: leak of ‘calloc(1, 72)’
LVM2.2.03.38/lib/vdo/vdo.c:603:5: enter_function: entry to ‘init_vdo_segtypes’
LVM2.2.03.38/lib/vdo/vdo.c:608:25: call_function: inlined call to ‘zalloc’ from ‘init_vdo_segtypes’
LVM2.2.03.38/lib/vdo/vdo.c:608:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/lib/vdo/vdo.c:609:30: call_function: inlined call to ‘zalloc’ from ‘init_vdo_segtypes’
LVM2.2.03.38/lib/vdo/vdo.c:608:13: branch_false: following ‘false’ branch...
LVM2.2.03.38/lib/vdo/vdo.c:615:9: branch_false: ...to here
LVM2.2.03.38/lib/vdo/vdo.c:619:14: throw: if ‘lvm_register_segtype’ throws an exception...
LVM2.2.03.38/lib/vdo/vdo.c:619:14: danger: ‘calloc(1, 72)’ leaks here; was allocated at [(3)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/2)
#  617|   	segtype->ops = &_vdo_ops;
#  618|   
#  619|-> 	if (!lvm_register_segtype(seglib, segtype)) {
#  620|   		free(pool_segtype);
#  621|   		return_0;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def435]
LVM2.2.03.38/lib/vdo/vdo.c:629:29: warning[-Wanalyzer-malloc-leak]: leak of ‘calloc(1, 72)’
LVM2.2.03.38/lib/vdo/vdo.c:603:5: enter_function: entry to ‘init_vdo_segtypes’
LVM2.2.03.38/lib/vdo/vdo.c:608:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/lib/vdo/vdo.c:609:30: call_function: inlined call to ‘zalloc’ from ‘init_vdo_segtypes’
LVM2.2.03.38/lib/vdo/vdo.c:608:13: branch_false: following ‘false’ branch...
LVM2.2.03.38/lib/vdo/vdo.c:615:9: branch_false: ...to here
LVM2.2.03.38/lib/vdo/vdo.c:619:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/lib/vdo/vdo.c:624:9: branch_false: ...to here
LVM2.2.03.38/lib/vdo/vdo.c:629:29: throw: if ‘get_monitor_dso_path’ throws an exception...
LVM2.2.03.38/lib/vdo/vdo.c:629:29: danger: ‘calloc(1, 72)’ leaks here; was allocated at [(5)](sarif:/runs/0/results/2/codeFlows/0/threadFlows/0/locations/4)
#  627|   #ifdef DEVMAPPER_SUPPORT
#  628|   #  ifdef DMEVENTD
#  629|-> 	pool_segtype->dso = get_monitor_dso_path(cmd, dmeventd_vdo_library_CFG);
#  630|   	if (pool_segtype->dso)
#  631|   		pool_segtype->flags |= SEG_MONITORED;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def436]
LVM2.2.03.38/lib/vdo/vdo.c:635:14: warning[-Wanalyzer-malloc-leak]: leak of ‘calloc(1, 72)’
LVM2.2.03.38/lib/vdo/vdo.c:603:5: enter_function: entry to ‘init_vdo_segtypes’
LVM2.2.03.38/lib/vdo/vdo.c:608:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/lib/vdo/vdo.c:609:30: call_function: inlined call to ‘zalloc’ from ‘init_vdo_segtypes’
LVM2.2.03.38/lib/vdo/vdo.c:608:13: branch_false: following ‘false’ branch...
LVM2.2.03.38/lib/vdo/vdo.c:615:9: branch_false: ...to here
LVM2.2.03.38/lib/vdo/vdo.c:619:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/lib/vdo/vdo.c:624:9: branch_false: ...to here
LVM2.2.03.38/lib/vdo/vdo.c:635:14: throw: if ‘lvm_register_segtype’ throws an exception...
LVM2.2.03.38/lib/vdo/vdo.c:635:14: danger: ‘calloc(1, 72)’ leaks here; was allocated at [(5)](sarif:/runs/0/results/3/codeFlows/0/threadFlows/0/locations/4)
#  633|   #endif
#  634|   
#  635|-> 	if (!lvm_register_segtype(seglib, pool_segtype))
#  636|   		return_0;
#  637|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def437]
LVM2.2.03.38/lib/writecache/writecache.c:386:14: warning[-Wanalyzer-malloc-leak]: leak of ‘calloc(1, 72)’
LVM2.2.03.38/lib/writecache/writecache.c:372:5: enter_function: entry to ‘init_writecache_segtypes’
LVM2.2.03.38/lib/writecache/writecache.c:375:40: call_function: inlined call to ‘zalloc’ from ‘init_writecache_segtypes’
LVM2.2.03.38/lib/writecache/writecache.c:377:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/lib/writecache/writecache.c:382:9: branch_false: ...to here
LVM2.2.03.38/lib/writecache/writecache.c:386:14: throw: if ‘lvm_register_segtype’ throws an exception...
LVM2.2.03.38/lib/writecache/writecache.c:386:14: danger: ‘calloc(1, 72)’ leaks here; was allocated at [(3)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/2)
#  384|   	segtype->ops = &_writecache_ops;
#  385|   
#  386|-> 	if (!lvm_register_segtype(seglib, segtype))
#  387|   		return_0;
#  388|   	log_very_verbose("Initialised segtype: %s", segtype->name);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def438]
LVM2.2.03.38/lib/zero/zero.c:99:9: warning[-Wanalyzer-malloc-leak]: leak of ‘calloc(1, 72)’
LVM2.2.03.38/lib/zero/zero.c:88:22: enter_function: entry to ‘init_zero_segtype’
LVM2.2.03.38/lib/zero/zero.c:90:40: call_function: inlined call to ‘zalloc’ from ‘init_zero_segtype’
LVM2.2.03.38/lib/zero/zero.c:92:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/lib/zero/zero.c:95:9: branch_false: ...to here
LVM2.2.03.38/lib/zero/zero.c:99:9: throw: if ‘print_log’ throws an exception...
LVM2.2.03.38/lib/zero/zero.c:99:9: danger: ‘calloc(1, 72)’ leaks here; was allocated at [(3)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/2)
#   97|   	segtype->flags = SEG_CAN_SPLIT | SEG_VIRTUAL | SEG_CANNOT_BE_ZEROED;
#   98|   
#   99|-> 	log_very_verbose("Initialised segtype: %s", segtype->name);
#  100|   
#  101|   	return segtype;

Error: GCC_ANALYZER_WARNING (CWE-775): [#def439]
LVM2.2.03.38/libdaemon/client/daemon-client.c:41:17: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘socket(1, 1, 0)’
LVM2.2.03.38/libdaemon/client/daemon-client.c:25:15: enter_function: entry to ‘daemon_open’
LVM2.2.03.38/libdaemon/client/daemon-client.c:34:28: acquire_resource: stream socket created here
LVM2.2.03.38/libdaemon/client/daemon-client.c:34:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/libdaemon/client/daemon-client.c:40:14: call_function: inlined call to ‘_dm_strncpy’ from ‘daemon_open’
LVM2.2.03.38/libdaemon/client/daemon-client.c:40:12: branch_true: following ‘true’ branch...
LVM2.2.03.38/libdaemon/client/daemon-client.c:41:17: branch_true: ...to here
LVM2.2.03.38/libdaemon/client/daemon-client.c:41:17: throw: if the called function throws an exception...
LVM2.2.03.38/libdaemon/client/daemon-client.c:41:17: danger: ‘socket(1, 1, 0)’ leaks here
#   39|   
#   40|   	if (!_dm_strncpy(sockaddr.sun_path, i.socket, sizeof(sockaddr.sun_path))) {
#   41|-> 		log_error("%s: Daemon socket path too long.", i.socket);
#   42|   		goto error;
#   43|   	}

Error: GCC_ANALYZER_WARNING (CWE-775): [#def440]
LVM2.2.03.38/libdaemon/client/daemon-client.c:45:13: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘socket(1, 1, 0)’
LVM2.2.03.38/libdaemon/client/daemon-client.c:25:15: enter_function: entry to ‘daemon_open’
LVM2.2.03.38/libdaemon/client/daemon-client.c:34:28: acquire_resource: stream socket created here
LVM2.2.03.38/libdaemon/client/daemon-client.c:34:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/libdaemon/client/daemon-client.c:40:14: call_function: inlined call to ‘_dm_strncpy’ from ‘daemon_open’
LVM2.2.03.38/libdaemon/client/daemon-client.c:40:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/libdaemon/client/daemon-client.c:45:13: branch_false: ...to here
LVM2.2.03.38/libdaemon/client/daemon-client.c:45:13: throw: if ‘connect’ throws an exception...
LVM2.2.03.38/libdaemon/client/daemon-client.c:45:13: danger: ‘socket(1, 1, 0)’ leaks here
#   43|   	}
#   44|   
#   45|-> 	if (connect(h.socket_fd,(struct sockaddr *) &sockaddr, sizeof(sockaddr))) {
#   46|   		h.error = errno;
#   47|   		log_debug("socket connect error %d for %s", h.error, i.socket);

Error: GCC_ANALYZER_WARNING (CWE-775): [#def441]
LVM2.2.03.38/libdaemon/client/daemon-client.c:80:33: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘socket(1, 1, 0)’
LVM2.2.03.38/libdaemon/client/daemon-client.c:25:15: enter_function: entry to ‘daemon_open’
LVM2.2.03.38/libdaemon/client/daemon-client.c:34:28: acquire_resource: stream socket created here
LVM2.2.03.38/libdaemon/client/daemon-client.c:34:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/libdaemon/client/daemon-client.c:40:14: call_function: inlined call to ‘_dm_strncpy’ from ‘daemon_open’
LVM2.2.03.38/libdaemon/client/daemon-client.c:40:12: branch_true: following ‘true’ branch...
LVM2.2.03.38/libdaemon/client/daemon-client.c:41:17: branch_true: ...to here
LVM2.2.03.38/libdaemon/client/daemon-client.c:80:12: branch_true: following ‘true’ branch...
LVM2.2.03.38/libdaemon/client/daemon-client.c:80:33: branch_true: ...to here
LVM2.2.03.38/libdaemon/client/daemon-client.c:80:33: danger: ‘socket(1, 1, 0)’ leaks here
#   78|   
#   79|   error:
#   80|-> 	if (h.socket_fd >= 0 && close(h.socket_fd))
#   81|   		log_sys_error("close", "daemon_open");
#   82|   	h.socket_fd = -1;

Error: GCC_ANALYZER_WARNING (CWE-404): [#def442]
LVM2.2.03.38/libdaemon/client/daemon-client.c:149:14: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
LVM2.2.03.38/libdaemon/client/daemon-client.c:148:9: acquire_resource: ‘va_copy’ called here
LVM2.2.03.38/libdaemon/client/daemon-client.c:149:14: throw: if ‘buffer_append_f’ throws an exception...
LVM2.2.03.38/libdaemon/client/daemon-client.c:149:14: danger: missing call to ‘va_end’ to match ‘va_copy’ at [(1)](sarif:/runs/0/results/4/codeFlows/0/threadFlows/0/locations/0)
#  147|   
#  148|   	va_copy(apc, ap);
#  149|-> 	if (!buffer_append_f(&rq.buffer, "request = %s", id, NULL) ||
#  150|   	    !buffer_append_vf(&rq.buffer, apc)) {
#  151|   		va_end(apc);

Error: GCC_ANALYZER_WARNING (CWE-404): [#def443]
LVM2.2.03.38/libdaemon/client/daemon-client.c:150:14: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
LVM2.2.03.38/libdaemon/client/daemon-client.c:148:9: acquire_resource: ‘va_copy’ called here
LVM2.2.03.38/libdaemon/client/daemon-client.c:149:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/libdaemon/client/daemon-client.c:150:14: branch_false: ...to here
LVM2.2.03.38/libdaemon/client/daemon-client.c:150:14: throw: if ‘buffer_append_vf’ throws an exception...
LVM2.2.03.38/libdaemon/client/daemon-client.c:150:14: danger: missing call to ‘va_end’ to match ‘va_copy’ at [(1)](sarif:/runs/0/results/5/codeFlows/0/threadFlows/0/locations/0)
#  148|   	va_copy(apc, ap);
#  149|   	if (!buffer_append_f(&rq.buffer, "request = %s", id, NULL) ||
#  150|-> 	    !buffer_append_vf(&rq.buffer, apc)) {
#  151|   		va_end(apc);
#  152|   		buffer_destroy(&rq.buffer);

Error: GCC_ANALYZER_WARNING (CWE-404): [#def444]
LVM2.2.03.38/libdaemon/client/daemon-client.c:152:17: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
LVM2.2.03.38/libdaemon/client/daemon-client.c:163:14: enter_function: entry to ‘daemon_send_simple’
LVM2.2.03.38/libdaemon/client/daemon-client.c:168:9: acquire_resource: ‘va_start’ called here
LVM2.2.03.38/libdaemon/client/daemon-client.c:169:13: call_function: calling ‘daemon_send_simple_v’ from ‘daemon_send_simple’
#  150|   	    !buffer_append_vf(&rq.buffer, apc)) {
#  151|   		va_end(apc);
#  152|-> 		buffer_destroy(&rq.buffer);
#  153|   		return err;
#  154|   	}

Error: GCC_ANALYZER_WARNING (CWE-404): [#def445]
LVM2.2.03.38/libdaemon/client/daemon-client.c:217:15: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
LVM2.2.03.38/libdaemon/client/daemon-client.c:213:12: branch_false: following ‘false’ branch (when ‘<unknown>’ is non-NULL)...
LVM2.2.03.38/libdaemon/client/daemon-client.c:216:9: branch_false: ...to here
LVM2.2.03.38/libdaemon/client/daemon-client.c:216:9: acquire_resource: ‘va_copy’ called here
LVM2.2.03.38/libdaemon/client/daemon-client.c:217:15: throw: if ‘config_make_nodes_v’ throws an exception...
LVM2.2.03.38/libdaemon/client/daemon-client.c:217:15: danger: missing call to ‘va_end’ to match ‘va_copy’ at [(3)](sarif:/runs/0/results/7/codeFlows/0/threadFlows/0/locations/2)
#  215|   
#  216|   	va_copy(apc, ap);
#  217|-> 	res = config_make_nodes_v(r.cft, NULL, r.cft->root, apc) ? 1 : 0;
#  218|   	va_end(apc);
#  219|   

Error: GCC_ANALYZER_WARNING (CWE-775): [#def446]
LVM2.2.03.38/libdaemon/server/daemon-server.c:117:13: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(oom_adj_path, "w")’
LVM2.2.03.38/libdaemon/server/daemon-server.c:110:20: acquire_resource: opened here
LVM2.2.03.38/libdaemon/server/daemon-server.c:110:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/libdaemon/server/daemon-server.c:115:9: branch_false: ...to here
LVM2.2.03.38/libdaemon/server/daemon-server.c:117:13: danger: ‘fopen(oom_adj_path, "w")’ leaks here; was opened at [(1)](sarif:/runs/0/results/2/codeFlows/0/threadFlows/0/locations/0)
#  115|   	fprintf(fp, "%i", val);
#  116|   
#  117|-> 	if (dm_fclose(fp))
#  118|   		perror("oom_adj: fclose failed");
#  119|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def447]
LVM2.2.03.38/libdaemon/server/daemon-server.c:117:13: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(oom_adj_path, "w")’
LVM2.2.03.38/libdaemon/server/daemon-server.c:110:20: acquire_memory: allocated here
LVM2.2.03.38/libdaemon/server/daemon-server.c:110:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/libdaemon/server/daemon-server.c:115:9: branch_false: ...to here
LVM2.2.03.38/libdaemon/server/daemon-server.c:117:13: danger: ‘fopen(oom_adj_path, "w")’ leaks here; was allocated at [(1)](sarif:/runs/0/results/3/codeFlows/0/threadFlows/0/locations/0)
#  115|   	fprintf(fp, "%i", val);
#  116|   
#  117|-> 	if (dm_fclose(fp))
#  118|   		perror("oom_adj: fclose failed");
#  119|   

Error: GCC_ANALYZER_WARNING (CWE-775): [#def448]
LVM2.2.03.38/libdaemon/server/daemon-server.c:248:32: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘fd’
LVM2.2.03.38/libdaemon/server/daemon-server.c:241:14: acquire_resource: stream socket created here
LVM2.2.03.38/libdaemon/server/daemon-server.c:242:12: branch_false: following ‘false’ branch (when ‘fd >= 0’)...
LVM2.2.03.38/libdaemon/server/daemon-server.c:248:32: branch_false: ...to here
LVM2.2.03.38/libdaemon/server/daemon-server.c:248:32: throw: if ‘fcntl’ throws an exception...
LVM2.2.03.38/libdaemon/server/daemon-server.c:248:32: danger: ‘fd’ leaks here
#  246|   
#  247|   	/* Set non-blocking */
#  248|-> 	if (fcntl(fd, F_SETFL, fcntl(fd, F_GETFL, 0) | O_NONBLOCK))
#  249|   		fprintf(stderr, "setting O_NONBLOCK on socket fd %d failed: %s\n", fd, strerror(errno));
#  250|   

Error: GCC_ANALYZER_WARNING (CWE-775): [#def449]
LVM2.2.03.38/libdaemon/server/daemon-server.c:300:17: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘fd’
LVM2.2.03.38/libdaemon/server/daemon-server.c:241:14: acquire_resource: stream socket created here
LVM2.2.03.38/libdaemon/server/daemon-server.c:242:12: branch_false: following ‘false’ branch (when ‘fd >= 0’)...
LVM2.2.03.38/libdaemon/server/daemon-server.c:248:32: branch_false: ...to here
LVM2.2.03.38/libdaemon/server/daemon-server.c:252:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/libdaemon/server/daemon-server.c:257:13: branch_false: ...to here
LVM2.2.03.38/libdaemon/server/daemon-server.c:299:12: branch_true: following ‘true’ branch...
LVM2.2.03.38/libdaemon/server/daemon-server.c:300:17: branch_true: ...to here
LVM2.2.03.38/libdaemon/server/daemon-server.c:300:17: throw: if ‘perror’ throws an exception...
LVM2.2.03.38/libdaemon/server/daemon-server.c:300:17: danger: ‘fd’ leaks here
#  298|   
#  299|   	if (listen(fd, 1) != 0) {
#  300|-> 		perror("listen local");
#  301|   		goto error;
#  302|   	}

Error: GCC_ANALYZER_WARNING (CWE-775): [#def450]
LVM2.2.03.38/libdaemon/server/daemon-server.c:306:16: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘fd’
LVM2.2.03.38/libdaemon/server/daemon-server.c:241:14: acquire_resource: stream socket created here
LVM2.2.03.38/libdaemon/server/daemon-server.c:242:12: branch_false: following ‘false’ branch (when ‘fd >= 0’)...
LVM2.2.03.38/libdaemon/server/daemon-server.c:248:32: branch_false: ...to here
LVM2.2.03.38/libdaemon/server/daemon-server.c:252:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/libdaemon/server/daemon-server.c:257:13: branch_false: ...to here
LVM2.2.03.38/libdaemon/server/daemon-server.c:299:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/libdaemon/server/daemon-server.c:304:1: branch_false: ...to here
LVM2.2.03.38/libdaemon/server/daemon-server.c:306:16: throw: if ‘dm_prepare_selinux_context’ throws an exception...
LVM2.2.03.38/libdaemon/server/daemon-server.c:306:16: danger: ‘fd’ leaks here
#  304|   out:
#  305|   	umask(old_mask);
#  306|-> 	(void) dm_prepare_selinux_context(NULL, 0);
#  307|   	return fd;
#  308|   

Error: GCC_ANALYZER_WARNING (CWE-775): [#def451]
LVM2.2.03.38/libdaemon/server/daemon-server.c:311:21: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘fd’
LVM2.2.03.38/libdaemon/server/daemon-server.c:241:14: acquire_resource: stream socket created here
LVM2.2.03.38/libdaemon/server/daemon-server.c:242:12: branch_false: following ‘false’ branch (when ‘fd >= 0’)...
LVM2.2.03.38/libdaemon/server/daemon-server.c:248:32: branch_false: ...to here
LVM2.2.03.38/libdaemon/server/daemon-server.c:252:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/libdaemon/server/daemon-server.c:257:13: branch_false: ...to here
LVM2.2.03.38/libdaemon/server/daemon-server.c:299:12: branch_true: following ‘true’ branch...
LVM2.2.03.38/libdaemon/server/daemon-server.c:300:17: branch_true: ...to here
LVM2.2.03.38/libdaemon/server/daemon-server.c:310:12: branch_true: following ‘true’ branch (when ‘fd >= 0’)...
LVM2.2.03.38/libdaemon/server/daemon-server.c:311:21: branch_true: ...to here
LVM2.2.03.38/libdaemon/server/daemon-server.c:311:21: throw: if ‘close’ throws an exception...
LVM2.2.03.38/libdaemon/server/daemon-server.c:311:21: danger: ‘fd’ leaks here
#  309|   error:
#  310|   	if (fd >= 0) {
#  311|-> 		if (close(fd))
#  312|   			perror("close failed");
#  313|   		if (file_created && unlink(s.socket_path))

Error: GCC_ANALYZER_WARNING (CWE-775): [#def452]
LVM2.2.03.38/libdaemon/server/daemon-server.c:345:17: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘open("/dev/null", 2)’
LVM2.2.03.38/libdaemon/server/daemon-server.c:338:19: acquire_resource: opened here
LVM2.2.03.38/libdaemon/server/daemon-server.c:338:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/libdaemon/server/daemon-server.c:343:9: branch_false: ...to here
LVM2.2.03.38/libdaemon/server/daemon-server.c:344:12: branch_true: following ‘true’ branch...
LVM2.2.03.38/libdaemon/server/daemon-server.c:345:17: branch_true: ...to here
LVM2.2.03.38/libdaemon/server/daemon-server.c:345:17: danger: ‘open("/dev/null", 2)’ leaks here; was opened at [(1)](sarif:/runs/0/results/8/codeFlows/0/threadFlows/0/locations/0)
#  343|   	sigemptyset(&my_sigset);
#  344|   	if (sigprocmask(SIG_SETMASK, &my_sigset, NULL) < 0) {
#  345|-> 		fprintf(stderr, "Unable to restore signals.\n");
#  346|   		(void) close(fd);
#  347|   		exit(EXIT_FAILURE);

Error: GCC_ANALYZER_WARNING (CWE-775): [#def453]
LVM2.2.03.38/libdaemon/server/daemon-server.c:353:17: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘open("/dev/null", 2)’
LVM2.2.03.38/libdaemon/server/daemon-server.c:338:19: acquire_resource: opened here
LVM2.2.03.38/libdaemon/server/daemon-server.c:338:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/libdaemon/server/daemon-server.c:343:9: branch_false: ...to here
LVM2.2.03.38/libdaemon/server/daemon-server.c:344:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/libdaemon/server/daemon-server.c:349:9: branch_false: ...to here
LVM2.2.03.38/libdaemon/server/daemon-server.c:353:17: throw: if ‘perror’ throws an exception...
LVM2.2.03.38/libdaemon/server/daemon-server.c:353:17: danger: ‘open("/dev/null", 2)’ leaks here; was opened at [(1)](sarif:/runs/0/results/9/codeFlows/0/threadFlows/0/locations/0)
#  351|   	switch (pid = fork()) {
#  352|   	case -1:
#  353|-> 		perror("fork failed:");
#  354|   		(void) close(fd);
#  355|   		exit(EXIT_FAILURE);

Error: GCC_ANALYZER_WARNING (CWE-775): [#def454]
LVM2.2.03.38/libdaemon/server/daemon-server.c:354:24: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘open("/dev/null", 2)’
LVM2.2.03.38/libdaemon/server/daemon-server.c:338:19: acquire_resource: opened here
LVM2.2.03.38/libdaemon/server/daemon-server.c:338:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/libdaemon/server/daemon-server.c:343:9: branch_false: ...to here
LVM2.2.03.38/libdaemon/server/daemon-server.c:344:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/libdaemon/server/daemon-server.c:349:9: branch_false: ...to here
LVM2.2.03.38/libdaemon/server/daemon-server.c:354:24: danger: ‘open("/dev/null", 2)’ leaks here; was opened at [(1)](sarif:/runs/0/results/10/codeFlows/0/threadFlows/0/locations/0)
#  352|   	case -1:
#  353|   		perror("fork failed:");
#  354|-> 		(void) close(fd);
#  355|   		exit(EXIT_FAILURE);
#  356|   

Error: GCC_ANALYZER_WARNING (CWE-775): [#def455]
LVM2.2.03.38/libdaemon/server/daemon-server.c:361:24: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘open("/dev/null", 2)’
LVM2.2.03.38/libdaemon/server/daemon-server.c:338:19: acquire_resource: opened here
LVM2.2.03.38/libdaemon/server/daemon-server.c:338:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/libdaemon/server/daemon-server.c:343:9: branch_false: ...to here
LVM2.2.03.38/libdaemon/server/daemon-server.c:344:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/libdaemon/server/daemon-server.c:349:9: branch_false: ...to here
LVM2.2.03.38/libdaemon/server/daemon-server.c:361:24: danger: ‘open("/dev/null", 2)’ leaks here; was opened at [(1)](sarif:/runs/0/results/11/codeFlows/0/threadFlows/0/locations/0)
#  359|   
#  360|   	default:
#  361|-> 		(void) close(fd);
#  362|   		/* Wait for response from child */
#  363|   		while (!waitpid(pid, &child_status, WNOHANG) && !_shutdown_requested) {

Error: GCC_ANALYZER_WARNING (CWE-775): [#def456]
LVM2.2.03.38/libdaemon/server/daemon-server.c:384:17: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘open("/dev/null", 2)’
LVM2.2.03.38/libdaemon/server/daemon-server.c:338:19: acquire_resource: opened here
LVM2.2.03.38/libdaemon/server/daemon-server.c:338:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/libdaemon/server/daemon-server.c:343:9: branch_false: ...to here
LVM2.2.03.38/libdaemon/server/daemon-server.c:344:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/libdaemon/server/daemon-server.c:349:9: branch_false: ...to here
LVM2.2.03.38/libdaemon/server/daemon-server.c:383:12: branch_true: following ‘true’ branch...
LVM2.2.03.38/libdaemon/server/daemon-server.c:384:17: branch_true: ...to here
LVM2.2.03.38/libdaemon/server/daemon-server.c:384:17: throw: if ‘perror’ throws an exception...
LVM2.2.03.38/libdaemon/server/daemon-server.c:384:17: danger: ‘open("/dev/null", 2)’ leaks here; was opened at [(1)](sarif:/runs/0/results/12/codeFlows/0/threadFlows/0/locations/0)
#  382|   
#  383|   	if (chdir("/")) {
#  384|-> 		perror("Cannot chdir to /");
#  385|   		(void) close(fd);
#  386|   		exit(1);

Error: GCC_ANALYZER_WARNING (CWE-775): [#def457]
LVM2.2.03.38/libdaemon/server/daemon-server.c:385:24: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘open("/dev/null", 2)’
LVM2.2.03.38/libdaemon/server/daemon-server.c:338:19: acquire_resource: opened here
LVM2.2.03.38/libdaemon/server/daemon-server.c:338:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/libdaemon/server/daemon-server.c:343:9: branch_false: ...to here
LVM2.2.03.38/libdaemon/server/daemon-server.c:344:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/libdaemon/server/daemon-server.c:349:9: branch_false: ...to here
LVM2.2.03.38/libdaemon/server/daemon-server.c:383:12: branch_true: following ‘true’ branch...
LVM2.2.03.38/libdaemon/server/daemon-server.c:384:17: branch_true: ...to here
LVM2.2.03.38/libdaemon/server/daemon-server.c:385:24: danger: ‘open("/dev/null", 2)’ leaks here; was opened at [(1)](sarif:/runs/0/results/13/codeFlows/0/threadFlows/0/locations/0)
#  383|   	if (chdir("/")) {
#  384|   		perror("Cannot chdir to /");
#  385|-> 		(void) close(fd);
#  386|   		exit(1);
#  387|   	}

Error: GCC_ANALYZER_WARNING (CWE-775): [#def458]
LVM2.2.03.38/libdaemon/server/daemon-server.c:389:13: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘dup2(open("/dev/null", 2), 0)’
LVM2.2.03.38/libdaemon/server/daemon-server.c:338:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/libdaemon/server/daemon-server.c:343:9: branch_false: ...to here
LVM2.2.03.38/libdaemon/server/daemon-server.c:344:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/libdaemon/server/daemon-server.c:349:9: branch_false: ...to here
LVM2.2.03.38/libdaemon/server/daemon-server.c:383:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/libdaemon/server/daemon-server.c:389:12: branch_false: ...to here
LVM2.2.03.38/libdaemon/server/daemon-server.c:389:12: branch_true: following ‘true’ branch...
LVM2.2.03.38/libdaemon/server/daemon-server.c:389:39: branch_true: ...to here
LVM2.2.03.38/libdaemon/server/daemon-server.c:389:39: acquire_resource: opened here
LVM2.2.03.38/libdaemon/server/daemon-server.c:389:13: danger: ‘dup2(open("/dev/null", 2), 0)’ leaks here; was opened at [(11)](sarif:/runs/0/results/14/codeFlows/0/threadFlows/0/locations/10)
#  387|   	}
#  388|   
#  389|-> 	if (((fd != STDIN_FILENO) && (dup2(fd, STDIN_FILENO) == -1)) ||
#  390|   	    ((fd != STDOUT_FILENO) && (dup2(fd, STDOUT_FILENO) == -1)) ||
#  391|   	    ((fd != STDERR_FILENO) && (dup2(fd, STDERR_FILENO) == -1))) {

Error: GCC_ANALYZER_WARNING (CWE-775): [#def459]
LVM2.2.03.38/libdaemon/server/daemon-server.c:389:13: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘open("/dev/null", 2)’
LVM2.2.03.38/libdaemon/server/daemon-server.c:338:19: acquire_resource: opened here
LVM2.2.03.38/libdaemon/server/daemon-server.c:338:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/libdaemon/server/daemon-server.c:343:9: branch_false: ...to here
LVM2.2.03.38/libdaemon/server/daemon-server.c:344:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/libdaemon/server/daemon-server.c:349:9: branch_false: ...to here
LVM2.2.03.38/libdaemon/server/daemon-server.c:383:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/libdaemon/server/daemon-server.c:389:12: branch_false: ...to here
LVM2.2.03.38/libdaemon/server/daemon-server.c:390:13: branch_false: following ‘false’ branch...
LVM2.2.03.38/libdaemon/server/daemon-server.c:389:13: branch_false: ...to here
LVM2.2.03.38/libdaemon/server/daemon-server.c:389:13: danger: ‘open("/dev/null", 2)’ leaks here; was opened at [(1)](sarif:/runs/0/results/16/codeFlows/0/threadFlows/0/locations/0)
#  387|   	}
#  388|   
#  389|-> 	if (((fd != STDIN_FILENO) && (dup2(fd, STDIN_FILENO) == -1)) ||
#  390|   	    ((fd != STDOUT_FILENO) && (dup2(fd, STDOUT_FILENO) == -1)) ||
#  391|   	    ((fd != STDERR_FILENO) && (dup2(fd, STDERR_FILENO) == -1))) {

Error: GCC_ANALYZER_WARNING (CWE-775): [#def460]
LVM2.2.03.38/libdaemon/server/daemon-server.c:390:13: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘dup2(open("/dev/null", 2), 1)’
LVM2.2.03.38/libdaemon/server/daemon-server.c:338:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/libdaemon/server/daemon-server.c:343:9: branch_false: ...to here
LVM2.2.03.38/libdaemon/server/daemon-server.c:344:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/libdaemon/server/daemon-server.c:349:9: branch_false: ...to here
LVM2.2.03.38/libdaemon/server/daemon-server.c:383:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/libdaemon/server/daemon-server.c:389:12: branch_false: ...to here
LVM2.2.03.38/libdaemon/server/daemon-server.c:390:40: acquire_resource: opened here
LVM2.2.03.38/libdaemon/server/daemon-server.c:390:13: danger: ‘dup2(open("/dev/null", 2), 1)’ leaks here; was opened at [(9)](sarif:/runs/0/results/15/codeFlows/0/threadFlows/0/locations/8)
#  388|   
#  389|   	if (((fd != STDIN_FILENO) && (dup2(fd, STDIN_FILENO) == -1)) ||
#  390|-> 	    ((fd != STDOUT_FILENO) && (dup2(fd, STDOUT_FILENO) == -1)) ||
#  391|   	    ((fd != STDERR_FILENO) && (dup2(fd, STDERR_FILENO) == -1))) {
#  392|   		perror("Error setting terminal FDs to /dev/null");

Error: GCC_ANALYZER_WARNING (CWE-775): [#def461]
LVM2.2.03.38/libdaemon/server/daemon-server.c:391:13: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘dup2(open("/dev/null", 2), 2)’
LVM2.2.03.38/libdaemon/server/daemon-server.c:338:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/libdaemon/server/daemon-server.c:343:9: branch_false: ...to here
LVM2.2.03.38/libdaemon/server/daemon-server.c:344:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/libdaemon/server/daemon-server.c:349:9: branch_false: ...to here
LVM2.2.03.38/libdaemon/server/daemon-server.c:383:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/libdaemon/server/daemon-server.c:389:12: branch_false: ...to here
LVM2.2.03.38/libdaemon/server/daemon-server.c:389:13: branch_false: following ‘false’ branch...
LVM2.2.03.38/libdaemon/server/daemon-server.c:389:13: branch_false: ...to here
LVM2.2.03.38/libdaemon/server/daemon-server.c:391:40: acquire_resource: opened here
LVM2.2.03.38/libdaemon/server/daemon-server.c:391:13: danger: ‘dup2(open("/dev/null", 2), 2)’ leaks here; was opened at [(11)](sarif:/runs/0/results/17/codeFlows/0/threadFlows/0/locations/10)
#  389|   	if (((fd != STDIN_FILENO) && (dup2(fd, STDIN_FILENO) == -1)) ||
#  390|   	    ((fd != STDOUT_FILENO) && (dup2(fd, STDOUT_FILENO) == -1)) ||
#  391|-> 	    ((fd != STDERR_FILENO) && (dup2(fd, STDERR_FILENO) == -1))) {
#  392|   		perror("Error setting terminal FDs to /dev/null");
#  393|   		if (fd > STDERR_FILENO)

Error: GCC_ANALYZER_WARNING (CWE-775): [#def462]
LVM2.2.03.38/libdaemon/server/daemon-server.c:392:17: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘open("/dev/null", 2)’
LVM2.2.03.38/libdaemon/server/daemon-server.c:338:19: acquire_resource: opened here
LVM2.2.03.38/libdaemon/server/daemon-server.c:338:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/libdaemon/server/daemon-server.c:343:9: branch_false: ...to here
LVM2.2.03.38/libdaemon/server/daemon-server.c:344:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/libdaemon/server/daemon-server.c:349:9: branch_false: ...to here
LVM2.2.03.38/libdaemon/server/daemon-server.c:383:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/libdaemon/server/daemon-server.c:389:12: branch_false: ...to here
LVM2.2.03.38/libdaemon/server/daemon-server.c:392:17: throw: if ‘perror’ throws an exception...
LVM2.2.03.38/libdaemon/server/daemon-server.c:392:17: danger: ‘open("/dev/null", 2)’ leaks here; was opened at [(1)](sarif:/runs/0/results/18/codeFlows/0/threadFlows/0/locations/0)
#  390|   	    ((fd != STDOUT_FILENO) && (dup2(fd, STDOUT_FILENO) == -1)) ||
#  391|   	    ((fd != STDERR_FILENO) && (dup2(fd, STDERR_FILENO) == -1))) {
#  392|-> 		perror("Error setting terminal FDs to /dev/null");
#  393|   		if (fd > STDERR_FILENO)
#  394|   			(void) close(fd);

Error: GCC_ANALYZER_WARNING (CWE-775): [#def463]
LVM2.2.03.38/libdaemon/server/daemon-server.c:393:20: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘open("/dev/null", 2)’
LVM2.2.03.38/libdaemon/server/daemon-server.c:338:19: acquire_resource: opened here
LVM2.2.03.38/libdaemon/server/daemon-server.c:338:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/libdaemon/server/daemon-server.c:343:9: branch_false: ...to here
LVM2.2.03.38/libdaemon/server/daemon-server.c:344:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/libdaemon/server/daemon-server.c:349:9: branch_false: ...to here
LVM2.2.03.38/libdaemon/server/daemon-server.c:383:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/libdaemon/server/daemon-server.c:389:12: branch_false: ...to here
LVM2.2.03.38/libdaemon/server/daemon-server.c:393:20: danger: ‘open("/dev/null", 2)’ leaks here; was opened at [(1)](sarif:/runs/0/results/19/codeFlows/0/threadFlows/0/locations/0)
#  391|   	    ((fd != STDERR_FILENO) && (dup2(fd, STDERR_FILENO) == -1))) {
#  392|   		perror("Error setting terminal FDs to /dev/null");
#  393|-> 		if (fd > STDERR_FILENO)
#  394|   			(void) close(fd);
#  395|   		/* coverity[leaked_handle] fd is stdin/stdout/stderr */

Error: GCC_ANALYZER_WARNING (CWE-775): [#def464]
LVM2.2.03.38/libdaemon/server/daemon-server.c:394:32: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘open("/dev/null", 2)’
LVM2.2.03.38/libdaemon/server/daemon-server.c:338:19: acquire_resource: opened here
LVM2.2.03.38/libdaemon/server/daemon-server.c:338:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/libdaemon/server/daemon-server.c:343:9: branch_false: ...to here
LVM2.2.03.38/libdaemon/server/daemon-server.c:344:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/libdaemon/server/daemon-server.c:349:9: branch_false: ...to here
LVM2.2.03.38/libdaemon/server/daemon-server.c:383:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/libdaemon/server/daemon-server.c:389:12: branch_false: ...to here
LVM2.2.03.38/libdaemon/server/daemon-server.c:393:20: branch_true: following ‘true’ branch...
LVM2.2.03.38/libdaemon/server/daemon-server.c:394:32: branch_true: ...to here
LVM2.2.03.38/libdaemon/server/daemon-server.c:394:32: danger: ‘open("/dev/null", 2)’ leaks here; was opened at [(1)](sarif:/runs/0/results/20/codeFlows/0/threadFlows/0/locations/0)
#  392|   		perror("Error setting terminal FDs to /dev/null");
#  393|   		if (fd > STDERR_FILENO)
#  394|-> 			(void) close(fd);
#  395|   		/* coverity[leaked_handle] fd is stdin/stdout/stderr */
#  396|   		exit(2);

Error: GCC_ANALYZER_WARNING (CWE-775): [#def465]
LVM2.2.03.38/libdaemon/server/daemon-server.c:399:12: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘open("/dev/null", 2)’
LVM2.2.03.38/libdaemon/server/daemon-server.c:338:19: acquire_resource: opened here
LVM2.2.03.38/libdaemon/server/daemon-server.c:338:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/libdaemon/server/daemon-server.c:343:9: branch_false: ...to here
LVM2.2.03.38/libdaemon/server/daemon-server.c:344:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/libdaemon/server/daemon-server.c:349:9: branch_false: ...to here
LVM2.2.03.38/libdaemon/server/daemon-server.c:383:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/libdaemon/server/daemon-server.c:389:12: branch_false: ...to here
LVM2.2.03.38/libdaemon/server/daemon-server.c:389:13: branch_false: following ‘false’ branch...
LVM2.2.03.38/libdaemon/server/daemon-server.c:389:13: branch_false: ...to here
LVM2.2.03.38/libdaemon/server/daemon-server.c:391:13: branch_false: following ‘false’ branch...
LVM2.2.03.38/libdaemon/server/daemon-server.c:399:12: branch_false: ...to here
LVM2.2.03.38/libdaemon/server/daemon-server.c:399:12: danger: ‘open("/dev/null", 2)’ leaks here; was opened at [(1)](sarif:/runs/0/results/21/codeFlows/0/threadFlows/0/locations/0)
#  397|   	}
#  398|   
#  399|-> 	if ((fd > STDERR_FILENO) && close(fd)) {
#  400|   		perror("Failed to close /dev/null descriptor");
#  401|   		exit(3);

Error: GCC_ANALYZER_WARNING (CWE-775): [#def466]
LVM2.2.03.38/libdaemon/server/daemon-server.c:399:37: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘open("/dev/null", 2)’
LVM2.2.03.38/libdaemon/server/daemon-server.c:338:19: acquire_resource: opened here
LVM2.2.03.38/libdaemon/server/daemon-server.c:338:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/libdaemon/server/daemon-server.c:343:9: branch_false: ...to here
LVM2.2.03.38/libdaemon/server/daemon-server.c:344:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/libdaemon/server/daemon-server.c:349:9: branch_false: ...to here
LVM2.2.03.38/libdaemon/server/daemon-server.c:383:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/libdaemon/server/daemon-server.c:389:12: branch_false: ...to here
LVM2.2.03.38/libdaemon/server/daemon-server.c:389:13: branch_false: following ‘false’ branch...
LVM2.2.03.38/libdaemon/server/daemon-server.c:389:13: branch_false: ...to here
LVM2.2.03.38/libdaemon/server/daemon-server.c:390:13: branch_false: following ‘false’ branch...
LVM2.2.03.38/libdaemon/server/daemon-server.c:389:13: branch_false: ...to here
LVM2.2.03.38/libdaemon/server/daemon-server.c:389:13: branch_true: following ‘true’ branch...
LVM2.2.03.38/libdaemon/server/daemon-server.c:391:40: branch_true: ...to here
LVM2.2.03.38/libdaemon/server/daemon-server.c:391:13: branch_false: following ‘false’ branch...
LVM2.2.03.38/libdaemon/server/daemon-server.c:399:12: branch_false: ...to here
LVM2.2.03.38/libdaemon/server/daemon-server.c:399:12: branch_true: following ‘true’ branch...
LVM2.2.03.38/libdaemon/server/daemon-server.c:399:37: branch_true: ...to here
LVM2.2.03.38/libdaemon/server/daemon-server.c:399:37: danger: ‘open("/dev/null", 2)’ leaks here; was opened at [(1)](sarif:/runs/0/results/22/codeFlows/0/threadFlows/0/locations/0)
#  397|   	}
#  398|   
#  399|-> 	if ((fd > STDERR_FILENO) && close(fd)) {
#  400|   		perror("Failed to close /dev/null descriptor");
#  401|   		exit(3);

Error: GCC_ANALYZER_WARNING (CWE-404): [#def467]
LVM2.2.03.38/libdaemon/server/daemon-server.c:418:9: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
LVM2.2.03.38/libdaemon/server/daemon-server.c:416:9: acquire_resource: ‘va_start’ called here
LVM2.2.03.38/libdaemon/server/daemon-server.c:418:9: throw: if ‘buffer_init’ throws an exception...
LVM2.2.03.38/libdaemon/server/daemon-server.c:418:9: danger: missing call to ‘va_end’ to match ‘va_start’ at [(1)](sarif:/runs/0/results/23/codeFlows/0/threadFlows/0/locations/0)
#  416|   	va_start(ap, id);
#  417|   
#  418|-> 	buffer_init(&res.buffer);
#  419|   	if (!buffer_append_f(&res.buffer, "response = %s", id, NULL)) {
#  420|   		res.error = ENOMEM;

Error: GCC_ANALYZER_WARNING (CWE-404): [#def468]
LVM2.2.03.38/libdaemon/server/daemon-server.c:419:14: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
LVM2.2.03.38/libdaemon/server/daemon-server.c:416:9: acquire_resource: ‘va_start’ called here
LVM2.2.03.38/libdaemon/server/daemon-server.c:419:14: throw: if ‘buffer_append_f’ throws an exception...
LVM2.2.03.38/libdaemon/server/daemon-server.c:419:14: danger: missing call to ‘va_end’ to match ‘va_start’ at [(1)](sarif:/runs/0/results/24/codeFlows/0/threadFlows/0/locations/0)
#  417|   
#  418|   	buffer_init(&res.buffer);
#  419|-> 	if (!buffer_append_f(&res.buffer, "response = %s", id, NULL)) {
#  420|   		res.error = ENOMEM;
#  421|   		goto end;

Error: GCC_ANALYZER_WARNING (CWE-404): [#def469]
LVM2.2.03.38/libdaemon/server/daemon-server.c:423:14: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
LVM2.2.03.38/libdaemon/server/daemon-server.c:416:9: acquire_resource: ‘va_start’ called here
LVM2.2.03.38/libdaemon/server/daemon-server.c:419:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/libdaemon/server/daemon-server.c:423:14: branch_false: ...to here
LVM2.2.03.38/libdaemon/server/daemon-server.c:423:14: throw: if ‘buffer_append_vf’ throws an exception...
LVM2.2.03.38/libdaemon/server/daemon-server.c:423:14: danger: missing call to ‘va_end’ to match ‘va_start’ at [(1)](sarif:/runs/0/results/25/codeFlows/0/threadFlows/0/locations/0)
#  421|   		goto end;
#  422|   	}
#  423|-> 	if (!buffer_append_vf(&res.buffer, ap)) {
#  424|   		res.error = ENOMEM;
#  425|   		goto end;

Error: GCC_ANALYZER_WARNING (CWE-775): [#def470]
LVM2.2.03.38/libdaemon/server/daemon-stray.h:52:26: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘open(&buf, 0)’
LVM2.2.03.38/daemons/dmeventd/dmeventd.c:2427:13: enter_function: entry to ‘_daemonize’
LVM2.2.03.38/daemons/dmeventd/dmeventd.c:2441:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/daemons/dmeventd/dmeventd.c:2445:9: branch_false: ...to here
LVM2.2.03.38/daemons/dmeventd/dmeventd.c:2479:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/daemons/dmeventd/dmeventd.c:2482:9: branch_false: ...to here
LVM2.2.03.38/daemons/dmeventd/dmeventd.c:2482:9: call_function: calling ‘daemon_close_stray_fds’ from ‘_daemonize’
#   50|   	/* FIXME Use generic read code. */
#   51|   	if ((fd = open(buf, O_RDONLY)) >= 0) {
#   52|-> 		if ((n = read(fd, cmdline, size - 1)) < 0) {
#   53|   			//perror("read", buf);
#   54|   			n = 0;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def471]
LVM2.2.03.38/libdaemon/server/daemon-stray.h:132:34: warning[-Wanalyzer-malloc-leak]: leak of ‘opendir(&_fd_dir)’
LVM2.2.03.38/daemons/dmeventd/dmeventd.c:2427:13: enter_function: entry to ‘_daemonize’
LVM2.2.03.38/daemons/dmeventd/dmeventd.c:2441:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/daemons/dmeventd/dmeventd.c:2445:9: branch_false: ...to here
LVM2.2.03.38/daemons/dmeventd/dmeventd.c:2479:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/daemons/dmeventd/dmeventd.c:2482:9: branch_false: ...to here
LVM2.2.03.38/daemons/dmeventd/dmeventd.c:2482:9: call_function: calling ‘daemon_close_stray_fds’ from ‘_daemonize’
#  130|   	if ((d = opendir(_fd_dir))) {
#  131|   		/* Discover opened descriptors from /proc/self/fd listing */
#  132|-> 		while ((dirent = readdir(d))) {
#  133|   			fd = atoi(dirent->d_name);
#  134|   			if ((fd > from_fd) &&

Error: GCC_ANALYZER_WARNING (CWE-401): [#def472]
LVM2.2.03.38/libdm/dm-tools/dmfilemapd.c:128:9: warning[-Wanalyzer-malloc-leak]: leak of ‘fm.path’
LVM2.2.03.38/libdm/dm-tools/dmfilemapd.c:816:5: enter_function: entry to ‘main’
LVM2.2.03.38/libdm/dm-tools/dmfilemapd.c:820:14: call_function: calling ‘_parse_args’ from ‘main’
LVM2.2.03.38/libdm/dm-tools/dmfilemapd.c:820:14: return_function: returning to ‘main’ from ‘_parse_args’
LVM2.2.03.38/libdm/dm-tools/dmfilemapd.c:820:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/libdm/dm-tools/dmfilemapd.c:825:9: branch_false: ...to here
LVM2.2.03.38/libdm/dm-tools/dmfilemapd.c:825:9: call_function: calling ‘_setup_logging’ from ‘main’
#  126|   static void _setup_logging(void)
#  127|   {
#  128|-> 	dm_log_init_verbose(_verbose - 1);
#  129|   	dm_log_with_errno_init(_dmfilemapd_log_with_errno);
#  130|   }

Error: GCC_ANALYZER_WARNING (CWE-401): [#def473]
LVM2.2.03.38/libdm/dm-tools/dmfilemapd.c:129:9: warning[-Wanalyzer-malloc-leak]: leak of ‘fm.path’
LVM2.2.03.38/libdm/dm-tools/dmfilemapd.c:816:5: enter_function: entry to ‘main’
LVM2.2.03.38/libdm/dm-tools/dmfilemapd.c:820:14: call_function: calling ‘_parse_args’ from ‘main’
LVM2.2.03.38/libdm/dm-tools/dmfilemapd.c:820:14: return_function: returning to ‘main’ from ‘_parse_args’
LVM2.2.03.38/libdm/dm-tools/dmfilemapd.c:820:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/libdm/dm-tools/dmfilemapd.c:825:9: branch_false: ...to here
LVM2.2.03.38/libdm/dm-tools/dmfilemapd.c:825:9: call_function: calling ‘_setup_logging’ from ‘main’
#  127|   {
#  128|   	dm_log_init_verbose(_verbose - 1);
#  129|-> 	dm_log_with_errno_init(_dmfilemapd_log_with_errno);
#  130|   }
#  131|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def474]
LVM2.2.03.38/libdm/dm-tools/dmfilemapd.c:171:26: warning[-Wanalyzer-malloc-leak]: leak of ‘opendir(&path_buf)’
LVM2.2.03.38/libdm/dm-tools/dmfilemapd.c:147:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/libdm/dm-tools/dmfilemapd.c:150:13: branch_false: ...to here
LVM2.2.03.38/libdm/dm-tools/dmfilemapd.c:150:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/libdm/dm-tools/dmfilemapd.c:159:13: branch_false: ...to here
LVM2.2.03.38/libdm/dm-tools/dmfilemapd.c:159:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/libdm/dm-tools/dmfilemapd.c:165:17: branch_false: ...to here
LVM2.2.03.38/libdm/dm-tools/dmfilemapd.c:165:17: acquire_memory: allocated here
LVM2.2.03.38/libdm/dm-tools/dmfilemapd.c:166:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/libdm/dm-tools/dmfilemapd.c:166:12: branch_false: ...to here
LVM2.2.03.38/libdm/dm-tools/dmfilemapd.c:171:26: throw: if ‘readdir’ throws an exception...
LVM2.2.03.38/libdm/dm-tools/dmfilemapd.c:171:26: danger: ‘opendir(&path_buf)’ leaks here; was allocated at [(7)](sarif:/runs/0/results/4/codeFlows/0/threadFlows/0/locations/6)
#  169|   	}
#  170|   
#  171|-> 	while ((pid_dp = readdir(pid_d)) != NULL) {
#  172|   		if (pid_dp->d_name[0] == '.')
#  173|   			continue;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def475]
LVM2.2.03.38/libdm/dm-tools/dmfilemapd.c:225:27: warning[-Wanalyzer-malloc-leak]: leak of ‘opendir("/proc")’
LVM2.2.03.38/libdm/dm-tools/dmfilemapd.c:222:18: acquire_memory: allocated here
LVM2.2.03.38/libdm/dm-tools/dmfilemapd.c:223:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/libdm/dm-tools/dmfilemapd.c:223:12: branch_false: ...to here
LVM2.2.03.38/libdm/dm-tools/dmfilemapd.c:225:27: throw: if ‘readdir’ throws an exception...
LVM2.2.03.38/libdm/dm-tools/dmfilemapd.c:225:27: danger: ‘opendir("/proc")’ leaks here; was allocated at [(1)](sarif:/runs/0/results/5/codeFlows/0/threadFlows/0/locations/0)
#  223|   	if (!proc_d)
#  224|   		return 0;
#  225|-> 	while ((proc_dp = readdir(proc_d)) != NULL) {
#  226|   		if (!isdigit(proc_dp->d_name[0]))
#  227|   			continue;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def476]
LVM2.2.03.38/libdm/dm-tools/dmfilemapd.c:329:20: warning[-Wanalyzer-malloc-leak]: leak of ‘fm.path’
LVM2.2.03.38/libdm/dm-tools/dmfilemapd.c:816:5: enter_function: entry to ‘main’
LVM2.2.03.38/libdm/dm-tools/dmfilemapd.c:820:14: call_function: calling ‘_parse_args’ from ‘main’
#  327|   	}
#  328|   
#  329|-> 	fm->mode = dm_filemapd_mode_from_string(argv[0]);
#  330|   	if (fm->mode == DM_FILEMAPD_FOLLOW_NONE)
#  331|   		return 0;

Error: GCC_ANALYZER_WARNING (CWE-775): [#def477]
LVM2.2.03.38/libdm/dm-tools/dmfilemapd.c:578:16: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘open(*fm.path, 0)’
LVM2.2.03.38/libdm/dm-tools/dmfilemapd.c:565:12: enter_function: entry to ‘_filemap_monitor_check_file_unlinked’
LVM2.2.03.38/libdm/dm-tools/dmfilemapd.c:575:19: acquire_resource: opened here
LVM2.2.03.38/libdm/dm-tools/dmfilemapd.c:575:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/libdm/dm-tools/dmfilemapd.c:578:16: branch_false: ...to here
LVM2.2.03.38/libdm/dm-tools/dmfilemapd.c:578:16: call_function: calling ‘_filemap_monitor_check_same_file’ from ‘_filemap_monitor_check_file_unlinked’
#  576|   		goto check_unlinked;
#  577|   
#  578|-> 	same = _filemap_monitor_check_same_file(fm->fd, fd);
#  579|   
#  580|   	if (close(fd))

Error: GCC_ANALYZER_WARNING (CWE-775): [#def478]
LVM2.2.03.38/libdm/dm-tools/dmfilemapd.c:613:24: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘open(&link_buf, 0)’
LVM2.2.03.38/libdm/dm-tools/dmfilemapd.c:565:12: enter_function: entry to ‘_filemap_monitor_check_file_unlinked’
LVM2.2.03.38/libdm/dm-tools/dmfilemapd.c:595:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/libdm/dm-tools/dmfilemapd.c:600:20: branch_false: ...to here
LVM2.2.03.38/libdm/dm-tools/dmfilemapd.c:600:12: branch_false: following ‘false’ branch (when ‘len >= 0’)...
LVM2.2.03.38/libdm/dm-tools/dmfilemapd.c:605:9: branch_false: ...to here
LVM2.2.03.38/libdm/dm-tools/dmfilemapd.c:610:19: acquire_resource: opened here
LVM2.2.03.38/libdm/dm-tools/dmfilemapd.c:610:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/libdm/dm-tools/dmfilemapd.c:613:24: branch_false: ...to here
LVM2.2.03.38/libdm/dm-tools/dmfilemapd.c:613:24: call_function: calling ‘_filemap_monitor_check_same_file’ from ‘_filemap_monitor_check_file_unlinked’
#  611|   		fm->deleted = 1;
#  612|   	else
#  613|-> 		same = _filemap_monitor_check_same_file(fm->fd, fd);
#  614|   
#  615|   	if ((fd >= 0) && close(fd))

Error: GCC_ANALYZER_WARNING (CWE-775): [#def479]
LVM2.2.03.38/libdm/dm-tools/dmfilemapd.c:664:21: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘dup2(open("/dev/null", 2), 0)’
LVM2.2.03.38/libdm/dm-tools/dmfilemapd.c:637:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/libdm/dm-tools/dmfilemapd.c:642:20: branch_false: ...to here
LVM2.2.03.38/libdm/dm-tools/dmfilemapd.c:642:12: branch_false: following ‘false’ branch (when ‘pid >= 0’)...
LVM2.2.03.38/libdm/dm-tools/dmfilemapd.c:647:12: branch_false: ...to here
LVM2.2.03.38/libdm/dm-tools/dmfilemapd.c:647:12: branch_false: following ‘false’ branch (when ‘pid == 0’)...
LVM2.2.03.38/libdm/dm-tools/dmfilemapd.c:653:13: branch_false: ...to here
LVM2.2.03.38/libdm/dm-tools/dmfilemapd.c:653:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/libdm/dm-tools/dmfilemapd.c:658:13: branch_false: ...to here
LVM2.2.03.38/libdm/dm-tools/dmfilemapd.c:658:12: branch_true: following ‘true’ branch...
LVM2.2.03.38/libdm/dm-tools/dmfilemapd.c:659:27: branch_true: ...to here
LVM2.2.03.38/libdm/dm-tools/dmfilemapd.c:659:20: branch_false: following ‘false’ branch...
LVM2.2.03.38/libdm/dm-tools/dmfilemapd.c:664:20: branch_false: ...to here
LVM2.2.03.38/libdm/dm-tools/dmfilemapd.c:664:20: branch_true: following ‘true’ branch...
LVM2.2.03.38/libdm/dm-tools/dmfilemapd.c:664:47: branch_true: ...to here
LVM2.2.03.38/libdm/dm-tools/dmfilemapd.c:664:47: acquire_resource: opened here
LVM2.2.03.38/libdm/dm-tools/dmfilemapd.c:664:21: danger: ‘dup2(open("/dev/null", 2), 0)’ leaks here; was opened at [(15)](sarif:/runs/0/results/11/codeFlows/0/threadFlows/0/locations/14)
#  662|   		}
#  663|   
#  664|-> 		if (((fd != STDIN_FILENO) && (dup2(fd, STDIN_FILENO) == -1)) ||
#  665|   		    ((fd != STDOUT_FILENO) && (dup2(fd, STDOUT_FILENO) == -1)) ||
#  666|   		    ((fd != STDERR_FILENO) && (dup2(fd, STDERR_FILENO) == -1))) {

Error: GCC_ANALYZER_WARNING (CWE-775): [#def480]
LVM2.2.03.38/libdm/dm-tools/dmfilemapd.c:664:21: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘open("/dev/null", 2)’
LVM2.2.03.38/libdm/dm-tools/dmfilemapd.c:637:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/libdm/dm-tools/dmfilemapd.c:642:20: branch_false: ...to here
LVM2.2.03.38/libdm/dm-tools/dmfilemapd.c:642:12: branch_false: following ‘false’ branch (when ‘pid >= 0’)...
LVM2.2.03.38/libdm/dm-tools/dmfilemapd.c:647:12: branch_false: ...to here
LVM2.2.03.38/libdm/dm-tools/dmfilemapd.c:647:12: branch_false: following ‘false’ branch (when ‘pid == 0’)...
LVM2.2.03.38/libdm/dm-tools/dmfilemapd.c:653:13: branch_false: ...to here
LVM2.2.03.38/libdm/dm-tools/dmfilemapd.c:653:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/libdm/dm-tools/dmfilemapd.c:658:13: branch_false: ...to here
LVM2.2.03.38/libdm/dm-tools/dmfilemapd.c:658:12: branch_true: following ‘true’ branch...
LVM2.2.03.38/libdm/dm-tools/dmfilemapd.c:659:27: branch_true: ...to here
LVM2.2.03.38/libdm/dm-tools/dmfilemapd.c:659:27: acquire_resource: opened here
LVM2.2.03.38/libdm/dm-tools/dmfilemapd.c:659:20: branch_false: following ‘false’ branch...
LVM2.2.03.38/libdm/dm-tools/dmfilemapd.c:664:20: branch_false: ...to here
LVM2.2.03.38/libdm/dm-tools/dmfilemapd.c:665:21: branch_false: following ‘false’ branch...
LVM2.2.03.38/libdm/dm-tools/dmfilemapd.c:664:21: branch_false: ...to here
LVM2.2.03.38/libdm/dm-tools/dmfilemapd.c:664:21: danger: ‘open("/dev/null", 2)’ leaks here; was opened at [(11)](sarif:/runs/0/results/13/codeFlows/0/threadFlows/0/locations/10)
#  662|   		}
#  663|   
#  664|-> 		if (((fd != STDIN_FILENO) && (dup2(fd, STDIN_FILENO) == -1)) ||
#  665|   		    ((fd != STDOUT_FILENO) && (dup2(fd, STDOUT_FILENO) == -1)) ||
#  666|   		    ((fd != STDERR_FILENO) && (dup2(fd, STDERR_FILENO) == -1))) {

Error: GCC_ANALYZER_WARNING (CWE-775): [#def481]
LVM2.2.03.38/libdm/dm-tools/dmfilemapd.c:665:21: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘dup2(open("/dev/null", 2), 1)’
LVM2.2.03.38/libdm/dm-tools/dmfilemapd.c:637:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/libdm/dm-tools/dmfilemapd.c:642:20: branch_false: ...to here
LVM2.2.03.38/libdm/dm-tools/dmfilemapd.c:642:12: branch_false: following ‘false’ branch (when ‘pid >= 0’)...
LVM2.2.03.38/libdm/dm-tools/dmfilemapd.c:647:12: branch_false: ...to here
LVM2.2.03.38/libdm/dm-tools/dmfilemapd.c:647:12: branch_false: following ‘false’ branch (when ‘pid == 0’)...
LVM2.2.03.38/libdm/dm-tools/dmfilemapd.c:653:13: branch_false: ...to here
LVM2.2.03.38/libdm/dm-tools/dmfilemapd.c:653:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/libdm/dm-tools/dmfilemapd.c:658:13: branch_false: ...to here
LVM2.2.03.38/libdm/dm-tools/dmfilemapd.c:658:12: branch_true: following ‘true’ branch...
LVM2.2.03.38/libdm/dm-tools/dmfilemapd.c:659:27: branch_true: ...to here
LVM2.2.03.38/libdm/dm-tools/dmfilemapd.c:659:20: branch_false: following ‘false’ branch...
LVM2.2.03.38/libdm/dm-tools/dmfilemapd.c:664:20: branch_false: ...to here
LVM2.2.03.38/libdm/dm-tools/dmfilemapd.c:665:48: acquire_resource: opened here
LVM2.2.03.38/libdm/dm-tools/dmfilemapd.c:665:21: danger: ‘dup2(open("/dev/null", 2), 1)’ leaks here; was opened at [(13)](sarif:/runs/0/results/12/codeFlows/0/threadFlows/0/locations/12)
#  663|   
#  664|   		if (((fd != STDIN_FILENO) && (dup2(fd, STDIN_FILENO) == -1)) ||
#  665|-> 		    ((fd != STDOUT_FILENO) && (dup2(fd, STDOUT_FILENO) == -1)) ||
#  666|   		    ((fd != STDERR_FILENO) && (dup2(fd, STDERR_FILENO) == -1))) {
#  667|   			if (fd > STDERR_FILENO)

Error: GCC_ANALYZER_WARNING (CWE-775): [#def482]
LVM2.2.03.38/libdm/dm-tools/dmfilemapd.c:666:21: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘dup2(open("/dev/null", 2), 2)’
LVM2.2.03.38/libdm/dm-tools/dmfilemapd.c:637:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/libdm/dm-tools/dmfilemapd.c:642:20: branch_false: ...to here
LVM2.2.03.38/libdm/dm-tools/dmfilemapd.c:642:12: branch_false: following ‘false’ branch (when ‘pid >= 0’)...
LVM2.2.03.38/libdm/dm-tools/dmfilemapd.c:647:12: branch_false: ...to here
LVM2.2.03.38/libdm/dm-tools/dmfilemapd.c:647:12: branch_false: following ‘false’ branch (when ‘pid == 0’)...
LVM2.2.03.38/libdm/dm-tools/dmfilemapd.c:653:13: branch_false: ...to here
LVM2.2.03.38/libdm/dm-tools/dmfilemapd.c:653:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/libdm/dm-tools/dmfilemapd.c:658:13: branch_false: ...to here
LVM2.2.03.38/libdm/dm-tools/dmfilemapd.c:658:12: branch_true: following ‘true’ branch...
LVM2.2.03.38/libdm/dm-tools/dmfilemapd.c:659:27: branch_true: ...to here
LVM2.2.03.38/libdm/dm-tools/dmfilemapd.c:659:20: branch_false: following ‘false’ branch...
LVM2.2.03.38/libdm/dm-tools/dmfilemapd.c:664:20: branch_false: ...to here
LVM2.2.03.38/libdm/dm-tools/dmfilemapd.c:664:21: branch_false: following ‘false’ branch...
LVM2.2.03.38/libdm/dm-tools/dmfilemapd.c:664:21: branch_false: ...to here
LVM2.2.03.38/libdm/dm-tools/dmfilemapd.c:666:48: acquire_resource: opened here
LVM2.2.03.38/libdm/dm-tools/dmfilemapd.c:666:21: danger: ‘dup2(open("/dev/null", 2), 2)’ leaks here; was opened at [(15)](sarif:/runs/0/results/14/codeFlows/0/threadFlows/0/locations/14)
#  664|   		if (((fd != STDIN_FILENO) && (dup2(fd, STDIN_FILENO) == -1)) ||
#  665|   		    ((fd != STDOUT_FILENO) && (dup2(fd, STDOUT_FILENO) == -1)) ||
#  666|-> 		    ((fd != STDERR_FILENO) && (dup2(fd, STDERR_FILENO) == -1))) {
#  667|   			if (fd > STDERR_FILENO)
#  668|   				(void) close(fd);

Error: GCC_ANALYZER_WARNING (CWE-775): [#def483]
LVM2.2.03.38/libdm/dm-tools/dmfilemapd.c:667:28: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘open("/dev/null", 2)’
LVM2.2.03.38/libdm/dm-tools/dmfilemapd.c:637:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/libdm/dm-tools/dmfilemapd.c:642:20: branch_false: ...to here
LVM2.2.03.38/libdm/dm-tools/dmfilemapd.c:642:12: branch_false: following ‘false’ branch (when ‘pid >= 0’)...
LVM2.2.03.38/libdm/dm-tools/dmfilemapd.c:647:12: branch_false: ...to here
LVM2.2.03.38/libdm/dm-tools/dmfilemapd.c:647:12: branch_false: following ‘false’ branch (when ‘pid == 0’)...
LVM2.2.03.38/libdm/dm-tools/dmfilemapd.c:653:13: branch_false: ...to here
LVM2.2.03.38/libdm/dm-tools/dmfilemapd.c:653:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/libdm/dm-tools/dmfilemapd.c:658:13: branch_false: ...to here
LVM2.2.03.38/libdm/dm-tools/dmfilemapd.c:658:12: branch_true: following ‘true’ branch...
LVM2.2.03.38/libdm/dm-tools/dmfilemapd.c:659:27: branch_true: ...to here
LVM2.2.03.38/libdm/dm-tools/dmfilemapd.c:659:27: acquire_resource: opened here
LVM2.2.03.38/libdm/dm-tools/dmfilemapd.c:659:20: branch_false: following ‘false’ branch...
LVM2.2.03.38/libdm/dm-tools/dmfilemapd.c:664:20: branch_false: ...to here
LVM2.2.03.38/libdm/dm-tools/dmfilemapd.c:667:28: danger: ‘open("/dev/null", 2)’ leaks here; was opened at [(11)](sarif:/runs/0/results/15/codeFlows/0/threadFlows/0/locations/10)
#  665|   		    ((fd != STDOUT_FILENO) && (dup2(fd, STDOUT_FILENO) == -1)) ||
#  666|   		    ((fd != STDERR_FILENO) && (dup2(fd, STDERR_FILENO) == -1))) {
#  667|-> 			if (fd > STDERR_FILENO)
#  668|   				(void) close(fd);
#  669|   			_early_log("Error redirecting stdin/out/err to null.");

Error: GCC_ANALYZER_WARNING (CWE-775): [#def484]
LVM2.2.03.38/libdm/dm-tools/dmfilemapd.c:668:40: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘open("/dev/null", 2)’
LVM2.2.03.38/libdm/dm-tools/dmfilemapd.c:637:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/libdm/dm-tools/dmfilemapd.c:642:20: branch_false: ...to here
LVM2.2.03.38/libdm/dm-tools/dmfilemapd.c:642:12: branch_false: following ‘false’ branch (when ‘pid >= 0’)...
LVM2.2.03.38/libdm/dm-tools/dmfilemapd.c:647:12: branch_false: ...to here
LVM2.2.03.38/libdm/dm-tools/dmfilemapd.c:647:12: branch_false: following ‘false’ branch (when ‘pid == 0’)...
LVM2.2.03.38/libdm/dm-tools/dmfilemapd.c:653:13: branch_false: ...to here
LVM2.2.03.38/libdm/dm-tools/dmfilemapd.c:653:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/libdm/dm-tools/dmfilemapd.c:658:13: branch_false: ...to here
LVM2.2.03.38/libdm/dm-tools/dmfilemapd.c:658:12: branch_true: following ‘true’ branch...
LVM2.2.03.38/libdm/dm-tools/dmfilemapd.c:659:27: branch_true: ...to here
LVM2.2.03.38/libdm/dm-tools/dmfilemapd.c:659:27: acquire_resource: opened here
LVM2.2.03.38/libdm/dm-tools/dmfilemapd.c:659:20: branch_false: following ‘false’ branch...
LVM2.2.03.38/libdm/dm-tools/dmfilemapd.c:664:20: branch_false: ...to here
LVM2.2.03.38/libdm/dm-tools/dmfilemapd.c:667:28: branch_true: following ‘true’ branch...
LVM2.2.03.38/libdm/dm-tools/dmfilemapd.c:668:40: branch_true: ...to here
LVM2.2.03.38/libdm/dm-tools/dmfilemapd.c:668:40: danger: ‘open("/dev/null", 2)’ leaks here; was opened at [(11)](sarif:/runs/0/results/16/codeFlows/0/threadFlows/0/locations/10)
#  666|   		    ((fd != STDERR_FILENO) && (dup2(fd, STDERR_FILENO) == -1))) {
#  667|   			if (fd > STDERR_FILENO)
#  668|-> 				(void) close(fd);
#  669|   			_early_log("Error redirecting stdin/out/err to null.");
#  670|   			/* coverity[leaked_handle] fd is stdin/stdout/stderr */

Error: GCC_ANALYZER_WARNING (CWE-775): [#def485]
LVM2.2.03.38/libdm/dm-tools/dmfilemapd.c:673:20: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘open("/dev/null", 2)’
LVM2.2.03.38/libdm/dm-tools/dmfilemapd.c:637:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/libdm/dm-tools/dmfilemapd.c:642:20: branch_false: ...to here
LVM2.2.03.38/libdm/dm-tools/dmfilemapd.c:642:12: branch_false: following ‘false’ branch (when ‘pid >= 0’)...
LVM2.2.03.38/libdm/dm-tools/dmfilemapd.c:647:12: branch_false: ...to here
LVM2.2.03.38/libdm/dm-tools/dmfilemapd.c:647:12: branch_false: following ‘false’ branch (when ‘pid == 0’)...
LVM2.2.03.38/libdm/dm-tools/dmfilemapd.c:653:13: branch_false: ...to here
LVM2.2.03.38/libdm/dm-tools/dmfilemapd.c:653:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/libdm/dm-tools/dmfilemapd.c:658:13: branch_false: ...to here
LVM2.2.03.38/libdm/dm-tools/dmfilemapd.c:658:12: branch_true: following ‘true’ branch...
LVM2.2.03.38/libdm/dm-tools/dmfilemapd.c:659:27: branch_true: ...to here
LVM2.2.03.38/libdm/dm-tools/dmfilemapd.c:659:27: acquire_resource: opened here
LVM2.2.03.38/libdm/dm-tools/dmfilemapd.c:659:20: branch_false: following ‘false’ branch...
LVM2.2.03.38/libdm/dm-tools/dmfilemapd.c:664:20: branch_false: ...to here
LVM2.2.03.38/libdm/dm-tools/dmfilemapd.c:664:21: branch_false: following ‘false’ branch...
LVM2.2.03.38/libdm/dm-tools/dmfilemapd.c:664:21: branch_false: ...to here
LVM2.2.03.38/libdm/dm-tools/dmfilemapd.c:666:21: branch_false: following ‘false’ branch...
LVM2.2.03.38/libdm/dm-tools/dmfilemapd.c:673:20: branch_false: ...to here
LVM2.2.03.38/libdm/dm-tools/dmfilemapd.c:673:20: danger: ‘open("/dev/null", 2)’ leaks here; was opened at [(11)](sarif:/runs/0/results/17/codeFlows/0/threadFlows/0/locations/10)
#  671|   			return 0;
#  672|   		}
#  673|-> 		if (fd > STDERR_FILENO)
#  674|   			(void) close(fd);
#  675|   	}

Error: GCC_ANALYZER_WARNING (CWE-775): [#def486]
LVM2.2.03.38/libdm/dm-tools/dmfilemapd.c:674:32: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘open("/dev/null", 2)’
LVM2.2.03.38/libdm/dm-tools/dmfilemapd.c:637:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/libdm/dm-tools/dmfilemapd.c:642:20: branch_false: ...to here
LVM2.2.03.38/libdm/dm-tools/dmfilemapd.c:642:12: branch_false: following ‘false’ branch (when ‘pid >= 0’)...
LVM2.2.03.38/libdm/dm-tools/dmfilemapd.c:647:12: branch_false: ...to here
LVM2.2.03.38/libdm/dm-tools/dmfilemapd.c:647:12: branch_false: following ‘false’ branch (when ‘pid == 0’)...
LVM2.2.03.38/libdm/dm-tools/dmfilemapd.c:653:13: branch_false: ...to here
LVM2.2.03.38/libdm/dm-tools/dmfilemapd.c:653:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/libdm/dm-tools/dmfilemapd.c:658:13: branch_false: ...to here
LVM2.2.03.38/libdm/dm-tools/dmfilemapd.c:658:12: branch_true: following ‘true’ branch...
LVM2.2.03.38/libdm/dm-tools/dmfilemapd.c:659:27: branch_true: ...to here
LVM2.2.03.38/libdm/dm-tools/dmfilemapd.c:659:27: acquire_resource: opened here
LVM2.2.03.38/libdm/dm-tools/dmfilemapd.c:659:20: branch_false: following ‘false’ branch...
LVM2.2.03.38/libdm/dm-tools/dmfilemapd.c:664:20: branch_false: ...to here
LVM2.2.03.38/libdm/dm-tools/dmfilemapd.c:664:21: branch_false: following ‘false’ branch...
LVM2.2.03.38/libdm/dm-tools/dmfilemapd.c:664:21: branch_false: ...to here
LVM2.2.03.38/libdm/dm-tools/dmfilemapd.c:665:21: branch_false: following ‘false’ branch...
LVM2.2.03.38/libdm/dm-tools/dmfilemapd.c:664:21: branch_false: ...to here
LVM2.2.03.38/libdm/dm-tools/dmfilemapd.c:664:21: branch_true: following ‘true’ branch...
LVM2.2.03.38/libdm/dm-tools/dmfilemapd.c:666:48: branch_true: ...to here
LVM2.2.03.38/libdm/dm-tools/dmfilemapd.c:666:21: branch_false: following ‘false’ branch...
LVM2.2.03.38/libdm/dm-tools/dmfilemapd.c:673:20: branch_false: ...to here
LVM2.2.03.38/libdm/dm-tools/dmfilemapd.c:673:20: branch_true: following ‘true’ branch...
LVM2.2.03.38/libdm/dm-tools/dmfilemapd.c:674:32: branch_true: ...to here
LVM2.2.03.38/libdm/dm-tools/dmfilemapd.c:674:32: danger: ‘open("/dev/null", 2)’ leaks here; was opened at [(11)](sarif:/runs/0/results/18/codeFlows/0/threadFlows/0/locations/10)
#  672|   		}
#  673|   		if (fd > STDERR_FILENO)
#  674|-> 			(void) close(fd);
#  675|   	}
#  676|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def487]
LVM2.2.03.38/libdm/dm-tools/dmfilemapd.c:827:9: warning[-Wanalyzer-malloc-leak]: leak of ‘fm.path’
LVM2.2.03.38/libdm/dm-tools/dmfilemapd.c:816:5: enter_function: entry to ‘main’
LVM2.2.03.38/libdm/dm-tools/dmfilemapd.c:820:14: call_function: calling ‘_parse_args’ from ‘main’
LVM2.2.03.38/libdm/dm-tools/dmfilemapd.c:820:14: return_function: returning to ‘main’ from ‘_parse_args’
LVM2.2.03.38/libdm/dm-tools/dmfilemapd.c:820:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/libdm/dm-tools/dmfilemapd.c:825:9: branch_false: ...to here
LVM2.2.03.38/libdm/dm-tools/dmfilemapd.c:827:9: throw: if the called function throws an exception...
LVM2.2.03.38/libdm/dm-tools/dmfilemapd.c:827:9: danger: ‘fm.path’ leaks here; was allocated at [(14)](sarif:/runs/0/results/19/codeFlows/0/threadFlows/0/locations/13)
#  825|   	_setup_logging();
#  826|   
#  827|-> 	log_info("Starting dmfilemapd with fd=%d, group_id=" FMTu64 " "
#  828|   		 "mode=%s, path=\"%s\"", fm.fd, fm.group_id,
#  829|   		 _mode_names[fm.mode], fm.path);

Error: CPPCHECK_WARNING (CWE-758): [#def488]
LVM2.2.03.38/libdm/dm-tools/dmsetup.c:5022: warning[objectIndex]: The address of variable 'region_id' might be accessed at non-zero index.
# 5020|   			this_len = (segments) ? segment_len : this_len;
# 5021|   			/* coverity[ptr_arith] intentional */
# 5022|-> 			if (!(r = dm_stats_create_region(dms, &region_ids[count],
# 5023|   							 this_start, this_len, step,
# 5024|   							 precise, bounds,

Error: GCC_ANALYZER_WARNING (CWE-401): [#def489]
LVM2.2.03.38/libdm/ioctl/libdm-iface.c:1383:26: warning[-Wanalyzer-malloc-leak]: leak of ‘opendir(dm_dir())’
LVM2.2.03.38/libdm/ioctl/libdm-iface.c:1378:19: acquire_memory: allocated here
LVM2.2.03.38/libdm/ioctl/libdm-iface.c:1378:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/libdm/ioctl/libdm-iface.c:1378:12: branch_false: ...to here
LVM2.2.03.38/libdm/ioctl/libdm-iface.c:1383:26: throw: if ‘readdir’ throws an exception...
LVM2.2.03.38/libdm/ioctl/libdm-iface.c:1383:26: danger: ‘opendir(dm_dir())’ leaks here; was allocated at [(1)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/0)
# 1381|   	}
# 1382|   
# 1383|-> 	while ((dirent = readdir(d))) {
# 1384|   		if (!strcmp(dirent->d_name, ".") ||
# 1385|   		    !strcmp(dirent->d_name, "..") ||

Error: GCC_ANALYZER_WARNING (CWE-401): [#def490]
LVM2.2.03.38/libdm/libdm-common.c:361:26: warning[-Wanalyzer-malloc-leak]: leak of ‘opendir(&_dm_dir)’
LVM2.2.03.38/libdm/libdm-common.c:2243:5: enter_function: entry to ‘dm_mknodes’
LVM2.2.03.38/libdm/libdm-common.c:2248:21: call_function: calling ‘dm_task_create’ from ‘dm_mknodes’
LVM2.2.03.38/libdm/libdm-common.c:2248:21: return_function: returning to ‘dm_mknodes’ from ‘dm_task_create’
LVM2.2.03.38/libdm/libdm-common.c:2248:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/libdm/libdm-common.c:2251:12: branch_false: ...to here
LVM2.2.03.38/libdm/libdm-common.c:2251:12: branch_true: following ‘true’ branch (when ‘name’ is non-NULL)...
LVM2.2.03.38/libdm/libdm-common.c:2251:22: branch_true: ...to here
LVM2.2.03.38/libdm/libdm-common.c:2251:22: call_function: calling ‘dm_task_set_name’ from ‘dm_mknodes’
#  359|   	}
#  360|   
#  361|-> 	while ((dirent = readdir(d))) {
#  362|   		name = dirent->d_name;
#  363|   

Error: GCC_ANALYZER_WARNING (CWE-775): [#def491]
LVM2.2.03.38/libdm/libdm-common.c:1823:17: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(&_mountinfo, "r")’
LVM2.2.03.38/libdm/libdm-common.c:1862:5: enter_function: entry to ‘dm_mountinfo_read’
LVM2.2.03.38/libdm/libdm-common.c:1870:23: acquire_resource: opened here
LVM2.2.03.38/libdm/libdm-common.c:1870:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/libdm/libdm-common.c:1870:12: branch_false: ...to here
LVM2.2.03.38/libdm/libdm-common.c:1878:16: branch_true: following ‘true’ branch...
LVM2.2.03.38/libdm/libdm-common.c:1880:22: call_function: calling ‘_mountinfo_parse_line’ from ‘dm_mountinfo_read’
# 1821|   		   "s %" DM_TO_STRING(PATH_MAX) "s",
# 1822|   		   maj, min, root, target) < 4) {
# 1823|-> 		log_error("Failed to parse mountinfo line.");
# 1824|   		return 0;
# 1825|   	}

Error: GCC_ANALYZER_WARNING (CWE-401): [#def492]
LVM2.2.03.38/libdm/libdm-common.c:1823:17: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(&_mountinfo, "r")’
LVM2.2.03.38/libdm/libdm-common.c:1862:5: enter_function: entry to ‘dm_mountinfo_read’
LVM2.2.03.38/libdm/libdm-common.c:1870:23: acquire_memory: allocated here
LVM2.2.03.38/libdm/libdm-common.c:1870:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/libdm/libdm-common.c:1870:12: branch_false: ...to here
LVM2.2.03.38/libdm/libdm-common.c:1878:16: branch_true: following ‘true’ branch...
LVM2.2.03.38/libdm/libdm-common.c:1880:22: call_function: calling ‘_mountinfo_parse_line’ from ‘dm_mountinfo_read’
# 1821|   		   "s %" DM_TO_STRING(PATH_MAX) "s",
# 1822|   		   maj, min, root, target) < 4) {
# 1823|-> 		log_error("Failed to parse mountinfo line.");
# 1824|   		return 0;
# 1825|   	}

Error: GCC_ANALYZER_WARNING (CWE-775): [#def493]
LVM2.2.03.38/libdm/libdm-common.c:1829:13: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(&_mountinfo, "r")’
LVM2.2.03.38/libdm/libdm-common.c:1862:5: enter_function: entry to ‘dm_mountinfo_read’
LVM2.2.03.38/libdm/libdm-common.c:1870:23: acquire_resource: opened here
LVM2.2.03.38/libdm/libdm-common.c:1870:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/libdm/libdm-common.c:1870:12: branch_false: ...to here
LVM2.2.03.38/libdm/libdm-common.c:1878:16: branch_true: following ‘true’ branch...
LVM2.2.03.38/libdm/libdm-common.c:1880:22: call_function: calling ‘_mountinfo_parse_line’ from ‘dm_mountinfo_read’
# 1827|   	/* btrfs fakes device numbers, but there is still /dev/mapper name
# 1828|   	 * placed in mountinfo, so try to detect proper major:minor via this */
# 1829|-> 	if (*maj == 0 && (devmapper = strstr(line, "/dev/mapper/"))) {
# 1830|   		if (!(dmt = dm_task_create(DM_DEVICE_INFO))) {
# 1831|   			log_error("Mount info task creation failed.");

Error: GCC_ANALYZER_WARNING (CWE-401): [#def494]
LVM2.2.03.38/libdm/libdm-common.c:1829:13: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(&_mountinfo, "r")’
LVM2.2.03.38/libdm/libdm-common.c:1862:5: enter_function: entry to ‘dm_mountinfo_read’
LVM2.2.03.38/libdm/libdm-common.c:1870:23: acquire_memory: allocated here
LVM2.2.03.38/libdm/libdm-common.c:1870:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/libdm/libdm-common.c:1870:12: branch_false: ...to here
LVM2.2.03.38/libdm/libdm-common.c:1878:16: branch_true: following ‘true’ branch...
LVM2.2.03.38/libdm/libdm-common.c:1880:22: call_function: calling ‘_mountinfo_parse_line’ from ‘dm_mountinfo_read’
# 1827|   	/* btrfs fakes device numbers, but there is still /dev/mapper name
# 1828|   	 * placed in mountinfo, so try to detect proper major:minor via this */
# 1829|-> 	if (*maj == 0 && (devmapper = strstr(line, "/dev/mapper/"))) {
# 1830|   		if (!(dmt = dm_task_create(DM_DEVICE_INFO))) {
# 1831|   			log_error("Mount info task creation failed.");

Error: GCC_ANALYZER_WARNING (CWE-775): [#def495]
LVM2.2.03.38/libdm/libdm-common.c:1916:17: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(&sysfs_path, "r")’
LVM2.2.03.38/libdm/libdm-common.c:1900:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/libdm/libdm-common.c:1907:20: branch_false: ...to here
LVM2.2.03.38/libdm/libdm-common.c:1907:20: acquire_resource: opened here
LVM2.2.03.38/libdm/libdm-common.c:1907:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/libdm/libdm-common.c:1915:14: branch_false: ...to here
LVM2.2.03.38/libdm/libdm-common.c:1915:12: branch_true: following ‘true’ branch...
LVM2.2.03.38/libdm/libdm-common.c:1916:17: branch_true: ...to here
LVM2.2.03.38/libdm/libdm-common.c:1916:17: throw: if the called function throws an exception...
LVM2.2.03.38/libdm/libdm-common.c:1916:17: danger: ‘fopen(&sysfs_path, "r")’ leaks here; was opened at [(3)](sarif:/runs/0/results/17/codeFlows/0/threadFlows/0/locations/2)
# 1914|   
# 1915|   	if (!fgets(temp_buf, sizeof(temp_buf), fp)) {
# 1916|-> 		log_sys_error("fgets", sysfs_path);
# 1917|   		goto bad;
# 1918|   	}

Error: GCC_ANALYZER_WARNING (CWE-401): [#def496]
LVM2.2.03.38/libdm/libdm-common.c:1916:17: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(&sysfs_path, "r")’
LVM2.2.03.38/libdm/libdm-common.c:1900:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/libdm/libdm-common.c:1907:20: branch_false: ...to here
LVM2.2.03.38/libdm/libdm-common.c:1907:20: acquire_memory: allocated here
LVM2.2.03.38/libdm/libdm-common.c:1907:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/libdm/libdm-common.c:1915:14: branch_false: ...to here
LVM2.2.03.38/libdm/libdm-common.c:1915:12: branch_true: following ‘true’ branch...
LVM2.2.03.38/libdm/libdm-common.c:1916:17: branch_true: ...to here
LVM2.2.03.38/libdm/libdm-common.c:1916:17: throw: if the called function throws an exception...
LVM2.2.03.38/libdm/libdm-common.c:1916:17: danger: ‘fopen(&sysfs_path, "r")’ leaks here; was allocated at [(3)](sarif:/runs/0/results/18/codeFlows/0/threadFlows/0/locations/2)
# 1914|   
# 1915|   	if (!fgets(temp_buf, sizeof(temp_buf), fp)) {
# 1916|-> 		log_sys_error("fgets", sysfs_path);
# 1917|   		goto bad;
# 1918|   	}

Error: GCC_ANALYZER_WARNING (CWE-775): [#def497]
LVM2.2.03.38/libdm/libdm-common.c:1923:17: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(&sysfs_path, "r")’
LVM2.2.03.38/libdm/libdm-common.c:1900:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/libdm/libdm-common.c:1907:20: branch_false: ...to here
LVM2.2.03.38/libdm/libdm-common.c:1907:20: acquire_resource: opened here
LVM2.2.03.38/libdm/libdm-common.c:1907:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/libdm/libdm-common.c:1915:14: branch_false: ...to here
LVM2.2.03.38/libdm/libdm-common.c:1915:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/libdm/libdm-common.c:1920:15: branch_false: ...to here
LVM2.2.03.38/libdm/libdm-common.c:1922:12: branch_true: following ‘true’ branch (when ‘len > buf_size’)...
LVM2.2.03.38/libdm/libdm-common.c:1923:17: branch_true: ...to here
LVM2.2.03.38/libdm/libdm-common.c:1923:17: throw: if the called function throws an exception...
LVM2.2.03.38/libdm/libdm-common.c:1923:17: danger: ‘fopen(&sysfs_path, "r")’ leaks here; was opened at [(3)](sarif:/runs/0/results/19/codeFlows/0/threadFlows/0/locations/2)
# 1921|   
# 1922|   	if (len > buf_size) {
# 1923|-> 		log_error("_sysfs_get_dm_name: supplied buffer too small.");
# 1924|   		goto bad;
# 1925|   	}

Error: GCC_ANALYZER_WARNING (CWE-401): [#def498]
LVM2.2.03.38/libdm/libdm-common.c:1923:17: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(&sysfs_path, "r")’
LVM2.2.03.38/libdm/libdm-common.c:1900:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/libdm/libdm-common.c:1907:20: branch_false: ...to here
LVM2.2.03.38/libdm/libdm-common.c:1907:20: acquire_memory: allocated here
LVM2.2.03.38/libdm/libdm-common.c:1907:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/libdm/libdm-common.c:1915:14: branch_false: ...to here
LVM2.2.03.38/libdm/libdm-common.c:1915:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/libdm/libdm-common.c:1920:15: branch_false: ...to here
LVM2.2.03.38/libdm/libdm-common.c:1922:12: branch_true: following ‘true’ branch (when ‘len > buf_size’)...
LVM2.2.03.38/libdm/libdm-common.c:1923:17: branch_true: ...to here
LVM2.2.03.38/libdm/libdm-common.c:1923:17: throw: if the called function throws an exception...
LVM2.2.03.38/libdm/libdm-common.c:1923:17: danger: ‘fopen(&sysfs_path, "r")’ leaks here; was allocated at [(3)](sarif:/runs/0/results/20/codeFlows/0/threadFlows/0/locations/2)
# 1921|   
# 1922|   	if (len > buf_size) {
# 1923|-> 		log_error("_sysfs_get_dm_name: supplied buffer too small.");
# 1924|   		goto bad;
# 1925|   	}

Error: GCC_ANALYZER_WARNING (CWE-401): [#def499]
LVM2.2.03.38/libdm/libdm-common.c:1981:32: warning[-Wanalyzer-malloc-leak]: leak of ‘opendir(&path)’
LVM2.2.03.38/libdm/libdm-common.c:1970:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/libdm/libdm-common.c:1971:13: branch_false: ...to here
LVM2.2.03.38/libdm/libdm-common.c:1970:13: branch_false: following ‘false’ branch...
LVM2.2.03.38/libdm/libdm-common.c:1976:19: branch_false: ...to here
LVM2.2.03.38/libdm/libdm-common.c:1976:19: acquire_memory: allocated here
LVM2.2.03.38/libdm/libdm-common.c:1976:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/libdm/libdm-common.c:1976:12: branch_false: ...to here
LVM2.2.03.38/libdm/libdm-common.c:1981:16: branch_true: following ‘true’ branch (when ‘r == 0’)...
LVM2.2.03.38/libdm/libdm-common.c:1981:32: branch_true: ...to here
LVM2.2.03.38/libdm/libdm-common.c:1981:32: throw: if ‘readdir’ throws an exception...
LVM2.2.03.38/libdm/libdm-common.c:1981:32: danger: ‘opendir(&path)’ leaks here; was allocated at [(5)](sarif:/runs/0/results/21/codeFlows/0/threadFlows/0/locations/4)
# 1979|   	}
# 1980|   
# 1981|-> 	while (!r && (dirent = readdir(d))) {
# 1982|   		name = dirent->d_name;
# 1983|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def500]
LVM2.2.03.38/libdm/libdm-common.c:2010:46: warning[-Wanalyzer-malloc-leak]: leak of ‘opendir(&path)’
LVM2.2.03.38/libdm/libdm-common.c:1970:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/libdm/libdm-common.c:1971:13: branch_false: ...to here
LVM2.2.03.38/libdm/libdm-common.c:1970:13: branch_false: following ‘false’ branch...
LVM2.2.03.38/libdm/libdm-common.c:1976:19: branch_false: ...to here
LVM2.2.03.38/libdm/libdm-common.c:1976:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/libdm/libdm-common.c:1976:12: branch_false: ...to here
LVM2.2.03.38/libdm/libdm-common.c:1981:16: branch_true: following ‘true’ branch...
LVM2.2.03.38/libdm/libdm-common.c:1993:20: branch_false: following ‘false’ branch...
LVM2.2.03.38/libdm/libdm-common.c:1998:22: branch_false: ...to here
LVM2.2.03.38/libdm/libdm-common.c:2005:39: acquire_memory: allocated here
LVM2.2.03.38/libdm/libdm-common.c:2010:46: throw: if ‘readdir’ throws an exception...
LVM2.2.03.38/libdm/libdm-common.c:2010:46: danger: ‘opendir(&path)’ leaks here; was allocated at [(11)](sarif:/runs/0/results/22/codeFlows/0/threadFlows/0/locations/10)
# 2008|   			}
# 2009|   
# 2010|-> 			while ((dirent_dev = readdir(d_dev))) {
# 2011|   				name_dev = dirent_dev->d_name;
# 2012|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def501]
LVM2.2.03.38/libdm/libdm-common.c:2165:26: warning[-Wanalyzer-malloc-leak]: leak of ‘opendir(&sysfs_path)’
LVM2.2.03.38/libdm/libdm-common.c:2154:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/libdm/libdm-common.c:2159:19: branch_false: ...to here
LVM2.2.03.38/libdm/libdm-common.c:2159:19: acquire_memory: allocated here
LVM2.2.03.38/libdm/libdm-common.c:2159:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/libdm/libdm-common.c:2159:12: branch_false: ...to here
LVM2.2.03.38/libdm/libdm-common.c:2165:26: throw: if ‘readdir’ throws an exception...
LVM2.2.03.38/libdm/libdm-common.c:2165:26: danger: ‘opendir(&sysfs_path)’ leaks here; was allocated at [(3)](sarif:/runs/0/results/23/codeFlows/0/threadFlows/0/locations/2)
# 2163|   	}
# 2164|   
# 2165|-> 	while ((dirent = readdir(d))) {
# 2166|   		if (!strcmp(dirent->d_name, ".") || !strcmp(dirent->d_name, ".."))
# 2167|   			continue;

Error: GCC_ANALYZER_WARNING (CWE-775): [#def502]
LVM2.2.03.38/libdm/libdm-common.c:2575:25: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘open("/dev/urandom", 0)’
LVM2.2.03.38/libdm/libdm-common.c:2564:19: acquire_resource: opened here
LVM2.2.03.38/libdm/libdm-common.c:2564:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/libdm/libdm-common.c:2564:12: branch_false: ...to here
LVM2.2.03.38/libdm/libdm-common.c:2575:25: throw: if the called function throws an exception...
LVM2.2.03.38/libdm/libdm-common.c:2575:25: danger: ‘open("/dev/urandom", 0)’ leaks here; was opened at [(1)](sarif:/runs/0/results/24/codeFlows/0/threadFlows/0/locations/0)
# 2573|   		/* FIXME Handle non-error returns from read(). Move _io() into libdm? */
# 2574|   		if (read(fd, &base_cookie, sizeof(base_cookie)) != sizeof(base_cookie)) {
# 2575|-> 			log_error("Failed to initialize notification cookie");
# 2576|   			goto bad;
# 2577|   		}

Error: GCC_ANALYZER_WARNING (CWE-775): [#def503]
LVM2.2.03.38/libdm/libdm-common.c:2579:30: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘open("/dev/urandom", 0)’
LVM2.2.03.38/libdm/libdm-common.c:2564:19: acquire_resource: opened here
LVM2.2.03.38/libdm/libdm-common.c:2564:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/libdm/libdm-common.c:2564:12: branch_false: ...to here
LVM2.2.03.38/libdm/libdm-common.c:2574:20: branch_false: following ‘false’ branch...
LVM2.2.03.38/libdm/libdm-common.c:2579:30: branch_false: ...to here
LVM2.2.03.38/libdm/libdm-common.c:2590:41: throw: if the called function throws an exception...
LVM2.2.03.38/libdm/libdm-common.c:2579:30: danger: ‘open("/dev/urandom", 0)’ leaks here; was opened at [(1)](sarif:/runs/0/results/26/codeFlows/0/threadFlows/0/locations/0)
# 2577|   		}
# 2578|   
# 2579|-> 		gen_cookie = DM_COOKIE_MAGIC << 16 | base_cookie;
# 2580|   
# 2581|   		if (base_cookie && (gen_semid = semget((key_t) gen_cookie,

Error: GCC_ANALYZER_WARNING (CWE-401): [#def504]
LVM2.2.03.38/libdm/libdm-file.c:116:26: warning[-Wanalyzer-malloc-leak]: leak of ‘opendir(dir)’
LVM2.2.03.38/libdm/libdm-file.c:111:19: acquire_memory: allocated here
LVM2.2.03.38/libdm/libdm-file.c:111:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/libdm/libdm-file.c:111:12: branch_false: ...to here
LVM2.2.03.38/libdm/libdm-file.c:116:26: throw: if ‘readdir’ throws an exception...
LVM2.2.03.38/libdm/libdm-file.c:116:26: danger: ‘opendir(dir)’ leaks here; was allocated at [(1)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/0)
#  114|   	}
#  115|   
#  116|-> 	while ((dirent = readdir(d)))
#  117|   		if (strcmp(dirent->d_name, ".") && strcmp(dirent->d_name, ".."))
#  118|   			break;

Error: GCC_ANALYZER_WARNING (CWE-775): [#def505]
LVM2.2.03.38/libdm/libdm-file.c:249:12: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘open(lockfile, 0)’
LVM2.2.03.38/libdm/libdm-file.c:242:17: acquire_resource: opened here
LVM2.2.03.38/libdm/libdm-file.c:242:10: branch_false: following ‘false’ branch...
LVM2.2.03.38/libdm/libdm-file.c:245:8: branch_false: ...to here
LVM2.2.03.38/libdm/libdm-file.c:249:12: throw: if ‘fcntl’ throws an exception...
LVM2.2.03.38/libdm/libdm-file.c:249:12: danger: ‘open(lockfile, 0)’ leaks here; was opened at [(1)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/0)
#  247|          lock.l_whence = SEEK_SET;
#  248|          lock.l_len = 0;
#  249|->        if (fcntl(fd, F_GETLK, &lock) < 0) {
#  250|                  log_error("Cannot check lock status of lockfile [%s], error was [%s]",
#  251|                            lockfile, strerror(errno));

Error: COMPILER_WARNING: [#def506]
LVM2.2.03.38/libdm/libdm-stats.c: scope_hint: In function ‘_stats_group_tag_len’
LVM2.2.03.38/libdm/libdm-stats.c:1867:17: warning[-Wunused-but-set-variable=]: variable ‘nr_regions’ set but not used
# 1867 |         int64_t nr_regions = 0;
#      |                 ^~~~~~~~~~
# 1865|   {
# 1866|   	int i, j, next;
# 1867|-> 	int64_t nr_regions = 0;
# 1868|   	size_t buflen = 0, id_len = 0;
# 1869|   

Error: CPPCHECK_WARNING (CWE-457): [#def507]
LVM2.2.03.38/libdm/libdm-stats.c:2293: error[legacyUninitvar]: Uninitialized variable: lines
# 2291|   	if (dm_snprintf(msg, sizeof(msg), "@stats_print%s " FMTu64 " %s",
# 2292|   			(clear) ? "_clear" : "",
# 2293|-> 			region_id, (start_line || num_lines) ? lines : "") < 0) {
# 2294|   		err = "message";
# 2295|   		goto_bad;

Error: GCC_ANALYZER_WARNING (CWE-404): [#def508]
LVM2.2.03.38/libdm/libdm-string.c:149:21: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
LVM2.2.03.38/libdm/libdm-string.c:184:5: enter_function: entry to ‘dm_asprintf’
LVM2.2.03.38/libdm/libdm-string.c:188:9: acquire_resource: ‘va_start’ called here
LVM2.2.03.38/libdm/libdm-string.c:189:13: call_function: calling ‘dm_vasprintf’ from ‘dm_asprintf’
#  147|   	int i, n, size = 16;
#  148|   	va_list ap;
#  149|-> 	char *buf = dm_malloc(size);
#  150|   
#  151|   	*result = 0;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def509]
LVM2.2.03.38/test/unit/bcache_t.c:85:9: warning[-Wanalyzer-malloc-leak]: leak of ‘f’
LVM2.2.03.38/test/unit/bcache_t.c:334:24: enter_function: entry to ‘_fixture_init’
LVM2.2.03.38/test/unit/bcache_t.c:336:29: acquire_memory: allocated here
LVM2.2.03.38/test/unit/bcache_t.c:338:9: branch_false: following ‘false’ branch (when ‘f’ is non-NULL)...
LVM2.2.03.38/test/unit/bcache_t.c:340:17: branch_false: ...to here
LVM2.2.03.38/test/unit/bcache_t.c:340:17: call_function: calling ‘_mock_create’ from ‘_fixture_init’
LVM2.2.03.38/test/unit/bcache_t.c:340:17: return_function: returning to ‘_fixture_init’ from ‘_mock_create’
LVM2.2.03.38/test/unit/bcache_t.c:343:9: call_function: calling ‘_expect’ from ‘_fixture_init’
#   83|   	struct mock_call *mc = malloc(sizeof(*mc));
#   84|   
#   85|-> 	T_ASSERT(mc);
#   86|   	mc->m = m;
#   87|   	mc->match_args = false;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def510]
LVM2.2.03.38/test/unit/bcache_t.c:88:9: warning[-Wanalyzer-malloc-leak]: leak of ‘f’
LVM2.2.03.38/test/unit/bcache_t.c:334:24: enter_function: entry to ‘_fixture_init’
LVM2.2.03.38/test/unit/bcache_t.c:336:29: acquire_memory: allocated here
LVM2.2.03.38/test/unit/bcache_t.c:338:9: branch_false: following ‘false’ branch (when ‘f’ is non-NULL)...
LVM2.2.03.38/test/unit/bcache_t.c:340:17: branch_false: ...to here
LVM2.2.03.38/test/unit/bcache_t.c:340:17: call_function: calling ‘_mock_create’ from ‘_fixture_init’
LVM2.2.03.38/test/unit/bcache_t.c:340:17: return_function: returning to ‘_fixture_init’ from ‘_mock_create’
LVM2.2.03.38/test/unit/bcache_t.c:343:9: call_function: calling ‘_expect’ from ‘_fixture_init’
#   86|   	mc->m = m;
#   87|   	mc->match_args = false;
#   88|-> 	dm_list_add(&e->expected_calls, &mc->list);
#   89|   }
#   90|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def511]
LVM2.2.03.38/test/unit/bcache_t.c:88:9: warning[-Wanalyzer-malloc-leak]: leak of ‘mc’
LVM2.2.03.38/test/unit/bcache_t.c:83:32: acquire_memory: allocated here
LVM2.2.03.38/test/unit/bcache_t.c:85:9: branch_false: following ‘false’ branch (when ‘mc’ is non-NULL)...
LVM2.2.03.38/test/unit/bcache_t.c:86:9: branch_false: ...to here
LVM2.2.03.38/test/unit/bcache_t.c:88:9: throw: if ‘dm_list_add’ throws an exception...
LVM2.2.03.38/test/unit/bcache_t.c:88:9: danger: ‘mc’ leaks here; was allocated at [(1)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/0)
#   86|   	mc->m = m;
#   87|   	mc->match_args = false;
#   88|-> 	dm_list_add(&e->expected_calls, &mc->list);
#   89|   }
#   90|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def512]
LVM2.2.03.38/test/unit/bcache_t.c:103:9: warning[-Wanalyzer-malloc-leak]: leak of ‘mc’
LVM2.2.03.38/test/unit/bcache_t.c:93:32: acquire_memory: allocated here
LVM2.2.03.38/test/unit/bcache_t.c:95:9: branch_false: following ‘false’ branch (when ‘mc’ is non-NULL)...
LVM2.2.03.38/test/unit/bcache_t.c:96:9: branch_false: ...to here
LVM2.2.03.38/test/unit/bcache_t.c:103:9: throw: if ‘dm_list_add’ throws an exception...
LVM2.2.03.38/test/unit/bcache_t.c:103:9: danger: ‘mc’ leaks here; was allocated at [(1)](sarif:/runs/0/results/3/codeFlows/0/threadFlows/0/locations/0)
#  101|   	mc->issue_r = true;
#  102|   	mc->wait_r = true;
#  103|-> 	dm_list_add(&e->expected_calls, &mc->list);
#  104|   }
#  105|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def513]
LVM2.2.03.38/test/unit/bcache_t.c:115:9: warning[-Wanalyzer-malloc-leak]: leak of ‘mc’
LVM2.2.03.38/test/unit/bcache_t.c:108:32: acquire_memory: allocated here
LVM2.2.03.38/test/unit/bcache_t.c:110:9: branch_false: following ‘false’ branch (when ‘mc’ is non-NULL)...
LVM2.2.03.38/test/unit/bcache_t.c:111:9: branch_false: ...to here
LVM2.2.03.38/test/unit/bcache_t.c:115:9: throw: if ‘dm_list_add’ throws an exception...
LVM2.2.03.38/test/unit/bcache_t.c:115:9: danger: ‘mc’ leaks here; was allocated at [(1)](sarif:/runs/0/results/4/codeFlows/0/threadFlows/0/locations/0)
#  113|   	mc->issue_r = true;
#  114|   	mc->wait_r = true;
#  115|-> 	dm_list_add(&e->expected_calls, &mc->list);
#  116|   }
#  117|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def514]
LVM2.2.03.38/test/unit/bcache_t.c:130:9: warning[-Wanalyzer-malloc-leak]: leak of ‘mc’
LVM2.2.03.38/test/unit/bcache_t.c:120:32: acquire_memory: allocated here
LVM2.2.03.38/test/unit/bcache_t.c:122:9: branch_false: following ‘false’ branch (when ‘mc’ is non-NULL)...
LVM2.2.03.38/test/unit/bcache_t.c:123:9: branch_false: ...to here
LVM2.2.03.38/test/unit/bcache_t.c:130:9: throw: if ‘dm_list_add’ throws an exception...
LVM2.2.03.38/test/unit/bcache_t.c:130:9: danger: ‘mc’ leaks here; was allocated at [(1)](sarif:/runs/0/results/5/codeFlows/0/threadFlows/0/locations/0)
#  128|   	mc->issue_r = true;
#  129|   	mc->wait_r = true;
#  130|-> 	dm_list_add(&e->expected_calls, &mc->list);
#  131|   }
#  132|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def515]
LVM2.2.03.38/test/unit/bcache_t.c:145:9: warning[-Wanalyzer-malloc-leak]: leak of ‘mc’
LVM2.2.03.38/test/unit/bcache_t.c:135:32: acquire_memory: allocated here
LVM2.2.03.38/test/unit/bcache_t.c:137:9: branch_false: following ‘false’ branch (when ‘mc’ is non-NULL)...
LVM2.2.03.38/test/unit/bcache_t.c:138:9: branch_false: ...to here
LVM2.2.03.38/test/unit/bcache_t.c:145:9: throw: if ‘dm_list_add’ throws an exception...
LVM2.2.03.38/test/unit/bcache_t.c:145:9: danger: ‘mc’ leaks here; was allocated at [(1)](sarif:/runs/0/results/6/codeFlows/0/threadFlows/0/locations/0)
#  143|   	mc->issue_r = false;
#  144|   	mc->wait_r = true;
#  145|-> 	dm_list_add(&e->expected_calls, &mc->list);
#  146|   }
#  147|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def516]
LVM2.2.03.38/test/unit/bcache_t.c:160:9: warning[-Wanalyzer-malloc-leak]: leak of ‘mc’
LVM2.2.03.38/test/unit/bcache_t.c:150:32: acquire_memory: allocated here
LVM2.2.03.38/test/unit/bcache_t.c:152:9: branch_false: following ‘false’ branch (when ‘mc’ is non-NULL)...
LVM2.2.03.38/test/unit/bcache_t.c:153:9: branch_false: ...to here
LVM2.2.03.38/test/unit/bcache_t.c:160:9: throw: if ‘dm_list_add’ throws an exception...
LVM2.2.03.38/test/unit/bcache_t.c:160:9: danger: ‘mc’ leaks here; was allocated at [(1)](sarif:/runs/0/results/7/codeFlows/0/threadFlows/0/locations/0)
#  158|   	mc->issue_r = false;
#  159|   	mc->wait_r = true;
#  160|-> 	dm_list_add(&e->expected_calls, &mc->list);
#  161|   }
#  162|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def517]
LVM2.2.03.38/test/unit/bcache_t.c:175:9: warning[-Wanalyzer-malloc-leak]: leak of ‘mc’
LVM2.2.03.38/test/unit/bcache_t.c:165:32: acquire_memory: allocated here
LVM2.2.03.38/test/unit/bcache_t.c:167:9: branch_false: following ‘false’ branch (when ‘mc’ is non-NULL)...
LVM2.2.03.38/test/unit/bcache_t.c:168:9: branch_false: ...to here
LVM2.2.03.38/test/unit/bcache_t.c:175:9: throw: if ‘dm_list_add’ throws an exception...
LVM2.2.03.38/test/unit/bcache_t.c:175:9: danger: ‘mc’ leaks here; was allocated at [(1)](sarif:/runs/0/results/8/codeFlows/0/threadFlows/0/locations/0)
#  173|   	mc->issue_r = true;
#  174|   	mc->wait_r = false;
#  175|-> 	dm_list_add(&e->expected_calls, &mc->list);
#  176|   }
#  177|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def518]
LVM2.2.03.38/test/unit/bcache_t.c:190:9: warning[-Wanalyzer-malloc-leak]: leak of ‘mc’
LVM2.2.03.38/test/unit/bcache_t.c:180:32: acquire_memory: allocated here
LVM2.2.03.38/test/unit/bcache_t.c:182:9: branch_false: following ‘false’ branch (when ‘mc’ is non-NULL)...
LVM2.2.03.38/test/unit/bcache_t.c:183:9: branch_false: ...to here
LVM2.2.03.38/test/unit/bcache_t.c:190:9: throw: if ‘dm_list_add’ throws an exception...
LVM2.2.03.38/test/unit/bcache_t.c:190:9: danger: ‘mc’ leaks here; was allocated at [(1)](sarif:/runs/0/results/9/codeFlows/0/threadFlows/0/locations/0)
#  188|   	mc->issue_r = true;
#  189|   	mc->wait_r = false;
#  190|-> 	dm_list_add(&e->expected_calls, &mc->list);
#  191|   }
#  192|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def519]
LVM2.2.03.38/test/unit/bcache_t.c:277:17: warning[-Wanalyzer-malloc-leak]: leak of ‘io’
LVM2.2.03.38/test/unit/bcache_t.c:246:13: enter_function: entry to ‘_mock_issue’
LVM2.2.03.38/test/unit/bcache_t.c:254:14: call_function: calling ‘_match_pop’ from ‘_mock_issue’
LVM2.2.03.38/test/unit/bcache_t.c:254:14: return_function: returning to ‘_mock_issue’ from ‘_match_pop’
LVM2.2.03.38/test/unit/bcache_t.c:265:12: branch_true: following ‘true’ branch (when ‘r != 0’)...
LVM2.2.03.38/test/unit/bcache_t.c:266:22: branch_true: ...to here
LVM2.2.03.38/test/unit/bcache_t.c:266:22: acquire_memory: allocated here
LVM2.2.03.38/test/unit/bcache_t.c:267:20: branch_false: following ‘false’ branch (when ‘io’ is non-NULL)...
LVM2.2.03.38/test/unit/bcache_t.c:270:17: branch_false: ...to here
LVM2.2.03.38/test/unit/bcache_t.c:277:17: throw: if ‘dm_list_add’ throws an exception...
LVM2.2.03.38/test/unit/bcache_t.c:277:17: danger: ‘io’ leaks here; was allocated at [(11)](sarif:/runs/0/results/10/codeFlows/0/threadFlows/0/locations/10)
#  275|   		io->r = wait_r;
#  276|   
#  277|-> 		dm_list_add(&me->issued_io, &io->list);
#  278|   	}
#  279|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def520]
LVM2.2.03.38/test/unit/bcache_t.c:311:9: warning[-Wanalyzer-malloc-leak]: leak of ‘f’
LVM2.2.03.38/test/unit/bcache_t.c:334:24: enter_function: entry to ‘_fixture_init’
LVM2.2.03.38/test/unit/bcache_t.c:336:29: acquire_memory: allocated here
LVM2.2.03.38/test/unit/bcache_t.c:338:9: branch_false: following ‘false’ branch (when ‘f’ is non-NULL)...
LVM2.2.03.38/test/unit/bcache_t.c:340:17: branch_false: ...to here
LVM2.2.03.38/test/unit/bcache_t.c:340:17: call_function: calling ‘_mock_create’ from ‘_fixture_init’
#  309|   	struct mock_engine *m = malloc(sizeof(*m));
#  310|   
#  311|-> 	T_ASSERT(m);
#  312|   
#  313|   	m->e.destroy = _mock_destroy;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def521]
LVM2.2.03.38/test/unit/bcache_t.c:320:9: warning[-Wanalyzer-malloc-leak]: leak of ‘f’
LVM2.2.03.38/test/unit/bcache_t.c:334:24: enter_function: entry to ‘_fixture_init’
LVM2.2.03.38/test/unit/bcache_t.c:336:29: acquire_memory: allocated here
LVM2.2.03.38/test/unit/bcache_t.c:338:9: branch_false: following ‘false’ branch (when ‘f’ is non-NULL)...
LVM2.2.03.38/test/unit/bcache_t.c:340:17: branch_false: ...to here
LVM2.2.03.38/test/unit/bcache_t.c:340:17: call_function: calling ‘_mock_create’ from ‘_fixture_init’
#  318|   	m->max_io = max_io;
#  319|   	m->block_size = block_size;
#  320|-> 	dm_list_init(&m->expected_calls);
#  321|   	dm_list_init(&m->issued_io);
#  322|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def522]
LVM2.2.03.38/test/unit/bcache_t.c:320:9: warning[-Wanalyzer-malloc-leak]: leak of ‘m’
LVM2.2.03.38/test/unit/bcache_t.c:309:33: acquire_memory: allocated here
LVM2.2.03.38/test/unit/bcache_t.c:311:9: branch_false: following ‘false’ branch (when ‘m’ is non-NULL)...
LVM2.2.03.38/test/unit/bcache_t.c:313:9: branch_false: ...to here
LVM2.2.03.38/test/unit/bcache_t.c:320:9: throw: if ‘dm_list_init’ throws an exception...
LVM2.2.03.38/test/unit/bcache_t.c:320:9: danger: ‘m’ leaks here; was allocated at [(1)](sarif:/runs/0/results/13/codeFlows/0/threadFlows/0/locations/0)
#  318|   	m->max_io = max_io;
#  319|   	m->block_size = block_size;
#  320|-> 	dm_list_init(&m->expected_calls);
#  321|   	dm_list_init(&m->issued_io);
#  322|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def523]
LVM2.2.03.38/test/unit/bcache_t.c:321:9: warning[-Wanalyzer-malloc-leak]: leak of ‘f’
LVM2.2.03.38/test/unit/bcache_t.c:334:24: enter_function: entry to ‘_fixture_init’
LVM2.2.03.38/test/unit/bcache_t.c:336:29: acquire_memory: allocated here
LVM2.2.03.38/test/unit/bcache_t.c:338:9: branch_false: following ‘false’ branch (when ‘f’ is non-NULL)...
LVM2.2.03.38/test/unit/bcache_t.c:340:17: branch_false: ...to here
LVM2.2.03.38/test/unit/bcache_t.c:340:17: call_function: calling ‘_mock_create’ from ‘_fixture_init’
#  319|   	m->block_size = block_size;
#  320|   	dm_list_init(&m->expected_calls);
#  321|-> 	dm_list_init(&m->issued_io);
#  322|   
#  323|   	return m;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def524]
LVM2.2.03.38/test/unit/bcache_t.c:344:20: warning[-Wanalyzer-malloc-leak]: leak of ‘f’
LVM2.2.03.38/test/unit/bcache_t.c:334:24: enter_function: entry to ‘_fixture_init’
LVM2.2.03.38/test/unit/bcache_t.c:336:29: acquire_memory: allocated here
LVM2.2.03.38/test/unit/bcache_t.c:338:9: branch_false: following ‘false’ branch (when ‘f’ is non-NULL)...
LVM2.2.03.38/test/unit/bcache_t.c:340:17: branch_false: ...to here
LVM2.2.03.38/test/unit/bcache_t.c:340:17: call_function: calling ‘_mock_create’ from ‘_fixture_init’
LVM2.2.03.38/test/unit/bcache_t.c:340:17: return_function: returning to ‘_fixture_init’ from ‘_mock_create’
LVM2.2.03.38/test/unit/bcache_t.c:343:9: call_function: calling ‘_expect’ from ‘_fixture_init’
LVM2.2.03.38/test/unit/bcache_t.c:343:9: return_function: returning to ‘_fixture_init’ from ‘_expect’
LVM2.2.03.38/test/unit/bcache_t.c:344:20: throw: if ‘bcache_create’ throws an exception...
LVM2.2.03.38/test/unit/bcache_t.c:344:20: danger: ‘f’ leaks here; was allocated at [(2)](sarif:/runs/0/results/15/codeFlows/0/threadFlows/0/locations/1)
#  342|   
#  343|   	_expect(f->me, E_MAX_IO);
#  344|-> 	f->cache = bcache_create(block_size, nr_cache_blocks, &f->me->e);
#  345|   	T_ASSERT(f->cache);
#  346|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def525]
LVM2.2.03.38/test/unit/bcache_t.c:345:9: warning[-Wanalyzer-malloc-leak]: leak of ‘f’
LVM2.2.03.38/test/unit/bcache_t.c:334:24: enter_function: entry to ‘_fixture_init’
LVM2.2.03.38/test/unit/bcache_t.c:336:29: acquire_memory: allocated here
LVM2.2.03.38/test/unit/bcache_t.c:338:9: branch_false: following ‘false’ branch (when ‘f’ is non-NULL)...
LVM2.2.03.38/test/unit/bcache_t.c:340:17: branch_false: ...to here
LVM2.2.03.38/test/unit/bcache_t.c:340:17: call_function: calling ‘_mock_create’ from ‘_fixture_init’
LVM2.2.03.38/test/unit/bcache_t.c:340:17: return_function: returning to ‘_fixture_init’ from ‘_mock_create’
LVM2.2.03.38/test/unit/bcache_t.c:343:9: call_function: calling ‘_expect’ from ‘_fixture_init’
LVM2.2.03.38/test/unit/bcache_t.c:343:9: return_function: returning to ‘_fixture_init’ from ‘_expect’
LVM2.2.03.38/test/unit/bcache_t.c:345:9: branch_true: following ‘true’ branch...
LVM2.2.03.38/test/unit/bcache_t.c:345:9: branch_true: ...to here
LVM2.2.03.38/test/unit/bcache_t.c:345:9: throw: if ‘test_fail’ throws an exception...
LVM2.2.03.38/test/unit/bcache_t.c:345:9: danger: ‘f’ leaks here; was allocated at [(2)](sarif:/runs/0/results/16/codeFlows/0/threadFlows/0/locations/1)
#  343|   	_expect(f->me, E_MAX_IO);
#  344|   	f->cache = bcache_create(block_size, nr_cache_blocks, &f->me->e);
#  345|-> 	T_ASSERT(f->cache);
#  346|   
#  347|   	return f;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def526]
LVM2.2.03.38/test/unit/bcache_utils_t.c:163:17: warning[-Wanalyzer-malloc-leak]: leak of ‘buffer’
LVM2.2.03.38/test/unit/bcache_utils_t.c:310:13: enter_function: entry to ‘_zero_cycle’
LVM2.2.03.38/test/unit/bcache_utils_t.c:312:9: call_function: calling ‘_verify’ from ‘_zero_cycle’
#  161|   		memset(buffer, 0, len2);
#  162|   
#  163|-> 		T_ASSERT(bcache_read_bytes(f->cache, f->di, byte_b, len2, buffer));
#  164|   		for (i = 0; i < len; i++)
#  165|           		T_ASSERT_EQUAL(buffer[i], _pattern_at(pat, byte_b + i));

Error: GCC_ANALYZER_WARNING (CWE-401): [#def527]
LVM2.2.03.38/test/unit/framework.c:29:17: warning[-Wanalyzer-malloc-leak]: leak of ‘ts’
LVM2.2.03.38/test/unit/framework.c:25:33: acquire_memory: allocated here
LVM2.2.03.38/test/unit/framework.c:26:12: branch_true: following ‘true’ branch (when ‘ts’ is non-NULL)...
LVM2.2.03.38/test/unit/framework.c:27:17: branch_true: ...to here
LVM2.2.03.38/test/unit/framework.c:29:17: throw: if ‘dm_list_init’ throws an exception...
LVM2.2.03.38/test/unit/framework.c:29:17: danger: ‘ts’ leaks here; was allocated at [(1)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/0)
#   27|   		ts->fixture_init = fixture_init;
#   28|   		ts->fixture_exit = fixture_exit;
#   29|-> 		dm_list_init(&ts->tests);
#   30|   	}
#   31|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def528]
LVM2.2.03.38/test/unit/framework.c:61:9: warning[-Wanalyzer-malloc-leak]: leak of ‘t’
LVM2.2.03.38/test/unit/framework.c:51:34: acquire_memory: allocated here
LVM2.2.03.38/test/unit/framework.c:52:12: branch_false: following ‘false’ branch (when ‘t’ is non-NULL)...
LVM2.2.03.38/test/unit/framework.c:57:9: branch_false: ...to here
LVM2.2.03.38/test/unit/framework.c:61:9: throw: if ‘dm_list_add’ throws an exception...
LVM2.2.03.38/test/unit/framework.c:61:9: danger: ‘t’ leaks here; was allocated at [(1)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/0)
#   59|   	t->desc = desc;
#   60|   	t->fn = fn;
#   61|-> 	dm_list_add(&ts->tests, &t->list);
#   62|   
#   63|   	return true;

Error: CPPCHECK_WARNING (CWE-401): [#def529]
LVM2.2.03.38/test/unit/framework.c:63: error[memleak]: Memory leak: t
#   61|   	dm_list_add(&ts->tests, &t->list);
#   62|   
#   63|-> 	return true;
#   64|   }
#   65|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def530]
LVM2.2.03.38/test/unit/io_engine_t.c:86:16: warning[-Wanalyzer-malloc-leak]: leak of ‘f’
LVM2.2.03.38/test/unit/io_engine_t.c:83:29: acquire_memory: allocated here
LVM2.2.03.38/test/unit/io_engine_t.c:85:9: branch_false: following ‘false’ branch (when ‘f’ is non-NULL)...
LVM2.2.03.38/test/unit/io_engine_t.c:86:16: branch_false: ...to here
LVM2.2.03.38/test/unit/io_engine_t.c:86:16: throw: if ‘create_async_io_engine’ throws an exception...
LVM2.2.03.38/test/unit/io_engine_t.c:86:16: danger: ‘f’ leaks here; was allocated at [(1)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/0)
#   84|   
#   85|           T_ASSERT(f);
#   86|->         f->e = create_async_io_engine();
#   87|           T_ASSERT(f->e);
#   88|   	if (posix_memalign((void **) &f->data, PAGE_SIZE, SECTOR_SIZE * BLOCK_SIZE_SECTORS))

Error: GCC_ANALYZER_WARNING (CWE-401): [#def531]
LVM2.2.03.38/test/unit/io_engine_t.c:87:9: warning[-Wanalyzer-malloc-leak]: leak of ‘f’
LVM2.2.03.38/test/unit/io_engine_t.c:83:29: acquire_memory: allocated here
LVM2.2.03.38/test/unit/io_engine_t.c:85:9: branch_false: following ‘false’ branch (when ‘f’ is non-NULL)...
LVM2.2.03.38/test/unit/io_engine_t.c:86:16: branch_false: ...to here
LVM2.2.03.38/test/unit/io_engine_t.c:87:9: branch_true: following ‘true’ branch...
LVM2.2.03.38/test/unit/io_engine_t.c:87:9: branch_true: ...to here
LVM2.2.03.38/test/unit/io_engine_t.c:87:9: throw: if ‘test_fail’ throws an exception...
LVM2.2.03.38/test/unit/io_engine_t.c:87:9: danger: ‘f’ leaks here; was allocated at [(1)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/0)
#   85|           T_ASSERT(f);
#   86|           f->e = create_async_io_engine();
#   87|->         T_ASSERT(f->e);
#   88|   	if (posix_memalign((void **) &f->data, PAGE_SIZE, SECTOR_SIZE * BLOCK_SIZE_SECTORS))
#   89|           	test_fail("posix_memalign failed");

Error: GCC_ANALYZER_WARNING (CWE-457): [#def532]
LVM2.2.03.38/test/unit/radix_tree_t.c:437:35: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘k[1]’
LVM2.2.03.38/test/unit/radix_tree_t.c:426:13: enter_function: entry to ‘test_iterate_subset’
LVM2.2.03.38/test/unit/radix_tree_t.c:435:21: branch_true: following ‘true’ branch (when ‘i != 100000’)...
LVM2.2.03.38/test/unit/radix_tree_t.c:436:17: branch_true: ...to here
LVM2.2.03.38/test/unit/radix_tree_t.c:436:17: call_function: calling ‘_gen_key’ from ‘test_iterate_subset’
LVM2.2.03.38/test/unit/radix_tree_t.c:436:17: return_function: returning to ‘test_iterate_subset’ from ‘_gen_key’
LVM2.2.03.38/test/unit/radix_tree_t.c:437:20: branch_true: following ‘true’ branch...
LVM2.2.03.38/test/unit/radix_tree_t.c:437:35: branch_true: ...to here
LVM2.2.03.38/test/unit/radix_tree_t.c:437:35: danger: use of uninitialized value ‘k[1]’ here
#  435|   	for (i = 0; i < 100000; i++) {
#  436|           	_gen_key(k, k + sizeof(k));
#  437|->         	if (k[0] == 21 && k[1] == 12)
#  438|                   	subset_count++;
#  439|   		v.n = i;

Error: CPPCHECK_WARNING (CWE-119): [#def533]
LVM2.2.03.38/tools/command.c:298: error[bufferAccessOutOfBounds]: Buffer is accessed out of bounds: cmd_names[1].name
#  296|   
#  297|   	/* Skip 1st. element for bsearch() */
#  298|-> 	if ((name = bsearch(str, cmd_names[1].name, CMD_COUNT - 1,
#  299|   			    sizeof(cmd_names[0]),
#  300|   			    (int (*)(const void*, const void*))strcmp)))

Error: CPPCHECK_WARNING (CWE-119): [#def534]
LVM2.2.03.38/tools/command.c:446: error[bufferAccessOutOfBounds]: Buffer is accessed out of bounds: command_names[0].name
#  444|   	}
#  445|   #endif
#  446|-> 	if ((name = bsearch(name, command_names[0].name, LVM_COMMAND_COUNT,
#  447|   			    sizeof(command_names[0]),
#  448|   			    (int (*)(const void*, const void*))strcmp)))

Error: GCC_ANALYZER_WARNING (CWE-401): [#def535]
LVM2.2.03.38/tools/command.c:1313:9: warning[-Wanalyzer-malloc-leak]: leak of ‘stdout_buf’
LVM2.2.03.38/tools/man-generator.c:1655:5: enter_function: entry to ‘main’
LVM2.2.03.38/tools/man-generator.c:1674:28: acquire_memory: allocated here
LVM2.2.03.38/tools/man-generator.c:1674:12: branch_false: following ‘false’ branch (when ‘stdout_buf’ is non-NULL)...
LVM2.2.03.38/tools/man-generator.c:1677:17: branch_false: ...to here
LVM2.2.03.38/tools/man-generator.c:1702:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/tools/man-generator.c:1707:13: branch_false: ...to here
LVM2.2.03.38/tools/man-generator.c:1707:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/tools/man-generator.c:1712:19: branch_false: ...to here
LVM2.2.03.38/tools/man-generator.c:1712:19: branch_false: following ‘false’ branch (when ‘check != 0’)...
LVM2.2.03.38/tools/man-generator.c:1717:13: branch_false: ...to here
LVM2.2.03.38/tools/man-generator.c:1717:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/tools/man-generator.c:1720:14: branch_false: ...to here
LVM2.2.03.38/tools/man-generator.c:1720:14: call_function: calling ‘define_commands’ from ‘main’
# 1311|   		opt_names_alpha[i] = &opt_names[i];
# 1312|   
# 1313|-> 	qsort(opt_names_alpha, ARG_COUNT, sizeof(long), _long_name_compare);
# 1314|   }
# 1315|   

Error: COMPILER_WARNING: [#def536]
LVM2.2.03.38/tools/lvconvert.c:6043:13: warning[-Wunused-but-set-variable=]: variable ‘lbs_unknown’ set but not used
# 6043 |         int lbs_unknown = 0, lbs_4k = 0, lbs_512 = 0;
#      |             ^~~~~~~~~~~
# 6041|   	uint32_t block_size_setting = 0;
# 6042|   	uint32_t block_size = 0;
# 6043|-> 	int lbs_unknown = 0, lbs_4k = 0, lbs_512 = 0;
# 6044|   	int pbs_unknown = 0, pbs_4k = 0, pbs_512 = 0;
# 6045|   	int rv = 0;

Error: COMPILER_WARNING: [#def537]
LVM2.2.03.38/tools/lvconvert.c:6044:13: warning[-Wunused-but-set-variable=]: variable ‘pbs_unknown’ set but not used
# 6044 |         int pbs_unknown = 0, pbs_4k = 0, pbs_512 = 0;
#      |             ^~~~~~~~~~~
# 6042|   	uint32_t block_size = 0;
# 6043|   	int lbs_unknown = 0, lbs_4k = 0, lbs_512 = 0;
# 6044|-> 	int pbs_unknown = 0, pbs_4k = 0, pbs_512 = 0;
# 6045|   	int rv = 0;
# 6046|   

Error: COMPILER_WARNING: [#def538]
LVM2.2.03.38/tools/lvconvert.c: scope_hint: In function ‘_set_writecache_block_size’
LVM2.2.03.38/tools/lvconvert.c:6044:42: warning[-Wunused-but-set-variable=]: variable ‘pbs_512’ set but not used
# 6044 |         int pbs_unknown = 0, pbs_4k = 0, pbs_512 = 0;
#      |                                          ^~~~~~~
# 6042|   	uint32_t block_size = 0;
# 6043|   	int lbs_unknown = 0, lbs_4k = 0, lbs_512 = 0;
# 6044|-> 	int pbs_unknown = 0, pbs_4k = 0, pbs_512 = 0;
# 6045|   	int rv = 0;
# 6046|   

Error: GCC_ANALYZER_WARNING (CWE-775): [#def539]
LVM2.2.03.38/tools/lvconvert.c:6224:25: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(&proc_meminfo, "r")’
LVM2.2.03.38/tools/lvconvert.c:6208:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/tools/lvconvert.c:6212:39: branch_false: ...to here
LVM2.2.03.38/tools/lvconvert.c:6211:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/tools/lvconvert.c:6217:20: branch_false: ...to here
LVM2.2.03.38/tools/lvconvert.c:6217:20: acquire_resource: opened here
LVM2.2.03.38/tools/lvconvert.c:6217:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/tools/lvconvert.c:6217:12: branch_false: ...to here
LVM2.2.03.38/tools/lvconvert.c:6220:16: branch_true: following ‘true’ branch...
LVM2.2.03.38/tools/lvconvert.c:6221:21: branch_true: ...to here
LVM2.2.03.38/tools/lvconvert.c:6223:20: branch_true: following ‘true’ branch...
LVM2.2.03.38/tools/lvconvert.c:6224:25: branch_true: ...to here
LVM2.2.03.38/tools/lvconvert.c:6224:25: throw: if ‘print_log’ throws an exception...
LVM2.2.03.38/tools/lvconvert.c:6224:25: danger: ‘fopen(&proc_meminfo, "r")’ leaks here; was opened at [(5)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/4)
# 6222|   			continue;
# 6223|   		if (sscanf(line, "%*s%llu%*s", &proc_mem_kb) != 1) {
# 6224|-> 			stack;
# 6225|   			break;
# 6226|   		}

Error: GCC_ANALYZER_WARNING (CWE-401): [#def540]
LVM2.2.03.38/tools/lvconvert.c:6224:25: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(&proc_meminfo, "r")’
LVM2.2.03.38/tools/lvconvert.c:6208:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/tools/lvconvert.c:6212:39: branch_false: ...to here
LVM2.2.03.38/tools/lvconvert.c:6211:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/tools/lvconvert.c:6217:20: branch_false: ...to here
LVM2.2.03.38/tools/lvconvert.c:6217:20: acquire_memory: allocated here
LVM2.2.03.38/tools/lvconvert.c:6217:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/tools/lvconvert.c:6217:12: branch_false: ...to here
LVM2.2.03.38/tools/lvconvert.c:6220:16: branch_true: following ‘true’ branch...
LVM2.2.03.38/tools/lvconvert.c:6221:21: branch_true: ...to here
LVM2.2.03.38/tools/lvconvert.c:6223:20: branch_true: following ‘true’ branch...
LVM2.2.03.38/tools/lvconvert.c:6224:25: branch_true: ...to here
LVM2.2.03.38/tools/lvconvert.c:6224:25: throw: if ‘print_log’ throws an exception...
LVM2.2.03.38/tools/lvconvert.c:6224:25: danger: ‘fopen(&proc_meminfo, "r")’ leaks here; was allocated at [(5)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/4)
# 6222|   			continue;
# 6223|   		if (sscanf(line, "%*s%llu%*s", &proc_mem_kb) != 1) {
# 6224|-> 			stack;
# 6225|   			break;
# 6226|   		}

Error: GCC_ANALYZER_WARNING (CWE-401): [#def541]
LVM2.2.03.38/tools/lvmcmdlib.c:70:13: warning[-Wanalyzer-malloc-leak]: leak of ‘cmdcopy’
LVM2.2.03.38/tools/lvmcmdlib.c:64:25: acquire_memory: allocated here
LVM2.2.03.38/tools/lvmcmdlib.c:64:12: branch_false: following ‘false’ branch (when ‘cmdcopy’ is non-NULL)...
LVM2.2.03.38/tools/lvmcmdlib.c:70:13: branch_false: ...to here
LVM2.2.03.38/tools/lvmcmdlib.c:70:13: throw: if ‘lvm_split’ throws an exception...
LVM2.2.03.38/tools/lvmcmdlib.c:70:13: danger: ‘cmdcopy’ leaks here; was allocated at [(1)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/0)
#   68|   	}
#   69|   
#   70|-> 	if (lvm_split(cmdcopy, &argc, argv, MAX_ARGS) == MAX_ARGS) {
#   71|   		log_error("Too many arguments.  Limit is %d.", MAX_ARGS);
#   72|   		ret = EINVALID_CMD_LINE;

Error: GCC_ANALYZER_WARNING (CWE-775): [#def542]
LVM2.2.03.38/tools/lvmcmdline.c:3539:29: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(script_file, "r")’
LVM2.2.03.38/tools/lvmcmdline.c:3534:23: acquire_resource: opened here
LVM2.2.03.38/tools/lvmcmdline.c:3534:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/tools/lvmcmdline.c:3534:12: branch_false: ...to here
LVM2.2.03.38/tools/lvmcmdline.c:3537:16: branch_true: following ‘true’ branch...
LVM2.2.03.38/tools/lvmcmdline.c:3538:20: branch_true: ...to here
LVM2.2.03.38/tools/lvmcmdline.c:3538:20: branch_true: following ‘true’ branch (when ‘magic_number == 0’)...
LVM2.2.03.38/tools/lvmcmdline.c:3539:29: branch_true: ...to here
LVM2.2.03.38/tools/lvmcmdline.c:3539:28: branch_true: following ‘true’ branch...
LVM2.2.03.38/tools/lvmcmdline.c:3546:20: branch_true: following ‘true’ branch...
LVM2.2.03.38/tools/lvmcmdline.c:3547:25: branch_true: ...to here
LVM2.2.03.38/tools/lvmcmdline.c:3549:25: throw: if ‘print_log’ throws an exception...
LVM2.2.03.38/tools/lvmcmdline.c:3539:29: danger: ‘fopen(script_file, "r")’ leaks here; was opened at [(1)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/0)
# 3537|   	while (fgets(buffer, sizeof(buffer), script) != NULL) {
# 3538|   		if (!magic_number) {
# 3539|-> 			if (buffer[0] == '#' && buffer[1] == '!')
# 3540|   				magic_number = 1;
# 3541|   			else {

Error: GCC_ANALYZER_WARNING (CWE-401): [#def543]
LVM2.2.03.38/tools/lvmcmdline.c:3539:29: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(script_file, "r")’
LVM2.2.03.38/tools/lvmcmdline.c:3534:23: acquire_memory: allocated here
LVM2.2.03.38/tools/lvmcmdline.c:3534:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/tools/lvmcmdline.c:3534:12: branch_false: ...to here
LVM2.2.03.38/tools/lvmcmdline.c:3537:16: branch_true: following ‘true’ branch...
LVM2.2.03.38/tools/lvmcmdline.c:3538:20: branch_true: ...to here
LVM2.2.03.38/tools/lvmcmdline.c:3538:20: branch_true: following ‘true’ branch (when ‘magic_number == 0’)...
LVM2.2.03.38/tools/lvmcmdline.c:3539:29: branch_true: ...to here
LVM2.2.03.38/tools/lvmcmdline.c:3539:28: branch_true: following ‘true’ branch...
LVM2.2.03.38/tools/lvmcmdline.c:3546:20: branch_true: following ‘true’ branch...
LVM2.2.03.38/tools/lvmcmdline.c:3547:25: branch_true: ...to here
LVM2.2.03.38/tools/lvmcmdline.c:3549:25: throw: if ‘print_log’ throws an exception...
LVM2.2.03.38/tools/lvmcmdline.c:3539:29: danger: ‘fopen(script_file, "r")’ leaks here; was allocated at [(1)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/0)
# 3537|   	while (fgets(buffer, sizeof(buffer), script) != NULL) {
# 3538|   		if (!magic_number) {
# 3539|-> 			if (buffer[0] == '#' && buffer[1] == '!')
# 3540|   				magic_number = 1;
# 3541|   			else {

Error: CPPCHECK_WARNING (CWE-457): [#def544]
LVM2.2.03.38/tools/lvmdevices.c:1036: error[legacyUninitvar]: Uninitialized variable: idname
# 1034|   			goto_bad;
# 1035|   
# 1036|-> 		if (!idtype_str || !idname || !strlen(idname) || !strlen(idtype_str))
# 1037|   			goto_bad;
# 1038|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def545]
LVM2.2.03.38/tools/man-generator.c:1736:24: warning[-Wanalyzer-malloc-leak]: leak of ‘stdout_buf’
LVM2.2.03.38/tools/man-generator.c:1674:28: acquire_memory: allocated here
LVM2.2.03.38/tools/man-generator.c:1674:12: branch_false: following ‘false’ branch (when ‘stdout_buf’ is non-NULL)...
LVM2.2.03.38/tools/man-generator.c:1677:17: branch_false: ...to here
LVM2.2.03.38/tools/man-generator.c:1735:12: branch_true: following ‘true’ branch (when ‘stdout_buf’ is non-NULL)...
LVM2.2.03.38/tools/man-generator.c:1736:17: branch_true: ...to here
LVM2.2.03.38/tools/man-generator.c:1736:24: throw: if ‘fflush’ throws an exception...
LVM2.2.03.38/tools/man-generator.c:1736:24: danger: ‘stdout_buf’ leaks here; was allocated at [(1)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/0)
# 1734|   out_free:
# 1735|   	if (stdout_buf) {
# 1736|-> 		(void) fflush(stdout);
# 1737|   		setlinebuf(stdout);
# 1738|   		free(stdout_buf);

Error: CPPCHECK_WARNING (CWE-562): [#def546]
LVM2.2.03.38/tools/polldaemon.c:539: error[autoVariables]: Address of local auto-variable assigned to a function parameter.
#  537|   	dm_list_init(&lpdp.idls);
#  538|   
#  539|-> 	handle->custom_handle = &lpdp;
#  540|   
#  541|   	if (ECMD_PROCESSED !=

Error: GCC_ANALYZER_WARNING (CWE-401): [#def547]
LVM2.2.03.38/tools/pvck.c:116:17: warning[-Wanalyzer-malloc-leak]: leak of ‘calloc(1, (long unsigned int)max)’
LVM2.2.03.38/tools/pvck.c:99:14: enter_function: entry to ‘_chars_to_hexstr’
LVM2.2.03.38/tools/pvck.c:107:21: call_function: inlined call to ‘zalloc’ from ‘_chars_to_hexstr’
LVM2.2.03.38/tools/pvck.c:107:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/tools/pvck.c:112:9: branch_false: ...to here
LVM2.2.03.38/tools/pvck.c:115:12: branch_true: following ‘true’ branch (when ‘max <= num’)...
LVM2.2.03.38/tools/pvck.c:116:17: branch_true: ...to here
LVM2.2.03.38/tools/pvck.c:116:17: throw: if ‘print_log’ throws an exception...
LVM2.2.03.38/tools/pvck.c:116:17: danger: ‘calloc(1, (long unsigned int)max)’ leaks here; was allocated at [(3)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/2)
#  114|   
#  115|   	if (num > max-1) {
#  116|-> 		log_print("CHECK: abbreviating output for %s", field);
#  117|   		num = max - 1;
#  118|   	}

Error: GCC_ANALYZER_WARNING (CWE-401): [#def548]
LVM2.2.03.38/tools/pvck.c:380:24: warning[-Wanalyzer-malloc-leak]: leak of ‘calloc(1, mda_size + 1)’
LVM2.2.03.38/tools/pvck.c:842:12: enter_function: entry to ‘_dump_meta_area’
LVM2.2.03.38/tools/pvck.c:849:12: branch_false: following ‘false’ branch (when ‘tofile’ is non-NULL)...
LVM2.2.03.38/tools/pvck.c:852:33: branch_false: ...to here
LVM2.2.03.38/tools/pvck.c:852:26: call_function: inlined call to ‘zalloc’ from ‘_dump_meta_area’
LVM2.2.03.38/tools/pvck.c:852:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/tools/pvck.c:855:14: branch_false: ...to here
LVM2.2.03.38/tools/pvck.c:855:14: call_function: calling ‘_read_bytes’ from ‘_dump_meta_area’
#  378|   
#  379|   	if (dev)
#  380|-> 		return dev_read_bytes(dev, start, len, data);
#  381|   
#  382|   	if (!def)

Error: GCC_ANALYZER_WARNING (CWE-401): [#def549]
LVM2.2.03.38/tools/pvck.c:385:15: warning[-Wanalyzer-malloc-leak]: leak of ‘calloc(1, mda_size + 1)’
LVM2.2.03.38/tools/pvck.c:842:12: enter_function: entry to ‘_dump_meta_area’
LVM2.2.03.38/tools/pvck.c:849:12: branch_false: following ‘false’ branch (when ‘tofile’ is non-NULL)...
LVM2.2.03.38/tools/pvck.c:852:33: branch_false: ...to here
LVM2.2.03.38/tools/pvck.c:852:26: call_function: inlined call to ‘zalloc’ from ‘_dump_meta_area’
LVM2.2.03.38/tools/pvck.c:852:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/tools/pvck.c:855:14: branch_false: ...to here
LVM2.2.03.38/tools/pvck.c:855:14: call_function: calling ‘_read_bytes’ from ‘_dump_meta_area’
LVM2.2.03.38/tools/pvck.c:855:14: return_function: returning to ‘_dump_meta_area’ from ‘_read_bytes’
LVM2.2.03.38/tools/pvck.c:855:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/tools/pvck.c:856:17: branch_false: ...to here
LVM2.2.03.38/tools/pvck.c:856:17: throw: if ‘print_log’ throws an exception...
LVM2.2.03.38/tools/pvck.c:385:15: danger: ‘calloc(1, mda_size + 1)’ leaks here; was allocated at [(5)](sarif:/runs/0/results/2/codeFlows/0/threadFlows/0/locations/4)
#  383|   		return false;
#  384|   
#  385|-> 	off = lseek(def->fd, start, SEEK_SET);
#  386|   	if (off != (off_t)start)
#  387|   		return false;

Error: GCC_ANALYZER_WARNING (CWE-775): [#def550]
LVM2.2.03.38/tools/pvck.c:642:21: warning[-Wanalyzer-file-leak]: leak of FILE ‘fp’
LVM2.2.03.38/tools/pvck.c:424:12: branch_true: following ‘true’ branch (when ‘tofile’ is non-NULL)...
LVM2.2.03.38/tools/pvck.c:425:28: branch_true: ...to here
LVM2.2.03.38/tools/pvck.c:425:28: acquire_resource: opened here
LVM2.2.03.38/tools/pvck.c:425:20: branch_false: following ‘false’ branch...
LVM2.2.03.38/tools/pvck.c:449:9: branch_false: ...to here
LVM2.2.03.38/tools/pvck.c:638:12: branch_false: following ‘false’ branch (when ‘multiple_vgs == 0’)...
LVM2.2.03.38/tools/pvck.c:641:12: branch_false: ...to here
LVM2.2.03.38/tools/pvck.c:641:12: branch_true: following ‘true’ branch (when ‘fp’ is non-NULL)...
LVM2.2.03.38/tools/pvck.c:642:21: branch_true: ...to here
LVM2.2.03.38/tools/pvck.c:642:21: throw: if ‘fflush’ throws an exception...
LVM2.2.03.38/tools/pvck.c:642:21: danger: ‘fp’ leaks here; was opened at [(3)](sarif:/runs/0/results/5/codeFlows/0/threadFlows/0/locations/2)
#  640|   
#  641|   	if (fp) {
#  642|-> 		if (fflush(fp))
#  643|   			stack;
#  644|   		if (fclose(fp))

Error: GCC_ANALYZER_WARNING (CWE-401): [#def551]
LVM2.2.03.38/tools/pvck.c:642:21: warning[-Wanalyzer-malloc-leak]: leak of ‘fp’
LVM2.2.03.38/tools/pvck.c:424:12: branch_true: following ‘true’ branch (when ‘tofile’ is non-NULL)...
LVM2.2.03.38/tools/pvck.c:425:28: branch_true: ...to here
LVM2.2.03.38/tools/pvck.c:425:28: acquire_memory: allocated here
LVM2.2.03.38/tools/pvck.c:425:20: branch_false: following ‘false’ branch...
LVM2.2.03.38/tools/pvck.c:449:9: branch_false: ...to here
LVM2.2.03.38/tools/pvck.c:638:12: branch_false: following ‘false’ branch (when ‘multiple_vgs == 0’)...
LVM2.2.03.38/tools/pvck.c:641:12: branch_false: ...to here
LVM2.2.03.38/tools/pvck.c:641:12: branch_true: following ‘true’ branch (when ‘fp’ is non-NULL)...
LVM2.2.03.38/tools/pvck.c:642:21: branch_true: ...to here
LVM2.2.03.38/tools/pvck.c:642:21: throw: if ‘fflush’ throws an exception...
LVM2.2.03.38/tools/pvck.c:642:21: danger: ‘fp’ leaks here; was allocated at [(3)](sarif:/runs/0/results/6/codeFlows/0/threadFlows/0/locations/2)
#  640|   
#  641|   	if (fp) {
#  642|-> 		if (fflush(fp))
#  643|   			stack;
#  644|   		if (fclose(fp))

Error: GCC_ANALYZER_WARNING (CWE-775): [#def552]
LVM2.2.03.38/tools/pvck.c:643:25: warning[-Wanalyzer-file-leak]: leak of FILE ‘fp’
LVM2.2.03.38/tools/pvck.c:424:12: branch_true: following ‘true’ branch (when ‘tofile’ is non-NULL)...
LVM2.2.03.38/tools/pvck.c:425:28: branch_true: ...to here
LVM2.2.03.38/tools/pvck.c:425:28: acquire_resource: opened here
LVM2.2.03.38/tools/pvck.c:425:20: branch_false: following ‘false’ branch...
LVM2.2.03.38/tools/pvck.c:449:9: branch_false: ...to here
LVM2.2.03.38/tools/pvck.c:638:12: branch_false: following ‘false’ branch (when ‘multiple_vgs == 0’)...
LVM2.2.03.38/tools/pvck.c:641:12: branch_false: ...to here
LVM2.2.03.38/tools/pvck.c:641:12: branch_true: following ‘true’ branch (when ‘fp’ is non-NULL)...
LVM2.2.03.38/tools/pvck.c:642:21: branch_true: ...to here
LVM2.2.03.38/tools/pvck.c:642:20: branch_true: following ‘true’ branch...
LVM2.2.03.38/tools/pvck.c:643:25: branch_true: ...to here
LVM2.2.03.38/tools/pvck.c:643:25: throw: if ‘print_log’ throws an exception...
LVM2.2.03.38/tools/pvck.c:643:25: danger: ‘fp’ leaks here; was opened at [(3)](sarif:/runs/0/results/7/codeFlows/0/threadFlows/0/locations/2)
#  641|   	if (fp) {
#  642|   		if (fflush(fp))
#  643|-> 			stack;
#  644|   		if (fclose(fp))
#  645|   			stack;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def553]
LVM2.2.03.38/tools/pvck.c:643:25: warning[-Wanalyzer-malloc-leak]: leak of ‘fp’
LVM2.2.03.38/tools/pvck.c:424:12: branch_true: following ‘true’ branch (when ‘tofile’ is non-NULL)...
LVM2.2.03.38/tools/pvck.c:425:28: branch_true: ...to here
LVM2.2.03.38/tools/pvck.c:425:28: acquire_memory: allocated here
LVM2.2.03.38/tools/pvck.c:425:20: branch_false: following ‘false’ branch...
LVM2.2.03.38/tools/pvck.c:449:9: branch_false: ...to here
LVM2.2.03.38/tools/pvck.c:638:12: branch_false: following ‘false’ branch (when ‘multiple_vgs == 0’)...
LVM2.2.03.38/tools/pvck.c:641:12: branch_false: ...to here
LVM2.2.03.38/tools/pvck.c:641:12: branch_true: following ‘true’ branch (when ‘fp’ is non-NULL)...
LVM2.2.03.38/tools/pvck.c:642:21: branch_true: ...to here
LVM2.2.03.38/tools/pvck.c:642:20: branch_true: following ‘true’ branch...
LVM2.2.03.38/tools/pvck.c:643:25: branch_true: ...to here
LVM2.2.03.38/tools/pvck.c:643:25: throw: if ‘print_log’ throws an exception...
LVM2.2.03.38/tools/pvck.c:643:25: danger: ‘fp’ leaks here; was allocated at [(3)](sarif:/runs/0/results/8/codeFlows/0/threadFlows/0/locations/2)
#  641|   	if (fp) {
#  642|   		if (fflush(fp))
#  643|-> 			stack;
#  644|   		if (fclose(fp))
#  645|   			stack;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def554]
LVM2.2.03.38/tools/pvck.c:856:17: warning[-Wanalyzer-malloc-leak]: leak of ‘calloc(1, mda_size + 1)’
LVM2.2.03.38/tools/pvck.c:842:12: enter_function: entry to ‘_dump_meta_area’
LVM2.2.03.38/tools/pvck.c:849:12: branch_false: following ‘false’ branch (when ‘tofile’ is non-NULL)...
LVM2.2.03.38/tools/pvck.c:852:33: branch_false: ...to here
LVM2.2.03.38/tools/pvck.c:852:26: call_function: inlined call to ‘zalloc’ from ‘_dump_meta_area’
LVM2.2.03.38/tools/pvck.c:852:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/tools/pvck.c:855:14: branch_false: ...to here
LVM2.2.03.38/tools/pvck.c:855:14: call_function: calling ‘_read_bytes’ from ‘_dump_meta_area’
LVM2.2.03.38/tools/pvck.c:855:14: return_function: returning to ‘_dump_meta_area’ from ‘_read_bytes’
LVM2.2.03.38/tools/pvck.c:855:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/tools/pvck.c:856:17: branch_false: ...to here
LVM2.2.03.38/tools/pvck.c:856:17: throw: if ‘print_log’ throws an exception...
LVM2.2.03.38/tools/pvck.c:856:17: danger: ‘calloc(1, mda_size + 1)’ leaks here; was allocated at [(5)](sarif:/runs/0/results/9/codeFlows/0/threadFlows/0/locations/4)
#  854|   
#  855|   	if (!_read_bytes(dev, def, mda_offset, mda_size, meta_buf)) {
#  856|-> 		log_print("CHECK: failed to read metadata area at offset %llu size %llu",
#  857|   			  (unsigned long long)mda_offset, (unsigned long long)mda_size);
#  858|   		free(meta_buf);

Error: GCC_ANALYZER_WARNING (CWE-775): [#def555]
LVM2.2.03.38/tools/pvck.c:868:30: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(tofile, "wx")’
LVM2.2.03.38/tools/pvck.c:842:12: enter_function: entry to ‘_dump_meta_area’
LVM2.2.03.38/tools/pvck.c:849:12: branch_false: following ‘false’ branch (when ‘tofile’ is non-NULL)...
LVM2.2.03.38/tools/pvck.c:852:33: branch_false: ...to here
LVM2.2.03.38/tools/pvck.c:852:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/tools/pvck.c:855:14: branch_false: ...to here
LVM2.2.03.38/tools/pvck.c:855:14: call_function: calling ‘_read_bytes’ from ‘_dump_meta_area’
LVM2.2.03.38/tools/pvck.c:855:14: return_function: returning to ‘_dump_meta_area’ from ‘_read_bytes’
LVM2.2.03.38/tools/pvck.c:855:12: branch_true: following ‘true’ branch...
LVM2.2.03.38/tools/pvck.c:862:20: branch_true: ...to here
LVM2.2.03.38/tools/pvck.c:862:20: acquire_resource: opened here
LVM2.2.03.38/tools/pvck.c:862:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/tools/pvck.c:868:30: branch_false: ...to here
LVM2.2.03.38/tools/pvck.c:868:12: branch_true: following ‘true’ branch...
LVM2.2.03.38/tools/pvck.c:869:17: branch_true: ...to here
LVM2.2.03.38/tools/pvck.c:869:17: throw: if ‘print_log’ throws an exception...
LVM2.2.03.38/tools/pvck.c:868:30: danger: ‘fopen(tofile, "wx")’ leaks here; was opened at [(13)](sarif:/runs/0/results/10/codeFlows/0/threadFlows/0/locations/12)
#  866|   	}
#  867|   
#  868|-> 	if (fwrite(meta_buf, mda_size - 512, 1, fp) != 1) {
#  869|   		log_error("Failed to write file %s metadata area size %llu.",
#  870|   			  tofile, (unsigned long long)mda_size);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def556]
LVM2.2.03.38/tools/pvck.c:868:30: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(tofile, "wx")’
LVM2.2.03.38/tools/pvck.c:842:12: enter_function: entry to ‘_dump_meta_area’
LVM2.2.03.38/tools/pvck.c:849:12: branch_false: following ‘false’ branch (when ‘tofile’ is non-NULL)...
LVM2.2.03.38/tools/pvck.c:852:33: branch_false: ...to here
LVM2.2.03.38/tools/pvck.c:852:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/tools/pvck.c:855:14: branch_false: ...to here
LVM2.2.03.38/tools/pvck.c:855:14: call_function: calling ‘_read_bytes’ from ‘_dump_meta_area’
LVM2.2.03.38/tools/pvck.c:855:14: return_function: returning to ‘_dump_meta_area’ from ‘_read_bytes’
LVM2.2.03.38/tools/pvck.c:855:12: branch_true: following ‘true’ branch...
LVM2.2.03.38/tools/pvck.c:862:20: branch_true: ...to here
LVM2.2.03.38/tools/pvck.c:862:20: acquire_memory: allocated here
LVM2.2.03.38/tools/pvck.c:862:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/tools/pvck.c:868:30: branch_false: ...to here
LVM2.2.03.38/tools/pvck.c:868:12: branch_true: following ‘true’ branch...
LVM2.2.03.38/tools/pvck.c:869:17: branch_true: ...to here
LVM2.2.03.38/tools/pvck.c:869:17: throw: if ‘print_log’ throws an exception...
LVM2.2.03.38/tools/pvck.c:868:30: danger: ‘fopen(tofile, "wx")’ leaks here; was allocated at [(13)](sarif:/runs/0/results/11/codeFlows/0/threadFlows/0/locations/12)
#  866|   	}
#  867|   
#  868|-> 	if (fwrite(meta_buf, mda_size - 512, 1, fp) != 1) {
#  869|   		log_error("Failed to write file %s metadata area size %llu.",
#  870|   			  tofile, (unsigned long long)mda_size);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def557]
LVM2.2.03.38/tools/pvck.c:915:13: warning[-Wanalyzer-malloc-leak]: leak of ‘calloc(1, meta_size + 1)’
LVM2.2.03.38/tools/pvck.c:885:12: enter_function: entry to ‘_dump_current_text’
LVM2.2.03.38/tools/pvck.c:901:26: call_function: inlined call to ‘zalloc’ from ‘_dump_current_text’
LVM2.2.03.38/tools/pvck.c:901:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/tools/pvck.c:915:13: branch_false: ...to here
LVM2.2.03.38/tools/pvck.c:915:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/tools/pvck.c:939:22: branch_false: ...to here
LVM2.2.03.38/tools/pvck.c:939:22: call_function: calling ‘_read_bytes’ from ‘_dump_current_text’
LVM2.2.03.38/tools/pvck.c:939:22: return_function: returning to ‘_dump_current_text’ from ‘_read_bytes’
LVM2.2.03.38/tools/pvck.c:939:20: branch_false: following ‘false’ branch...
LVM2.2.03.38/tools/pvck.c:940:25: branch_false: ...to here
LVM2.2.03.38/tools/pvck.c:940:25: throw: if ‘print_log’ throws an exception...
LVM2.2.03.38/tools/pvck.c:915:13: danger: ‘calloc(1, meta_size + 1)’ leaks here; was allocated at [(3)](sarif:/runs/0/results/16/codeFlows/0/threadFlows/0/locations/2)
#  913|   	 * mda_offset + meta_offset.
#  914|   	 */
#  915|-> 	if (meta_offset + meta_size > mda_size) {
#  916|   		/* text metadata wraps to start of text metadata area */
#  917|   		uint32_t wrap = (uint32_t) ((meta_offset + meta_size) - mda_size);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def558]
LVM2.2.03.38/tools/pvck.c:972:30: warning[-Wanalyzer-malloc-leak]: leak of ‘vgname’
LVM2.2.03.38/tools/pvck.c:885:12: enter_function: entry to ‘_dump_current_text’
LVM2.2.03.38/tools/pvck.c:901:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/tools/pvck.c:915:13: branch_false: ...to here
LVM2.2.03.38/tools/pvck.c:939:22: call_function: calling ‘_read_bytes’ from ‘_dump_current_text’
LVM2.2.03.38/tools/pvck.c:939:22: return_function: returning to ‘_dump_current_text’ from ‘_read_bytes’
LVM2.2.03.38/tools/pvck.c:939:20: branch_true: following ‘true’ branch...
LVM2.2.03.38/tools/pvck.c:947:17: branch_true: ...to here
LVM2.2.03.38/tools/pvck.c:955:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/tools/pvck.c:959:22: branch_false: ...to here
LVM2.2.03.38/tools/pvck.c:959:20: branch_false: following ‘false’ branch...
LVM2.2.03.38/tools/pvck.c:965:29: branch_false: ...to here
LVM2.2.03.38/tools/pvck.c:965:28: branch_true: following ‘true’ branch...
LVM2.2.03.38/tools/pvck.c:966:48: acquire_memory: allocated here
LVM2.2.03.38/tools/pvck.c:966:36: branch_false: following ‘false’ branch (when ‘vgname’ is non-NULL)...
LVM2.2.03.38/tools/pvck.c:971:28: branch_false: ...to here
LVM2.2.03.38/tools/pvck.c:971:28: branch_true: following ‘true’ branch...
LVM2.2.03.38/tools/pvck.c:972:30: throw: if ‘dm_config_get_uint32’ throws an exception...
LVM2.2.03.38/tools/pvck.c:972:30: danger: ‘vgname’ leaks here; was allocated at [(17)](sarif:/runs/0/results/36/codeFlows/0/threadFlows/0/locations/16)
#  970|   			}
#  971|   			if ((cft->root && cft->root->child) &&
#  972|-> 			    !dm_config_get_uint32(cft->root->child, "seqno", &seqno)) {
#  973|   				log_print("CHECK: failed to parse seqno text at %llu",
#  974|   					  (unsigned long long)(mda_offset + meta_offset));

Error: GCC_ANALYZER_WARNING (CWE-401): [#def559]
LVM2.2.03.38/tools/pvck.c:973:33: warning[-Wanalyzer-malloc-leak]: leak of ‘vgname’
LVM2.2.03.38/tools/pvck.c:885:12: enter_function: entry to ‘_dump_current_text’
LVM2.2.03.38/tools/pvck.c:901:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/tools/pvck.c:915:13: branch_false: ...to here
LVM2.2.03.38/tools/pvck.c:939:22: call_function: calling ‘_read_bytes’ from ‘_dump_current_text’
LVM2.2.03.38/tools/pvck.c:939:22: return_function: returning to ‘_dump_current_text’ from ‘_read_bytes’
LVM2.2.03.38/tools/pvck.c:939:20: branch_true: following ‘true’ branch...
LVM2.2.03.38/tools/pvck.c:947:17: branch_true: ...to here
LVM2.2.03.38/tools/pvck.c:955:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/tools/pvck.c:959:22: branch_false: ...to here
LVM2.2.03.38/tools/pvck.c:959:20: branch_false: following ‘false’ branch...
LVM2.2.03.38/tools/pvck.c:965:29: branch_false: ...to here
LVM2.2.03.38/tools/pvck.c:965:28: branch_true: following ‘true’ branch...
LVM2.2.03.38/tools/pvck.c:966:48: acquire_memory: allocated here
LVM2.2.03.38/tools/pvck.c:966:36: branch_false: following ‘false’ branch (when ‘vgname’ is non-NULL)...
LVM2.2.03.38/tools/pvck.c:971:28: branch_false: ...to here
LVM2.2.03.38/tools/pvck.c:971:28: branch_true: following ‘true’ branch...
LVM2.2.03.38/tools/pvck.c:973:33: throw: if ‘print_log’ throws an exception...
LVM2.2.03.38/tools/pvck.c:973:33: danger: ‘vgname’ leaks here; was allocated at [(17)](sarif:/runs/0/results/37/codeFlows/0/threadFlows/0/locations/16)
#  971|   			if ((cft->root && cft->root->child) &&
#  972|   			    !dm_config_get_uint32(cft->root->child, "seqno", &seqno)) {
#  973|-> 				log_print("CHECK: failed to parse seqno text at %llu",
#  974|   					  (unsigned long long)(mda_offset + meta_offset));
#  975|   				bad++;

Error: GCC_ANALYZER_WARNING (CWE-775): [#def560]
LVM2.2.03.38/tools/pvck.c:1003:21: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(tofile, "wx")’
LVM2.2.03.38/tools/pvck.c:885:12: enter_function: entry to ‘_dump_current_text’
LVM2.2.03.38/tools/pvck.c:901:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/tools/pvck.c:915:13: branch_false: ...to here
LVM2.2.03.38/tools/pvck.c:939:22: call_function: calling ‘_read_bytes’ from ‘_dump_current_text’
LVM2.2.03.38/tools/pvck.c:939:22: return_function: returning to ‘_dump_current_text’ from ‘_read_bytes’
LVM2.2.03.38/tools/pvck.c:939:20: branch_true: following ‘true’ branch...
LVM2.2.03.38/tools/pvck.c:947:17: branch_true: ...to here
LVM2.2.03.38/tools/pvck.c:982:12: branch_true: following ‘true’ branch...
LVM2.2.03.38/tools/pvck.c:983:17: branch_true: ...to here
LVM2.2.03.38/tools/pvck.c:983:17: branch_false: following ‘false’ branch (when ‘vgname’ is NULL)...
LVM2.2.03.38/tools/pvck.c:983:17: branch_false: ...to here
LVM2.2.03.38/tools/pvck.c:987:12: branch_false: following ‘false’ branch (when ‘print_metadata != 0’)...
LVM2.2.03.38/tools/pvck.c:990:12: branch_false: ...to here
LVM2.2.03.38/tools/pvck.c:990:12: branch_false: following ‘false’ branch (when ‘tofile’ is non-NULL)...
LVM2.2.03.38/tools/pvck.c:996:28: branch_false: ...to here
LVM2.2.03.38/tools/pvck.c:996:28: acquire_resource: opened here
LVM2.2.03.38/tools/pvck.c:996:20: branch_false: following ‘false’ branch...
LVM2.2.03.38/tools/pvck.c:1001:17: branch_false: ...to here
LVM2.2.03.38/tools/pvck.c:1003:21: throw: if ‘fflush’ throws an exception...
LVM2.2.03.38/tools/pvck.c:1003:21: danger: ‘fopen(tofile, "wx")’ leaks here; was opened at [(19)](sarif:/runs/0/results/38/codeFlows/0/threadFlows/0/locations/18)
# 1001|   		fprintf(fp, "%s", meta_buf);
# 1002|   
# 1003|-> 		if (fflush(fp))
# 1004|   			stack;
# 1005|   		if (fclose(fp))

Error: GCC_ANALYZER_WARNING (CWE-401): [#def561]
LVM2.2.03.38/tools/pvck.c:1003:21: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(tofile, "wx")’
LVM2.2.03.38/tools/pvck.c:885:12: enter_function: entry to ‘_dump_current_text’
LVM2.2.03.38/tools/pvck.c:901:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/tools/pvck.c:915:13: branch_false: ...to here
LVM2.2.03.38/tools/pvck.c:939:22: call_function: calling ‘_read_bytes’ from ‘_dump_current_text’
LVM2.2.03.38/tools/pvck.c:939:22: return_function: returning to ‘_dump_current_text’ from ‘_read_bytes’
LVM2.2.03.38/tools/pvck.c:939:20: branch_true: following ‘true’ branch...
LVM2.2.03.38/tools/pvck.c:947:17: branch_true: ...to here
LVM2.2.03.38/tools/pvck.c:982:12: branch_true: following ‘true’ branch...
LVM2.2.03.38/tools/pvck.c:983:17: branch_true: ...to here
LVM2.2.03.38/tools/pvck.c:983:17: branch_false: following ‘false’ branch (when ‘vgname’ is NULL)...
LVM2.2.03.38/tools/pvck.c:983:17: branch_false: ...to here
LVM2.2.03.38/tools/pvck.c:987:12: branch_false: following ‘false’ branch (when ‘print_metadata != 0’)...
LVM2.2.03.38/tools/pvck.c:990:12: branch_false: ...to here
LVM2.2.03.38/tools/pvck.c:990:12: branch_false: following ‘false’ branch (when ‘tofile’ is non-NULL)...
LVM2.2.03.38/tools/pvck.c:996:28: branch_false: ...to here
LVM2.2.03.38/tools/pvck.c:996:28: acquire_memory: allocated here
LVM2.2.03.38/tools/pvck.c:996:20: branch_false: following ‘false’ branch...
LVM2.2.03.38/tools/pvck.c:1001:17: branch_false: ...to here
LVM2.2.03.38/tools/pvck.c:1003:21: throw: if ‘fflush’ throws an exception...
LVM2.2.03.38/tools/pvck.c:1003:21: danger: ‘fopen(tofile, "wx")’ leaks here; was allocated at [(19)](sarif:/runs/0/results/39/codeFlows/0/threadFlows/0/locations/18)
# 1001|   		fprintf(fp, "%s", meta_buf);
# 1002|   
# 1003|-> 		if (fflush(fp))
# 1004|   			stack;
# 1005|   		if (fclose(fp))

Error: GCC_ANALYZER_WARNING (CWE-775): [#def562]
LVM2.2.03.38/tools/pvck.c:1004:25: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(tofile, "wx")’
LVM2.2.03.38/tools/pvck.c:885:12: enter_function: entry to ‘_dump_current_text’
LVM2.2.03.38/tools/pvck.c:901:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/tools/pvck.c:915:13: branch_false: ...to here
LVM2.2.03.38/tools/pvck.c:939:22: call_function: calling ‘_read_bytes’ from ‘_dump_current_text’
LVM2.2.03.38/tools/pvck.c:939:22: return_function: returning to ‘_dump_current_text’ from ‘_read_bytes’
LVM2.2.03.38/tools/pvck.c:939:20: branch_true: following ‘true’ branch...
LVM2.2.03.38/tools/pvck.c:947:17: branch_true: ...to here
LVM2.2.03.38/tools/pvck.c:982:12: branch_true: following ‘true’ branch...
LVM2.2.03.38/tools/pvck.c:983:17: branch_true: ...to here
LVM2.2.03.38/tools/pvck.c:983:17: branch_false: following ‘false’ branch (when ‘vgname’ is NULL)...
LVM2.2.03.38/tools/pvck.c:983:17: branch_false: ...to here
LVM2.2.03.38/tools/pvck.c:987:12: branch_false: following ‘false’ branch (when ‘print_metadata != 0’)...
LVM2.2.03.38/tools/pvck.c:990:12: branch_false: ...to here
LVM2.2.03.38/tools/pvck.c:990:12: branch_false: following ‘false’ branch (when ‘tofile’ is non-NULL)...
LVM2.2.03.38/tools/pvck.c:996:28: branch_false: ...to here
LVM2.2.03.38/tools/pvck.c:996:28: acquire_resource: opened here
LVM2.2.03.38/tools/pvck.c:996:20: branch_false: following ‘false’ branch...
LVM2.2.03.38/tools/pvck.c:1001:17: branch_false: ...to here
LVM2.2.03.38/tools/pvck.c:1003:20: branch_true: following ‘true’ branch...
LVM2.2.03.38/tools/pvck.c:1004:25: branch_true: ...to here
LVM2.2.03.38/tools/pvck.c:1004:25: throw: if ‘print_log’ throws an exception...
LVM2.2.03.38/tools/pvck.c:1004:25: danger: ‘fopen(tofile, "wx")’ leaks here; was opened at [(19)](sarif:/runs/0/results/40/codeFlows/0/threadFlows/0/locations/18)
# 1002|   
# 1003|   		if (fflush(fp))
# 1004|-> 			stack;
# 1005|   		if (fclose(fp))
# 1006|   			stack;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def563]
LVM2.2.03.38/tools/pvck.c:1004:25: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(tofile, "wx")’
LVM2.2.03.38/tools/pvck.c:885:12: enter_function: entry to ‘_dump_current_text’
LVM2.2.03.38/tools/pvck.c:901:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/tools/pvck.c:915:13: branch_false: ...to here
LVM2.2.03.38/tools/pvck.c:939:22: call_function: calling ‘_read_bytes’ from ‘_dump_current_text’
LVM2.2.03.38/tools/pvck.c:939:22: return_function: returning to ‘_dump_current_text’ from ‘_read_bytes’
LVM2.2.03.38/tools/pvck.c:939:20: branch_true: following ‘true’ branch...
LVM2.2.03.38/tools/pvck.c:947:17: branch_true: ...to here
LVM2.2.03.38/tools/pvck.c:982:12: branch_true: following ‘true’ branch...
LVM2.2.03.38/tools/pvck.c:983:17: branch_true: ...to here
LVM2.2.03.38/tools/pvck.c:983:17: branch_false: following ‘false’ branch (when ‘vgname’ is NULL)...
LVM2.2.03.38/tools/pvck.c:983:17: branch_false: ...to here
LVM2.2.03.38/tools/pvck.c:987:12: branch_false: following ‘false’ branch (when ‘print_metadata != 0’)...
LVM2.2.03.38/tools/pvck.c:990:12: branch_false: ...to here
LVM2.2.03.38/tools/pvck.c:990:12: branch_false: following ‘false’ branch (when ‘tofile’ is non-NULL)...
LVM2.2.03.38/tools/pvck.c:996:28: branch_false: ...to here
LVM2.2.03.38/tools/pvck.c:996:28: acquire_memory: allocated here
LVM2.2.03.38/tools/pvck.c:996:20: branch_false: following ‘false’ branch...
LVM2.2.03.38/tools/pvck.c:1001:17: branch_false: ...to here
LVM2.2.03.38/tools/pvck.c:1003:20: branch_true: following ‘true’ branch...
LVM2.2.03.38/tools/pvck.c:1004:25: branch_true: ...to here
LVM2.2.03.38/tools/pvck.c:1004:25: throw: if ‘print_log’ throws an exception...
LVM2.2.03.38/tools/pvck.c:1004:25: danger: ‘fopen(tofile, "wx")’ leaks here; was allocated at [(19)](sarif:/runs/0/results/41/codeFlows/0/threadFlows/0/locations/18)
# 1002|   
# 1003|   		if (fflush(fp))
# 1004|-> 			stack;
# 1005|   		if (fclose(fp))
# 1006|   			stack;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def564]
LVM2.2.03.38/tools/pvck.c:2132:14: warning[-Wanalyzer-malloc-leak]: leak of ‘buf’
LVM2.2.03.38/tools/pvck.c:2122:12: branch_false: following ‘false’ branch (when ‘device_size > 2097151’)...
LVM2.2.03.38/tools/pvck.c:2126:22: branch_false: ...to here
LVM2.2.03.38/tools/pvck.c:2129:21: acquire_memory: allocated here
LVM2.2.03.38/tools/pvck.c:2129:12: branch_false: following ‘false’ branch (when ‘buf’ is non-NULL)...
LVM2.2.03.38/tools/pvck.c:2132:14: branch_false: ...to here
LVM2.2.03.38/tools/pvck.c:2132:14: throw: if ‘dev_read_bytes’ throws an exception...
LVM2.2.03.38/tools/pvck.c:2132:14: danger: ‘buf’ leaks here; was allocated at [(3)](sarif:/runs/0/results/42/codeFlows/0/threadFlows/0/locations/2)
# 2130|   		return_0;
# 2131|   
# 2132|-> 	if (!dev_read_bytes(dev, mda_offset, mda_size, buf))
# 2133|   		goto fail;
# 2134|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def565]
LVM2.2.03.38/tools/pvck.c:2834:19: warning[-Wanalyzer-malloc-leak]: leak of ‘calloc(1, back_size)’
LVM2.2.03.38/tools/pvck.c:2796:12: enter_function: entry to ‘_dump_backup_to_raw’
LVM2.2.03.38/tools/pvck.c:2810:12: branch_false: following ‘false’ branch (when ‘input’ is non-NULL)...
LVM2.2.03.38/tools/pvck.c:2815:19: branch_false: ...to here
LVM2.2.03.38/tools/pvck.c:2815:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/tools/pvck.c:2820:13: branch_false: ...to here
LVM2.2.03.38/tools/pvck.c:2820:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/tools/pvck.c:2825:37: branch_false: ...to here
LVM2.2.03.38/tools/pvck.c:2825:12: branch_false: following ‘false’ branch (when ‘back_size != 0’)...
LVM2.2.03.38/tools/pvck.c:2830:26: call_function: inlined call to ‘zalloc’ from ‘_dump_backup_to_raw’
LVM2.2.03.38/tools/pvck.c:2830:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/tools/pvck.c:2833:14: branch_false: ...to here
LVM2.2.03.38/tools/pvck.c:2834:12: branch_true: following ‘true’ branch...
LVM2.2.03.38/tools/pvck.c:2835:17: branch_true: ...to here
LVM2.2.03.38/tools/pvck.c:2835:17: throw: if ‘print_log’ throws an exception...
LVM2.2.03.38/tools/pvck.c:2834:19: danger: ‘calloc(1, back_size)’ leaks here; was allocated at [(11)](sarif:/runs/0/results/43/codeFlows/0/threadFlows/0/locations/10)
# 2832|   
# 2833|   	rv = read(fd, back_buf, back_size);
# 2834|-> 	if (rv != (int)back_size) {
# 2835|   		log_error("Cannot read file: %s", input);
# 2836|   		free(back_buf);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def566]
LVM2.2.03.38/tools/pvck.c:2894:17: warning[-Wanalyzer-malloc-leak]: leak of ‘text_buf’
LVM2.2.03.38/tools/pvck.c:2944:12: enter_function: entry to ‘_read_metadata_file’
LVM2.2.03.38/tools/pvck.c:2952:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/tools/pvck.c:2957:13: branch_false: ...to here
LVM2.2.03.38/tools/pvck.c:2957:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/tools/pvck.c:2962:37: branch_false: ...to here
LVM2.2.03.38/tools/pvck.c:2962:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/tools/pvck.c:2967:33: branch_false: ...to here
LVM2.2.03.38/tools/pvck.c:2967:26: acquire_memory: allocated here
LVM2.2.03.38/tools/pvck.c:2967:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/tools/pvck.c:2970:14: branch_false: ...to here
LVM2.2.03.38/tools/pvck.c:2971:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/tools/pvck.c:2976:18: branch_false: ...to here
LVM2.2.03.38/tools/pvck.c:2993:14: call_function: calling ‘_check_metadata_file’ from ‘_read_metadata_file’
# 2892|   
# 2893|   	if (text_size < NAME_LEN+1) {
# 2894|-> 		log_error("Invalid raw text metadata in file.  File size is too small.");
# 2895|   		return 0;
# 2896|   	}

Error: GCC_ANALYZER_WARNING (CWE-401): [#def567]
LVM2.2.03.38/tools/pvck.c:2903:17: warning[-Wanalyzer-malloc-leak]: leak of ‘text_buf’
LVM2.2.03.38/tools/pvck.c:2944:12: enter_function: entry to ‘_read_metadata_file’
LVM2.2.03.38/tools/pvck.c:2952:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/tools/pvck.c:2957:13: branch_false: ...to here
LVM2.2.03.38/tools/pvck.c:2957:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/tools/pvck.c:2962:37: branch_false: ...to here
LVM2.2.03.38/tools/pvck.c:2962:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/tools/pvck.c:2967:33: branch_false: ...to here
LVM2.2.03.38/tools/pvck.c:2967:26: acquire_memory: allocated here
LVM2.2.03.38/tools/pvck.c:2967:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/tools/pvck.c:2970:14: branch_false: ...to here
LVM2.2.03.38/tools/pvck.c:2971:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/tools/pvck.c:2976:18: branch_false: ...to here
LVM2.2.03.38/tools/pvck.c:2993:14: call_function: calling ‘_check_metadata_file’ from ‘_read_metadata_file’
# 2901|   	 */
# 2902|   	if (isspace(text_buf[0]) && isspace(text_buf[1]) && strstr(text_buf, "---")) {
# 2903|-> 		log_error("Invalid raw text metadata in file.");
# 2904|   		log_error("(pvck stdout is not valid input, see pvck -f.)");
# 2905|   		return 0;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def568]
LVM2.2.03.38/tools/pvck.c:2904:17: warning[-Wanalyzer-malloc-leak]: leak of ‘text_buf’
LVM2.2.03.38/tools/pvck.c:2944:12: enter_function: entry to ‘_read_metadata_file’
LVM2.2.03.38/tools/pvck.c:2952:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/tools/pvck.c:2957:13: branch_false: ...to here
LVM2.2.03.38/tools/pvck.c:2957:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/tools/pvck.c:2962:37: branch_false: ...to here
LVM2.2.03.38/tools/pvck.c:2962:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/tools/pvck.c:2967:33: branch_false: ...to here
LVM2.2.03.38/tools/pvck.c:2967:26: acquire_memory: allocated here
LVM2.2.03.38/tools/pvck.c:2967:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/tools/pvck.c:2970:14: branch_false: ...to here
LVM2.2.03.38/tools/pvck.c:2971:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/tools/pvck.c:2976:18: branch_false: ...to here
LVM2.2.03.38/tools/pvck.c:2993:14: call_function: calling ‘_check_metadata_file’ from ‘_read_metadata_file’
# 2902|   	if (isspace(text_buf[0]) && isspace(text_buf[1]) && strstr(text_buf, "---")) {
# 2903|   		log_error("Invalid raw text metadata in file.");
# 2904|-> 		log_error("(pvck stdout is not valid input, see pvck -f.)");
# 2905|   		return 0;
# 2906|   	}

Error: GCC_ANALYZER_WARNING (CWE-401): [#def569]
LVM2.2.03.38/tools/pvck.c:2912:17: warning[-Wanalyzer-malloc-leak]: leak of ‘text_buf’
LVM2.2.03.38/tools/pvck.c:2944:12: enter_function: entry to ‘_read_metadata_file’
LVM2.2.03.38/tools/pvck.c:2952:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/tools/pvck.c:2957:13: branch_false: ...to here
LVM2.2.03.38/tools/pvck.c:2957:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/tools/pvck.c:2962:37: branch_false: ...to here
LVM2.2.03.38/tools/pvck.c:2962:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/tools/pvck.c:2967:33: branch_false: ...to here
LVM2.2.03.38/tools/pvck.c:2967:26: acquire_memory: allocated here
LVM2.2.03.38/tools/pvck.c:2967:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/tools/pvck.c:2970:14: branch_false: ...to here
LVM2.2.03.38/tools/pvck.c:2971:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/tools/pvck.c:2976:18: branch_false: ...to here
LVM2.2.03.38/tools/pvck.c:2993:14: call_function: calling ‘_check_metadata_file’ from ‘_read_metadata_file’
# 2910|   	 */
# 2911|   	if ((text_buf[0] == '#') && !strncmp(text_buf, "# Generated", 11)) {
# 2912|-> 		log_error("Invalid raw text metadata in file.");
# 2913|   		log_error("(metadata backup file is not valid input.)");
# 2914|   		return 0;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def570]
LVM2.2.03.38/tools/pvck.c:2913:17: warning[-Wanalyzer-malloc-leak]: leak of ‘text_buf’
LVM2.2.03.38/tools/pvck.c:2944:12: enter_function: entry to ‘_read_metadata_file’
LVM2.2.03.38/tools/pvck.c:2952:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/tools/pvck.c:2957:13: branch_false: ...to here
LVM2.2.03.38/tools/pvck.c:2957:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/tools/pvck.c:2962:37: branch_false: ...to here
LVM2.2.03.38/tools/pvck.c:2962:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/tools/pvck.c:2967:33: branch_false: ...to here
LVM2.2.03.38/tools/pvck.c:2967:26: acquire_memory: allocated here
LVM2.2.03.38/tools/pvck.c:2967:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/tools/pvck.c:2970:14: branch_false: ...to here
LVM2.2.03.38/tools/pvck.c:2971:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/tools/pvck.c:2976:18: branch_false: ...to here
LVM2.2.03.38/tools/pvck.c:2993:14: call_function: calling ‘_check_metadata_file’ from ‘_read_metadata_file’
# 2911|   	if ((text_buf[0] == '#') && !strncmp(text_buf, "# Generated", 11)) {
# 2912|   		log_error("Invalid raw text metadata in file.");
# 2913|-> 		log_error("(metadata backup file is not valid input.)");
# 2914|   		return 0;
# 2915|   	}

Error: GCC_ANALYZER_WARNING (CWE-122): [#def571]
LVM2.2.03.38/tools/pvck.c:2919:13: warning[-Wanalyzer-out-of-bounds]: heap-based buffer over-read
LVM2.2.03.38/tools/pvck.c:2944:12: enter_function: entry to ‘_read_metadata_file’
LVM2.2.03.38/tools/pvck.c:2952:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/tools/pvck.c:2957:13: branch_false: ...to here
LVM2.2.03.38/tools/pvck.c:2957:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/tools/pvck.c:2962:37: branch_false: ...to here
LVM2.2.03.38/tools/pvck.c:2962:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/tools/pvck.c:2967:33: branch_false: ...to here
LVM2.2.03.38/tools/pvck.c:2967:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/tools/pvck.c:2970:14: branch_false: ...to here
LVM2.2.03.38/tools/pvck.c:2971:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/tools/pvck.c:2976:18: branch_false: ...to here
LVM2.2.03.38/tools/pvck.c:2993:14: call_function: calling ‘_check_metadata_file’ from ‘_read_metadata_file’
# 2917|   	if (text_buf[text_size-1] != '\0' ||
# 2918|   	    text_buf[text_size-2] != '\n' ||
# 2919|-> 	    text_buf[text_size-3] != '\n')
# 2920|   		log_warn("WARNING: Unexpected final bytes of raw metadata, expected \\n\\n\\0.");
# 2921|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def572]
LVM2.2.03.38/tools/pvck.c:2920:17: warning[-Wanalyzer-malloc-leak]: leak of ‘text_buf’
LVM2.2.03.38/tools/pvck.c:2944:12: enter_function: entry to ‘_read_metadata_file’
LVM2.2.03.38/tools/pvck.c:2952:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/tools/pvck.c:2957:13: branch_false: ...to here
LVM2.2.03.38/tools/pvck.c:2957:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/tools/pvck.c:2962:37: branch_false: ...to here
LVM2.2.03.38/tools/pvck.c:2962:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/tools/pvck.c:2967:33: branch_false: ...to here
LVM2.2.03.38/tools/pvck.c:2967:26: acquire_memory: allocated here
LVM2.2.03.38/tools/pvck.c:2967:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/tools/pvck.c:2970:14: branch_false: ...to here
LVM2.2.03.38/tools/pvck.c:2971:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/tools/pvck.c:2976:18: branch_false: ...to here
LVM2.2.03.38/tools/pvck.c:2993:14: call_function: calling ‘_check_metadata_file’ from ‘_read_metadata_file’
# 2918|   	    text_buf[text_size-2] != '\n' ||
# 2919|   	    text_buf[text_size-3] != '\n')
# 2920|-> 		log_warn("WARNING: Unexpected final bytes of raw metadata, expected \\n\\n\\0.");
# 2921|   
# 2922|   	if (_check_vgname_start(text_buf, &namelen)) {

Error: GCC_ANALYZER_WARNING (CWE-401): [#def573]
LVM2.2.03.38/tools/pvck.c:2931:9: warning[-Wanalyzer-malloc-leak]: leak of ‘text_buf’
LVM2.2.03.38/tools/pvck.c:2944:12: enter_function: entry to ‘_read_metadata_file’
LVM2.2.03.38/tools/pvck.c:2952:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/tools/pvck.c:2957:13: branch_false: ...to here
LVM2.2.03.38/tools/pvck.c:2957:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/tools/pvck.c:2962:37: branch_false: ...to here
LVM2.2.03.38/tools/pvck.c:2962:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/tools/pvck.c:2967:33: branch_false: ...to here
LVM2.2.03.38/tools/pvck.c:2967:26: acquire_memory: allocated here
LVM2.2.03.38/tools/pvck.c:2967:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/tools/pvck.c:2970:14: branch_false: ...to here
LVM2.2.03.38/tools/pvck.c:2971:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/tools/pvck.c:2976:18: branch_false: ...to here
LVM2.2.03.38/tools/pvck.c:2993:14: call_function: calling ‘_check_metadata_file’ from ‘_read_metadata_file’
# 2929|   	}
# 2930|   
# 2931|-> 	log_warn("WARNING: File data does not begin with a VG name and may be invalid.");
# 2932|   
# 2933|   	if (!arg_is_set(cmd, yes_ARG) &&

Error: GCC_ANALYZER_WARNING (CWE-401): [#def574]
LVM2.2.03.38/tools/pvck.c:2971:19: warning[-Wanalyzer-malloc-leak]: leak of ‘malloc((long unsigned int)sb.st_size + 1)’
LVM2.2.03.38/tools/pvck.c:2944:12: enter_function: entry to ‘_read_metadata_file’
LVM2.2.03.38/tools/pvck.c:2952:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/tools/pvck.c:2957:13: branch_false: ...to here
LVM2.2.03.38/tools/pvck.c:2957:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/tools/pvck.c:2962:37: branch_false: ...to here
LVM2.2.03.38/tools/pvck.c:2962:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/tools/pvck.c:2967:33: branch_false: ...to here
LVM2.2.03.38/tools/pvck.c:2967:26: acquire_memory: allocated here
LVM2.2.03.38/tools/pvck.c:2967:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/tools/pvck.c:2970:14: branch_false: ...to here
LVM2.2.03.38/tools/pvck.c:2971:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/tools/pvck.c:2976:18: branch_false: ...to here
LVM2.2.03.38/tools/pvck.c:2981:13: call_function: inlined call to ‘_is_backup_file’ from ‘_read_metadata_file’
LVM2.2.03.38/tools/pvck.c:2981:12: branch_true: following ‘true’ branch...
LVM2.2.03.38/tools/pvck.c:2984:17: branch_true: ...to here
LVM2.2.03.38/tools/pvck.c:2986:22: call_function: calling ‘_backup_file_to_raw_metadata’ from ‘_read_metadata_file’
# 2969|   
# 2970|   	rv = read(fd, text_buf, text_size);
# 2971|-> 	if (rv != (int)text_size) {
# 2972|   		log_error("Cannot read file: %s", mf->filename);
# 2973|   		free(text_buf);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def575]
LVM2.2.03.38/tools/pvck.c:2972:17: warning[-Wanalyzer-malloc-leak]: leak of ‘text_buf’
LVM2.2.03.38/tools/pvck.c:2952:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/tools/pvck.c:2957:13: branch_false: ...to here
LVM2.2.03.38/tools/pvck.c:2957:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/tools/pvck.c:2962:37: branch_false: ...to here
LVM2.2.03.38/tools/pvck.c:2962:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/tools/pvck.c:2967:33: branch_false: ...to here
LVM2.2.03.38/tools/pvck.c:2967:26: acquire_memory: allocated here
LVM2.2.03.38/tools/pvck.c:2967:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/tools/pvck.c:2970:14: branch_false: ...to here
LVM2.2.03.38/tools/pvck.c:2971:12: branch_true: following ‘true’ branch...
LVM2.2.03.38/tools/pvck.c:2972:17: branch_true: ...to here
LVM2.2.03.38/tools/pvck.c:2972:17: throw: if ‘print_log’ throws an exception...
LVM2.2.03.38/tools/pvck.c:2972:17: danger: ‘text_buf’ leaks here; was allocated at [(7)](sarif:/runs/0/results/57/codeFlows/0/threadFlows/0/locations/6)
# 2970|   	rv = read(fd, text_buf, text_size);
# 2971|   	if (rv != (int)text_size) {
# 2972|-> 		log_error("Cannot read file: %s", mf->filename);
# 2973|   		free(text_buf);
# 2974|   		goto out;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def576]
LVM2.2.03.38/tools/pvck.c:2978:13: warning[-Wanalyzer-malloc-leak]: leak of ‘text_buf’
LVM2.2.03.38/tools/pvck.c:2952:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/tools/pvck.c:2957:13: branch_false: ...to here
LVM2.2.03.38/tools/pvck.c:2957:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/tools/pvck.c:2962:37: branch_false: ...to here
LVM2.2.03.38/tools/pvck.c:2962:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/tools/pvck.c:2967:33: branch_false: ...to here
LVM2.2.03.38/tools/pvck.c:2967:26: acquire_memory: allocated here
LVM2.2.03.38/tools/pvck.c:2967:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/tools/pvck.c:2970:14: branch_false: ...to here
LVM2.2.03.38/tools/pvck.c:2971:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/tools/pvck.c:2976:18: branch_false: ...to here
LVM2.2.03.38/tools/pvck.c:2978:13: throw: if ‘close’ throws an exception...
LVM2.2.03.38/tools/pvck.c:2978:13: danger: ‘text_buf’ leaks here; was allocated at [(7)](sarif:/runs/0/results/58/codeFlows/0/threadFlows/0/locations/6)
# 2976|   	text_buf[text_size++] = 0; /* null terminating byte */
# 2977|   
# 2978|-> 	if (close(fd))
# 2979|   		stack;
# 2980|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def577]
LVM2.2.03.38/tools/pvck.c:2979:17: warning[-Wanalyzer-malloc-leak]: leak of ‘text_buf’
LVM2.2.03.38/tools/pvck.c:2952:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/tools/pvck.c:2957:13: branch_false: ...to here
LVM2.2.03.38/tools/pvck.c:2957:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/tools/pvck.c:2962:37: branch_false: ...to here
LVM2.2.03.38/tools/pvck.c:2962:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/tools/pvck.c:2967:33: branch_false: ...to here
LVM2.2.03.38/tools/pvck.c:2967:26: acquire_memory: allocated here
LVM2.2.03.38/tools/pvck.c:2967:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/tools/pvck.c:2970:14: branch_false: ...to here
LVM2.2.03.38/tools/pvck.c:2971:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/tools/pvck.c:2976:18: branch_false: ...to here
LVM2.2.03.38/tools/pvck.c:2978:12: branch_true: following ‘true’ branch...
LVM2.2.03.38/tools/pvck.c:2979:17: branch_true: ...to here
LVM2.2.03.38/tools/pvck.c:2979:17: throw: if ‘print_log’ throws an exception...
LVM2.2.03.38/tools/pvck.c:2979:17: danger: ‘text_buf’ leaks here; was allocated at [(7)](sarif:/runs/0/results/59/codeFlows/0/threadFlows/0/locations/6)
# 2977|   
# 2978|   	if (close(fd))
# 2979|-> 		stack;
# 2980|   
# 2981|   	if (_is_backup_file(cmd, text_buf, text_size)) {

Error: GCC_ANALYZER_WARNING (CWE-401): [#def578]
LVM2.2.03.38/tools/pvscan.c:244:22: warning[-Wanalyzer-malloc-leak]: leak of ‘opendir("/run/lvm/pvs_online")’
LVM2.2.03.38/tools/pvscan.c:241:21: acquire_memory: allocated here
LVM2.2.03.38/tools/pvscan.c:241:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/tools/pvscan.c:241:12: branch_false: ...to here
LVM2.2.03.38/tools/pvscan.c:244:22: throw: if ‘readdir’ throws an exception...
LVM2.2.03.38/tools/pvscan.c:244:22: danger: ‘opendir("/run/lvm/pvs_online")’ leaks here; was allocated at [(1)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/0)
#  242|   		return;
#  243|   
#  244|-> 	while ((de = readdir(dir))) {
#  245|   		if (de->d_name[0] == '.')
#  246|   			continue;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def579]
LVM2.2.03.38/tools/pvscan.c:281:22: warning[-Wanalyzer-malloc-leak]: leak of ‘opendir(dirpath)’
LVM2.2.03.38/tools/pvscan.c:278:21: acquire_memory: allocated here
LVM2.2.03.38/tools/pvscan.c:278:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/tools/pvscan.c:278:12: branch_false: ...to here
LVM2.2.03.38/tools/pvscan.c:281:22: throw: if ‘readdir’ throws an exception...
LVM2.2.03.38/tools/pvscan.c:281:22: danger: ‘opendir(dirpath)’ leaks here; was allocated at [(1)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/0)
#  279|   		return;
#  280|   
#  281|-> 	while ((de = readdir(dir))) {
#  282|   		if (de->d_name[0] == '.')
#  283|   			continue;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def580]
LVM2.2.03.38/tools/pvscan.c:433:33: warning[-Wanalyzer-malloc-leak]: leak of ‘opendir("/run/lvm/pvs_lookup")’
LVM2.2.03.38/tools/pvscan.c:424:21: acquire_memory: allocated here
LVM2.2.03.38/tools/pvscan.c:424:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/tools/pvscan.c:424:12: branch_false: ...to here
LVM2.2.03.38/tools/pvscan.c:433:16: branch_true: following ‘true’ branch (when ‘vgname’ is NULL)...
LVM2.2.03.38/tools/pvscan.c:433:33: branch_true: ...to here
LVM2.2.03.38/tools/pvscan.c:433:33: throw: if ‘readdir’ throws an exception...
LVM2.2.03.38/tools/pvscan.c:433:33: danger: ‘opendir("/run/lvm/pvs_lookup")’ leaks here; was allocated at [(1)](sarif:/runs/0/results/2/codeFlows/0/threadFlows/0/locations/0)
#  431|   	 * found save the vgname of the file it's found in.
#  432|   	 */
#  433|-> 	while (!vgname && (de = readdir(dir))) {
#  434|   		if (de->d_name[0] == '.')
#  435|   			continue;

Error: GCC_ANALYZER_WARNING (CWE-775): [#def581]
LVM2.2.03.38/tools/pvscan.c:447:52: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(&path, "r")’
LVM2.2.03.38/tools/pvscan.c:424:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/tools/pvscan.c:424:12: branch_false: ...to here
LVM2.2.03.38/tools/pvscan.c:433:16: branch_true: following ‘true’ branch...
LVM2.2.03.38/tools/pvscan.c:442:28: acquire_resource: opened here
LVM2.2.03.38/tools/pvscan.c:448:39: throw: if ‘dm_pool_strdup’ throws an exception...
LVM2.2.03.38/tools/pvscan.c:447:52: danger: ‘fopen(&path, "r")’ leaks here; was opened at [(5)](sarif:/runs/0/results/3/codeFlows/0/threadFlows/0/locations/4)
#  445|   		}
#  446|   
#  447|-> 		if (_lookup_file_contains_pvid(fp, dev->pvid)) {
#  448|   			if ((vgname = dm_pool_strdup(cmd->mem, de->d_name)))
#  449|   				/*

Error: GCC_ANALYZER_WARNING (CWE-401): [#def582]
LVM2.2.03.38/tools/pvscan.c:447:52: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(&path, "r")’
LVM2.2.03.38/tools/pvscan.c:424:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/tools/pvscan.c:424:12: branch_false: ...to here
LVM2.2.03.38/tools/pvscan.c:433:16: branch_true: following ‘true’ branch...
LVM2.2.03.38/tools/pvscan.c:442:28: acquire_memory: allocated here
LVM2.2.03.38/tools/pvscan.c:448:39: throw: if ‘dm_pool_strdup’ throws an exception...
LVM2.2.03.38/tools/pvscan.c:447:52: danger: ‘fopen(&path, "r")’ leaks here; was allocated at [(5)](sarif:/runs/0/results/4/codeFlows/0/threadFlows/0/locations/4)
#  445|   		}
#  446|   
#  447|-> 		if (_lookup_file_contains_pvid(fp, dev->pvid)) {
#  448|   			if ((vgname = dm_pool_strdup(cmd->mem, de->d_name)))
#  449|   				/*

Error: GCC_ANALYZER_WARNING (CWE-775): [#def583]
LVM2.2.03.38/tools/toollib.c:94:12: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘dup2(open(&_devnull, 2), 0)’
LVM2.2.03.38/tools/toollib.c:68:12: branch_false: following ‘false’ branch (when ‘pid != -1’)...
LVM2.2.03.38/tools/toollib.c:74:12: branch_false: ...to here
LVM2.2.03.38/tools/toollib.c:74:12: branch_false: following ‘false’ branch (when ‘pid <= 0’)...
LVM2.2.03.38/tools/toollib.c:78:26: branch_false: ...to here
LVM2.2.03.38/tools/toollib.c:88:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/tools/toollib.c:94:14: branch_false: ...to here
LVM2.2.03.38/tools/toollib.c:94:14: acquire_resource: opened here
LVM2.2.03.38/tools/toollib.c:94:12: danger: ‘dup2(open(&_devnull, 2), 0)’ leaks here; was opened at [(7)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/6)
#   92|   
#   93|   	/* coverity[leaked_handle] don't care */
#   94|-> 	if ((dup2(null_fd, STDIN_FILENO) < 0)  || /* reopen stdin */
#   95|   	    (dup2(null_fd, STDOUT_FILENO) < 0) || /* reopen stdout */
#   96|   	    (dup2(null_fd, STDERR_FILENO) < 0)) { /* reopen stderr */

Error: GCC_ANALYZER_WARNING (CWE-775): [#def584]
LVM2.2.03.38/tools/toollib.c:94:13: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘dup2(open(&_devnull, 2), 1)’
LVM2.2.03.38/tools/toollib.c:68:12: branch_false: following ‘false’ branch (when ‘pid != -1’)...
LVM2.2.03.38/tools/toollib.c:74:12: branch_false: ...to here
LVM2.2.03.38/tools/toollib.c:74:12: branch_false: following ‘false’ branch (when ‘pid <= 0’)...
LVM2.2.03.38/tools/toollib.c:78:26: branch_false: ...to here
LVM2.2.03.38/tools/toollib.c:88:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/tools/toollib.c:94:14: branch_false: ...to here
LVM2.2.03.38/tools/toollib.c:94:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/tools/toollib.c:95:14: branch_false: ...to here
LVM2.2.03.38/tools/toollib.c:95:14: acquire_resource: opened here
LVM2.2.03.38/tools/toollib.c:94:13: danger: ‘dup2(open(&_devnull, 2), 1)’ leaks here; was opened at [(9)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/8)
#   92|   
#   93|   	/* coverity[leaked_handle] don't care */
#   94|-> 	if ((dup2(null_fd, STDIN_FILENO) < 0)  || /* reopen stdin */
#   95|   	    (dup2(null_fd, STDOUT_FILENO) < 0) || /* reopen stdout */
#   96|   	    (dup2(null_fd, STDERR_FILENO) < 0)) { /* reopen stderr */

Error: GCC_ANALYZER_WARNING (CWE-775): [#def585]
LVM2.2.03.38/tools/toollib.c:94:13: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘dup2(open(&_devnull, 2), 2)’
LVM2.2.03.38/tools/toollib.c:68:12: branch_false: following ‘false’ branch (when ‘pid != -1’)...
LVM2.2.03.38/tools/toollib.c:74:12: branch_false: ...to here
LVM2.2.03.38/tools/toollib.c:74:12: branch_false: following ‘false’ branch (when ‘pid <= 0’)...
LVM2.2.03.38/tools/toollib.c:78:26: branch_false: ...to here
LVM2.2.03.38/tools/toollib.c:88:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/tools/toollib.c:94:14: branch_false: ...to here
LVM2.2.03.38/tools/toollib.c:94:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/tools/toollib.c:95:14: branch_false: ...to here
LVM2.2.03.38/tools/toollib.c:94:13: branch_false: following ‘false’ branch...
LVM2.2.03.38/tools/toollib.c:96:14: branch_false: ...to here
LVM2.2.03.38/tools/toollib.c:96:14: acquire_resource: opened here
LVM2.2.03.38/tools/toollib.c:94:13: danger: ‘dup2(open(&_devnull, 2), 2)’ leaks here; was opened at [(11)](sarif:/runs/0/results/2/codeFlows/0/threadFlows/0/locations/10)
#   92|   
#   93|   	/* coverity[leaked_handle] don't care */
#   94|-> 	if ((dup2(null_fd, STDIN_FILENO) < 0)  || /* reopen stdin */
#   95|   	    (dup2(null_fd, STDOUT_FILENO) < 0) || /* reopen stdout */
#   96|   	    (dup2(null_fd, STDERR_FILENO) < 0)) { /* reopen stderr */

Error: GCC_ANALYZER_WARNING (CWE-775): [#def586]
LVM2.2.03.38/tools/toollib.c:97:17: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘open(&_devnull, 2)’
LVM2.2.03.38/tools/toollib.c:68:12: branch_false: following ‘false’ branch (when ‘pid != -1’)...
LVM2.2.03.38/tools/toollib.c:74:12: branch_false: ...to here
LVM2.2.03.38/tools/toollib.c:74:12: branch_false: following ‘false’ branch (when ‘pid <= 0’)...
LVM2.2.03.38/tools/toollib.c:78:26: branch_false: ...to here
LVM2.2.03.38/tools/toollib.c:88:24: acquire_resource: opened here
LVM2.2.03.38/tools/toollib.c:88:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/tools/toollib.c:94:14: branch_false: ...to here
LVM2.2.03.38/tools/toollib.c:97:17: throw: if ‘print_log’ throws an exception...
LVM2.2.03.38/tools/toollib.c:97:17: danger: ‘open(&_devnull, 2)’ leaks here; was opened at [(5)](sarif:/runs/0/results/3/codeFlows/0/threadFlows/0/locations/4)
#   95|   	    (dup2(null_fd, STDOUT_FILENO) < 0) || /* reopen stdout */
#   96|   	    (dup2(null_fd, STDERR_FILENO) < 0)) { /* reopen stderr */
#   97|-> 		log_sys_error("dup2", "redirect");
#   98|   		(void) close(null_fd);
#   99|   		_exit(ECMD_FAILED);

Error: GCC_ANALYZER_WARNING (CWE-775): [#def587]
LVM2.2.03.38/tools/toollib.c:102:12: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘open(&_devnull, 2)’
LVM2.2.03.38/tools/toollib.c:68:12: branch_false: following ‘false’ branch (when ‘pid != -1’)...
LVM2.2.03.38/tools/toollib.c:74:12: branch_false: ...to here
LVM2.2.03.38/tools/toollib.c:74:12: branch_false: following ‘false’ branch (when ‘pid <= 0’)...
LVM2.2.03.38/tools/toollib.c:78:26: branch_false: ...to here
LVM2.2.03.38/tools/toollib.c:88:24: acquire_resource: opened here
LVM2.2.03.38/tools/toollib.c:88:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/tools/toollib.c:94:14: branch_false: ...to here
LVM2.2.03.38/tools/toollib.c:94:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/tools/toollib.c:95:14: branch_false: ...to here
LVM2.2.03.38/tools/toollib.c:94:13: branch_false: following ‘false’ branch...
LVM2.2.03.38/tools/toollib.c:96:14: branch_false: ...to here
LVM2.2.03.38/tools/toollib.c:94:13: branch_false: following ‘false’ branch...
LVM2.2.03.38/tools/toollib.c:102:12: branch_false: ...to here
LVM2.2.03.38/tools/toollib.c:102:12: danger: ‘open(&_devnull, 2)’ leaks here; was opened at [(5)](sarif:/runs/0/results/4/codeFlows/0/threadFlows/0/locations/4)
#  100|   	}
#  101|   
#  102|-> 	if (null_fd > STDERR_FILENO)
#  103|   		(void) close(null_fd);
#  104|   

Error: GCC_ANALYZER_WARNING (CWE-775): [#def588]
LVM2.2.03.38/tools/toollib.c:103:24: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘open(&_devnull, 2)’
LVM2.2.03.38/tools/toollib.c:68:12: branch_false: following ‘false’ branch (when ‘pid != -1’)...
LVM2.2.03.38/tools/toollib.c:74:12: branch_false: ...to here
LVM2.2.03.38/tools/toollib.c:74:12: branch_false: following ‘false’ branch (when ‘pid <= 0’)...
LVM2.2.03.38/tools/toollib.c:78:26: branch_false: ...to here
LVM2.2.03.38/tools/toollib.c:88:24: acquire_resource: opened here
LVM2.2.03.38/tools/toollib.c:88:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/tools/toollib.c:94:14: branch_false: ...to here
LVM2.2.03.38/tools/toollib.c:94:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/tools/toollib.c:95:14: branch_false: ...to here
LVM2.2.03.38/tools/toollib.c:94:13: branch_false: following ‘false’ branch...
LVM2.2.03.38/tools/toollib.c:96:14: branch_false: ...to here
LVM2.2.03.38/tools/toollib.c:94:13: branch_false: following ‘false’ branch...
LVM2.2.03.38/tools/toollib.c:102:12: branch_false: ...to here
LVM2.2.03.38/tools/toollib.c:102:12: branch_true: following ‘true’ branch...
LVM2.2.03.38/tools/toollib.c:103:24: branch_true: ...to here
LVM2.2.03.38/tools/toollib.c:103:24: danger: ‘open(&_devnull, 2)’ leaks here; was opened at [(5)](sarif:/runs/0/results/5/codeFlows/0/threadFlows/0/locations/4)
#  101|   
#  102|   	if (null_fd > STDERR_FILENO)
#  103|-> 		(void) close(null_fd);
#  104|   
#  105|   	init_verbose(VERBOSE_BASE_LEVEL);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def589]
LVM2.2.03.38/tools/toollib.c:1888:41: warning[-Wanalyzer-malloc-leak]: leak of ‘devl’
LVM2.2.03.38/tools/toollib.c:1860:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/tools/toollib.c:1865:12: branch_false: ...to here
LVM2.2.03.38/tools/toollib.c:1865:12: branch_true: following ‘true’ branch (when ‘argc != 0’)...
LVM2.2.03.38/tools/toollib.c:1865:12: branch_true: ...to here
LVM2.2.03.38/tools/toollib.c:1866:24: branch_true: following ‘true’ branch (when ‘opt < argc’)...
LVM2.2.03.38/tools/toollib.c:1867:29: branch_true: ...to here
LVM2.2.03.38/tools/toollib.c:1867:28: branch_false: following ‘false’ branch...
LVM2.2.03.38/tools/toollib.c:1873:37: branch_false: ...to here
LVM2.2.03.38/tools/toollib.c:1885:54: acquire_memory: allocated here
LVM2.2.03.38/tools/toollib.c:1885:44: branch_false: following ‘false’ branch (when ‘devl’ is non-NULL)...
LVM2.2.03.38/tools/toollib.c:1887:41: branch_false: ...to here
LVM2.2.03.38/tools/toollib.c:1888:41: throw: if ‘dm_list_add’ throws an exception...
LVM2.2.03.38/tools/toollib.c:1888:41: danger: ‘devl’ leaks here; was allocated at [(9)](sarif:/runs/0/results/6/codeFlows/0/threadFlows/0/locations/8)
# 1886|   						return_0;
# 1887|   					devl->dev = dev;
# 1888|-> 					dm_list_add(&process_duplicates, &devl->list);
# 1889|   				}
# 1890|   				continue;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def590]
LVM2.2.03.38/tools/vgcfgbackup.c:37:13: warning[-Wanalyzer-malloc-leak]: leak of ‘filename’
LVM2.2.03.38/tools/vgcfgbackup.c:23:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/tools/vgcfgbackup.c:31:26: branch_false: ...to here
LVM2.2.03.38/tools/vgcfgbackup.c:31:26: acquire_memory: allocated here
LVM2.2.03.38/tools/vgcfgbackup.c:31:12: branch_false: following ‘false’ branch (when ‘filename’ is non-NULL)...
LVM2.2.03.38/tools/vgcfgbackup.c:37:13: branch_false: ...to here
LVM2.2.03.38/tools/vgcfgbackup.c:37:13: throw: if ‘dm_snprintf’ throws an exception...
LVM2.2.03.38/tools/vgcfgbackup.c:37:13: danger: ‘filename’ leaks here; was allocated at [(3)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/2)
#   35|   
#   36|   	/* coverity[non_const_printf_format_string] */
#   37|-> 	if (dm_snprintf(filename, PATH_MAX, template, vg_name) < 0) {
#   38|   		log_error("Error processing filename template %s",
#   39|   			   template);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def591]
LVM2.2.03.38/tools/vgimportclone.c:195:17: warning[-Wanalyzer-malloc-leak]: leak of ‘calloc(1, 24)’
LVM2.2.03.38/tools/vgimportclone.c:177:12: enter_function: entry to ‘_get_other_devs’
LVM2.2.03.38/tools/vgimportclone.c:184:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/tools/vgimportclone.c:184:12: branch_false: ...to here
LVM2.2.03.38/tools/vgimportclone.c:187:16: branch_true: following ‘true’ branch...
LVM2.2.03.38/tools/vgimportclone.c:188:21: branch_true: ...to here
LVM2.2.03.38/tools/vgimportclone.c:190:30: call_function: inlined call to ‘zalloc’ from ‘_get_other_devs’
LVM2.2.03.38/tools/vgimportclone.c:190:20: branch_false: following ‘false’ branch...
LVM2.2.03.38/tools/vgimportclone.c:194:17: branch_false: ...to here
LVM2.2.03.38/tools/vgimportclone.c:195:17: danger: ‘calloc(1, 24)’ leaks here; was allocated at [(7)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/6)
#  193|   		}
#  194|   		devl->dev = dev;
#  195|-> 		dm_list_add(other_devs, &devl->list);
#  196|   	}
#  197|   bad:

Error: GCC_ANALYZER_WARNING (CWE-401): [#def592]
LVM2.2.03.38/tools/vgimportclone.c:280:17: warning[-Wanalyzer-malloc-leak]: leak of ‘calloc(1, 24)’
LVM2.2.03.38/tools/vgimportclone.c:202:5: enter_function: entry to ‘vgimportclone’
LVM2.2.03.38/tools/vgimportclone.c:232:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/tools/vgimportclone.c:235:9: branch_false: ...to here
LVM2.2.03.38/tools/vgimportclone.c:239:12: branch_false: following ‘false’ branch...
LVM2.2.03.38/tools/vgimportclone.c:249:13: branch_false: ...to here
LVM2.2.03.38/tools/vgimportclone.c:269:21: branch_true: following ‘true’ branch (when ‘i < argc’)...
LVM2.2.03.38/tools/vgimportclone.c:270:29: branch_true: ...to here
LVM2.2.03.38/tools/vgimportclone.c:270:20: branch_false: following ‘false’ branch...
LVM2.2.03.38/tools/vgimportclone.c:276:30: call_function: inlined call to ‘zalloc’ from ‘vgimportclone’
LVM2.2.03.38/tools/vgimportclone.c:276:20: branch_false: following ‘false’ branch...
LVM2.2.03.38/tools/vgimportclone.c:279:17: branch_false: ...to here
LVM2.2.03.38/tools/vgimportclone.c:280:17: danger: ‘calloc(1, 24)’ leaks here; was allocated at [(11)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/10)
#  278|   
#  279|   		devl->dev = dev;
#  280|-> 		dm_list_add(&vp.new_devs, &devl->list);
#  281|   	}
#  282|   

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-127.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-namelvm2-2.03.38-1.fc44
store-results-to/tmp/tmpd3bw0_ae/lvm2-2.03.38-1.fc44.tar.xz
time-created2026-01-08 19:28:36
time-finished2026-01-08 19:32:37
toolcsmock
tool-args'/usr/bin/csmock' '-r' 'fedora-rawhide-x86_64' '-t' 'gcc,cppcheck,clippy,shellcheck,unicontrol' '-o' '/tmp/tmpd3bw0_ae/lvm2-2.03.38-1.fc44.tar.xz' '--gcc-analyze' '--unicontrol-notests' '--unicontrol-bidi-only' '--install' 'pam' '--gcc-analyzer-bin=/usr/bin/gcc' '/tmp/tmpd3bw0_ae/lvm2-2.03.38-1.fc44.src.rpm'
tool-versioncsmock-3.8.3.20251215.161544.g62de9a5-1.el9