lvm2-2.03.36-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-88): [#def5]
/usr/bin/fsadm:135:2: error[SC2068]: Double quote array expansions to avoid re-splitting elements.
#  133|   	fi
#  134|   	verbose "Executing" "$@"
#  135|-> 	$@
#  136|   }
#  137|   

Error: SHELLCHECK_WARNING (CWE-88): [#def6]
/usr/bin/fsadm:140:2: error[SC2068]: Double quote array expansions to avoid re-splitting elements.
#  138|   # Accept as success also return code 1 with fsck
#  139|   accept_0_1() {
#  140|-> 	$@
#  141|   	local ret="$?"
#  142|   	test "$ret" -eq 1 || return "$ret"

Error: SHELLCHECK_WARNING (CWE-758): [#def7]
/usr/bin/lvm_import_vdo:33:33: error[SC2218]: This function is only defined later. Move the definition up.
#   31|   TOOL=lvm_import_vdo
#   32|   IMPORT_NAME="VDO_${TOOL}_${RANDOM}$$"
#   33|-> test ${#IMPORT_NAME} -lt 100 || error "Random name \"$IMPORT_NAME\" is too long!"
#   34|   TEMPDIR="${TMPDIR:-/tmp}/$IMPORT_NAME"
#   35|   

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

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

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

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

Error: SHELLCHECK_WARNING: [#def12]
/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): [#def13]
/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): [#def14]
/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): [#def15]
/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): [#def16]
/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): [#def17]
LVM2.2.03.36/daemons/dmeventd/dmeventd.c:128:9: warning[-Wanalyzer-malloc-leak]: leak of ‘message_data.dso_name’
LVM2.2.03.36/daemons/dmeventd/dmeventd.c:1925:12: enter_function: entry to ‘_do_process_request’
LVM2.2.03.36/daemons/dmeventd/dmeventd.c:1932:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/daemons/dmeventd/dmeventd.c:1941:19: branch_false: ...to here
LVM2.2.03.36/daemons/dmeventd/dmeventd.c:1941:19: branch_true: following ‘true’ branch...
LVM2.2.03.36/daemons/dmeventd/dmeventd.c:1941:56: branch_true: ...to here
LVM2.2.03.36/daemons/dmeventd/dmeventd.c:1941:56: call_function: calling ‘_parse_message’ from ‘_do_process_request’
#  126|   	va_list ap;
#  127|   	va_start(ap, format);
#  128|-> 	dm_event_log("dmeventd", level, file, line, dm_errno_or_class, format, ap);
#  129|   	va_end(ap);
#  130|   }

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

Error: GCC_ANALYZER_WARNING (CWE-404): [#def19]
LVM2.2.03.36/daemons/dmeventd/dmeventd.c:128:9: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
LVM2.2.03.36/daemons/dmeventd/dmeventd.c:859:15: enter_function: entry to ‘_get_curr_time’
LVM2.2.03.36/daemons/dmeventd/dmeventd.c:869:9: call_function: calling ‘_dmeventd_log’ from ‘_get_curr_time’
#  126|   	va_list ap;
#  127|   	va_start(ap, format);
#  128|-> 	dm_event_log("dmeventd", level, file, line, dm_errno_or_class, format, ap);
#  129|   	va_end(ap);
#  130|   }

Error: GCC_ANALYZER_WARNING (CWE-401): [#def20]
LVM2.2.03.36/daemons/dmeventd/dmeventd.c:1868:26: warning[-Wanalyzer-malloc-leak]: leak of ‘header’
LVM2.2.03.36/daemons/dmeventd/dmeventd.c:1847:28: acquire_memory: allocated here
LVM2.2.03.36/daemons/dmeventd/dmeventd.c:1850:12: branch_false: following ‘false’ branch (when ‘header’ is non-NULL)...
LVM2.2.03.36/daemons/dmeventd/dmeventd.c:1857:29: branch_false: ...to here
LVM2.2.03.36/daemons/dmeventd/dmeventd.c:1859:20: branch_false: following ‘false’ branch...
 branch_false: ...to here
LVM2.2.03.36/daemons/dmeventd/dmeventd.c:1863:16: branch_true: following ‘true’ branch...
 branch_true: ...to here
LVM2.2.03.36/daemons/dmeventd/dmeventd.c:1866:25: branch_true: following ‘true’ branch (when ‘__i != 16’)...
LVM2.2.03.36/daemons/dmeventd/dmeventd.c:1866:25: branch_true: ...to here
LVM2.2.03.36/daemons/dmeventd/dmeventd.c:1866:25: branch_false: following ‘false’ branch (when ‘__i == 16’)...
LVM2.2.03.36/daemons/dmeventd/dmeventd.c:1867:25: branch_false: ...to here
LVM2.2.03.36/daemons/dmeventd/dmeventd.c:1868:26: danger: ‘header’ leaks here; was allocated at [(1)](sarif:/runs/0/results/5/codeFlows/0/threadFlows/0/locations/0)
# 1866|   			FD_ZERO(&fds);
# 1867|   			FD_SET(fifos->server, &fds);
# 1868|-> 		} while (select(fifos->server + 1, NULL, &fds, NULL, NULL) != 1);
# 1869|   
# 1870|   		if ((ret = write(fifos->server, buf + bytes, size - bytes)) > 0)

Error: GCC_ANALYZER_WARNING (CWE-401): [#def21]
LVM2.2.03.36/daemons/dmeventd/dmeventd.c:1870:28: warning[-Wanalyzer-malloc-leak]: leak of ‘header’
LVM2.2.03.36/daemons/dmeventd/dmeventd.c:1847:28: acquire_memory: allocated here
LVM2.2.03.36/daemons/dmeventd/dmeventd.c:1850:12: branch_false: following ‘false’ branch (when ‘header’ is non-NULL)...
LVM2.2.03.36/daemons/dmeventd/dmeventd.c:1857:29: branch_false: ...to here
LVM2.2.03.36/daemons/dmeventd/dmeventd.c:1859:20: branch_false: following ‘false’ branch...
 branch_false: ...to here
LVM2.2.03.36/daemons/dmeventd/dmeventd.c:1863:16: branch_true: following ‘true’ branch...
 branch_true: ...to here
LVM2.2.03.36/daemons/dmeventd/dmeventd.c:1866:25: branch_true: following ‘true’ branch (when ‘__i != 16’)...
LVM2.2.03.36/daemons/dmeventd/dmeventd.c:1866:25: branch_true: ...to here
LVM2.2.03.36/daemons/dmeventd/dmeventd.c:1870:28: danger: ‘header’ leaks here; was allocated at [(1)](sarif:/runs/0/results/6/codeFlows/0/threadFlows/0/locations/0)
# 1868|   		} while (select(fifos->server + 1, NULL, &fds, NULL, NULL) != 1);
# 1869|   
# 1870|-> 		if ((ret = write(fifos->server, buf + bytes, size - bytes)) > 0)
# 1871|   			bytes += ret;
# 1872|   		else if (errno == EIO)

Error: GCC_ANALYZER_WARNING (CWE-775): [#def22]
LVM2.2.03.36/daemons/dmeventd/dmeventd.c:2099:12: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(oom_adj_path, "w")’
LVM2.2.03.36/daemons/dmeventd/dmeventd.c:2092:20: acquire_resource: opened here
LVM2.2.03.36/daemons/dmeventd/dmeventd.c:2092:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/daemons/dmeventd/dmeventd.c:2097:9: branch_false: ...to here
LVM2.2.03.36/daemons/dmeventd/dmeventd.c:2099:12: danger: ‘fopen(oom_adj_path, "w")’ leaks here; was opened at [(1)](sarif:/runs/0/results/7/codeFlows/0/threadFlows/0/locations/0)
# 2097|   	fprintf(fp, "%i", val);
# 2098|   
# 2099|-> 	if (dm_fclose(fp))
# 2100|   		log_sys_debug("fclose", oom_adj_path);
# 2101|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def23]
LVM2.2.03.36/daemons/dmeventd/dmeventd.c:2099:12: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(oom_adj_path, "w")’
LVM2.2.03.36/daemons/dmeventd/dmeventd.c:2092:20: acquire_memory: allocated here
LVM2.2.03.36/daemons/dmeventd/dmeventd.c:2092:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/daemons/dmeventd/dmeventd.c:2097:9: branch_false: ...to here
LVM2.2.03.36/daemons/dmeventd/dmeventd.c:2099:12: danger: ‘fopen(oom_adj_path, "w")’ leaks here; was allocated at [(1)](sarif:/runs/0/results/8/codeFlows/0/threadFlows/0/locations/0)
# 2097|   	fprintf(fp, "%i", val);
# 2098|   
# 2099|-> 	if (dm_fclose(fp))
# 2100|   		log_sys_debug("fclose", oom_adj_path);
# 2101|   

Error: GCC_ANALYZER_WARNING (CWE-131): [#def24]
LVM2.2.03.36/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): [#def25]
LVM2.2.03.36/daemons/dmeventd/plugins/lvm2/dmeventd_lvm.c:43:1: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
LVM2.2.03.36/daemons/dmeventd/plugins/lvm2/dmeventd_lvm.c:43:1: acquire_resource: ‘va_start’ called here
LVM2.2.03.36/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): [#def26]
LVM2.2.03.36/daemons/dmeventd/plugins/mirror/dmeventd_mirror.c:31:1: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
LVM2.2.03.36/daemons/dmeventd/plugins/mirror/dmeventd_mirror.c:33:13: enter_function: entry to ‘_process_status_code’
LVM2.2.03.36/daemons/dmeventd/plugins/mirror/dmeventd_mirror.c:49:17: call_function: calling ‘print_log’ from ‘_process_status_code’
#   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): [#def27]
LVM2.2.03.36/daemons/dmeventd/plugins/raid/dmeventd_raid.c:31:1: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
LVM2.2.03.36/daemons/dmeventd/plugins/raid/dmeventd_raid.c:31:1: acquire_resource: ‘va_start’ called here
LVM2.2.03.36/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-775): [#def28]
LVM2.2.03.36/daemons/dmeventd/plugins/snapshot/dmeventd_snapshot.c:40:1: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(&procmounts, "r")’
LVM2.2.03.36/daemons/dmeventd/plugins/snapshot/dmeventd_snapshot.c:124:13: enter_function: entry to ‘_umount’
LVM2.2.03.36/daemons/dmeventd/plugins/snapshot/dmeventd_snapshot.c:132:24: acquire_resource: opened here
LVM2.2.03.36/daemons/dmeventd/plugins/snapshot/dmeventd_snapshot.c:132:12: branch_false: following ‘false’ branch...
 branch_false: ...to here
LVM2.2.03.36/daemons/dmeventd/plugins/snapshot/dmeventd_snapshot.c:138:16: branch_true: following ‘true’ branch...
LVM2.2.03.36/daemons/dmeventd/plugins/snapshot/dmeventd_snapshot.c:140:22: branch_true: ...to here
LVM2.2.03.36/daemons/dmeventd/plugins/snapshot/dmeventd_snapshot.c:140:20: branch_false: following ‘false’ branch...
LVM2.2.03.36/daemons/dmeventd/plugins/snapshot/dmeventd_snapshot.c:144:21: branch_false: ...to here
LVM2.2.03.36/daemons/dmeventd/plugins/snapshot/dmeventd_snapshot.c:154:25: call_function: calling ‘print_log’ from ‘_umount’
#   38|   };
#   39|   
#   40|-> DM_EVENT_LOG_FN("snap")
#   41|   
#   42|   static int _run(const char *cmd, ...)

Error: GCC_ANALYZER_WARNING (CWE-401): [#def29]
LVM2.2.03.36/daemons/dmeventd/plugins/snapshot/dmeventd_snapshot.c:40:1: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(&procmounts, "r")’
LVM2.2.03.36/daemons/dmeventd/plugins/snapshot/dmeventd_snapshot.c:124:13: enter_function: entry to ‘_umount’
LVM2.2.03.36/daemons/dmeventd/plugins/snapshot/dmeventd_snapshot.c:132:24: acquire_memory: allocated here
LVM2.2.03.36/daemons/dmeventd/plugins/snapshot/dmeventd_snapshot.c:132:12: branch_false: following ‘false’ branch...
 branch_false: ...to here
LVM2.2.03.36/daemons/dmeventd/plugins/snapshot/dmeventd_snapshot.c:138:16: branch_true: following ‘true’ branch...
LVM2.2.03.36/daemons/dmeventd/plugins/snapshot/dmeventd_snapshot.c:140:22: branch_true: ...to here
LVM2.2.03.36/daemons/dmeventd/plugins/snapshot/dmeventd_snapshot.c:140:20: branch_false: following ‘false’ branch...
LVM2.2.03.36/daemons/dmeventd/plugins/snapshot/dmeventd_snapshot.c:144:21: branch_false: ...to here
LVM2.2.03.36/daemons/dmeventd/plugins/snapshot/dmeventd_snapshot.c:154:25: call_function: calling ‘print_log’ from ‘_umount’
#   38|   };
#   39|   
#   40|-> DM_EVENT_LOG_FN("snap")
#   41|   
#   42|   static int _run(const char *cmd, ...)

Error: GCC_ANALYZER_WARNING (CWE-404): [#def30]
LVM2.2.03.36/daemons/dmeventd/plugins/snapshot/dmeventd_snapshot.c:40:1: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
LVM2.2.03.36/daemons/dmeventd/plugins/snapshot/dmeventd_snapshot.c:40:1: acquire_resource: ‘va_start’ called here
LVM2.2.03.36/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): [#def31]
LVM2.2.03.36/daemons/dmeventd/plugins/snapshot/dmeventd_snapshot.c:71:21: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(&procmounts, "r")’
LVM2.2.03.36/daemons/dmeventd/plugins/snapshot/dmeventd_snapshot.c:124:13: enter_function: entry to ‘_umount’
LVM2.2.03.36/daemons/dmeventd/plugins/snapshot/dmeventd_snapshot.c:132:24: acquire_resource: opened here
LVM2.2.03.36/daemons/dmeventd/plugins/snapshot/dmeventd_snapshot.c:132:12: branch_false: following ‘false’ branch...
 branch_false: ...to here
LVM2.2.03.36/daemons/dmeventd/plugins/snapshot/dmeventd_snapshot.c:138:16: branch_true: following ‘true’ branch...
LVM2.2.03.36/daemons/dmeventd/plugins/snapshot/dmeventd_snapshot.c:140:22: branch_true: ...to here
LVM2.2.03.36/daemons/dmeventd/plugins/snapshot/dmeventd_snapshot.c:140:20: branch_false: following ‘false’ branch...
LVM2.2.03.36/daemons/dmeventd/plugins/snapshot/dmeventd_snapshot.c:144:21: branch_false: ...to here
LVM2.2.03.36/daemons/dmeventd/plugins/snapshot/dmeventd_snapshot.c:155:30: call_function: calling ‘_run’ from ‘_umount’
#   69|   
#   70|           if (pid > 0) { /* parent */
#   71|->                 if (waitpid(pid, &status, 0) != pid)
#   72|                           return 0; /* waitpid failed */
#   73|                   if (!WIFEXITED(status) || WEXITSTATUS(status))

Error: GCC_ANALYZER_WARNING (CWE-401): [#def32]
LVM2.2.03.36/daemons/dmeventd/plugins/snapshot/dmeventd_snapshot.c:71:21: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(&procmounts, "r")’
LVM2.2.03.36/daemons/dmeventd/plugins/snapshot/dmeventd_snapshot.c:124:13: enter_function: entry to ‘_umount’
LVM2.2.03.36/daemons/dmeventd/plugins/snapshot/dmeventd_snapshot.c:132:24: acquire_memory: allocated here
LVM2.2.03.36/daemons/dmeventd/plugins/snapshot/dmeventd_snapshot.c:132:12: branch_false: following ‘false’ branch...
 branch_false: ...to here
LVM2.2.03.36/daemons/dmeventd/plugins/snapshot/dmeventd_snapshot.c:138:16: branch_true: following ‘true’ branch...
LVM2.2.03.36/daemons/dmeventd/plugins/snapshot/dmeventd_snapshot.c:140:22: branch_true: ...to here
LVM2.2.03.36/daemons/dmeventd/plugins/snapshot/dmeventd_snapshot.c:140:20: branch_false: following ‘false’ branch...
LVM2.2.03.36/daemons/dmeventd/plugins/snapshot/dmeventd_snapshot.c:144:21: branch_false: ...to here
LVM2.2.03.36/daemons/dmeventd/plugins/snapshot/dmeventd_snapshot.c:155:30: call_function: calling ‘_run’ from ‘_umount’
#   69|   
#   70|           if (pid > 0) { /* parent */
#   71|->                 if (waitpid(pid, &status, 0) != pid)
#   72|                           return 0; /* waitpid failed */
#   73|                   if (!WIFEXITED(status) || WEXITSTATUS(status))

Error: GCC_ANALYZER_WARNING (CWE-775): [#def33]
LVM2.2.03.36/daemons/dmeventd/plugins/snapshot/dmeventd_snapshot.c:144:21: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(&procmounts, "r")’
LVM2.2.03.36/daemons/dmeventd/plugins/snapshot/dmeventd_snapshot.c:132:24: acquire_resource: opened here
LVM2.2.03.36/daemons/dmeventd/plugins/snapshot/dmeventd_snapshot.c:132:12: branch_false: following ‘false’ branch...
 branch_false: ...to here
LVM2.2.03.36/daemons/dmeventd/plugins/snapshot/dmeventd_snapshot.c:138:16: branch_true: following ‘true’ branch...
LVM2.2.03.36/daemons/dmeventd/plugins/snapshot/dmeventd_snapshot.c:140:22: branch_true: ...to here
LVM2.2.03.36/daemons/dmeventd/plugins/snapshot/dmeventd_snapshot.c:140:20: branch_false: following ‘false’ branch...
LVM2.2.03.36/daemons/dmeventd/plugins/snapshot/dmeventd_snapshot.c:144:21: branch_false: ...to here
LVM2.2.03.36/daemons/dmeventd/plugins/snapshot/dmeventd_snapshot.c:144:21: danger: ‘fopen(&procmounts, "r")’ leaks here; was opened at [(1)](sarif:/runs/0/results/5/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): [#def34]
LVM2.2.03.36/daemons/dmeventd/plugins/snapshot/dmeventd_snapshot.c:144:21: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(&procmounts, "r")’
LVM2.2.03.36/daemons/dmeventd/plugins/snapshot/dmeventd_snapshot.c:132:24: acquire_memory: allocated here
LVM2.2.03.36/daemons/dmeventd/plugins/snapshot/dmeventd_snapshot.c:132:12: branch_false: following ‘false’ branch...
 branch_false: ...to here
LVM2.2.03.36/daemons/dmeventd/plugins/snapshot/dmeventd_snapshot.c:138:16: branch_true: following ‘true’ branch...
LVM2.2.03.36/daemons/dmeventd/plugins/snapshot/dmeventd_snapshot.c:140:22: branch_true: ...to here
LVM2.2.03.36/daemons/dmeventd/plugins/snapshot/dmeventd_snapshot.c:140:20: branch_false: following ‘false’ branch...
LVM2.2.03.36/daemons/dmeventd/plugins/snapshot/dmeventd_snapshot.c:144:21: branch_false: ...to here
LVM2.2.03.36/daemons/dmeventd/plugins/snapshot/dmeventd_snapshot.c:144:21: danger: ‘fopen(&procmounts, "r")’ leaks here; was allocated at [(1)](sarif:/runs/0/results/6/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-404): [#def35]
LVM2.2.03.36/daemons/dmeventd/plugins/thin/dmeventd_thin.c:63:1: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
LVM2.2.03.36/daemons/dmeventd/plugins/thin/dmeventd_thin.c:63:1: acquire_resource: ‘va_start’ called here
LVM2.2.03.36/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): [#def36]
LVM2.2.03.36/daemons/dmeventd/plugins/vdo/dmeventd_vdo.c:57:1: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
LVM2.2.03.36/daemons/dmeventd/plugins/vdo/dmeventd_vdo.c:100:12: enter_function: entry to ‘_use_policy’
LVM2.2.03.36/daemons/dmeventd/plugins/vdo/dmeventd_vdo.c:109:17: call_function: calling ‘print_log’ from ‘_use_policy’
#   55|   };
#   56|   
#   57|-> DM_EVENT_LOG_FN("vdo")
#   58|   
#   59|   static int _run_command(struct dso_state *state)

Error: GCC_ANALYZER_WARNING (CWE-686): [#def37]
LVM2.2.03.36/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.36/daemons/lvmlockd/lvmlockctl.c:604:12: enter_function: entry to ‘do_dump’
LVM2.2.03.36/daemons/lvmlockd/lvmlockctl.c:611:14: call_function: calling ‘setup_dump_socket’ from ‘do_dump’
LVM2.2.03.36/daemons/lvmlockd/lvmlockctl.c:611:14: return_function: returning to ‘do_dump’ from ‘setup_dump_socket’
LVM2.2.03.36/daemons/lvmlockd/lvmlockctl.c:612:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/daemons/lvmlockd/lvmlockctl.c:617:17: branch_false: ...to here
LVM2.2.03.36/daemons/lvmlockd/lvmlockctl.c:619:12: branch_false: following ‘false’ branch (when ‘<unknown> == 0’)...
LVM2.2.03.36/daemons/lvmlockd/lvmlockctl.c:625:18: call_function: inlined call to ‘daemon_reply_int’ from ‘do_dump’
LVM2.2.03.36/daemons/lvmlockd/lvmlockctl.c:635:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/daemons/lvmlockd/lvmlockctl.c:638:9: branch_false: ...to here
LVM2.2.03.36/daemons/lvmlockd/lvmlockctl.c:643:12: branch_false: following ‘false’ branch (when ‘rv >= 0’)...
LVM2.2.03.36/daemons/lvmlockd/lvmlockctl.c:648:9: branch_false: ...to here
LVM2.2.03.36/daemons/lvmlockd/lvmlockctl.c:655:13: branch_false: following ‘false’ branch (when the strings are non-equal)...
LVM2.2.03.36/daemons/lvmlockd/lvmlockctl.c:658:17: branch_false: ...to here
LVM2.2.03.36/daemons/lvmlockd/lvmlockctl.c:658: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): [#def38]
LVM2.2.03.36/daemons/lvmlockd/lvmlockctl.c:123:38: warning[-Wanalyzer-va-arg-type-mismatch]: ‘va_arg’ expected ‘int *’ but received ‘long unsigned int’ for variadic argument 3 of ‘args’
LVM2.2.03.36/daemons/lvmlockd/lvmlockctl.c:604:12: enter_function: entry to ‘do_dump’
LVM2.2.03.36/daemons/lvmlockd/lvmlockctl.c:611:14: call_function: calling ‘setup_dump_socket’ from ‘do_dump’
LVM2.2.03.36/daemons/lvmlockd/lvmlockctl.c:611:14: return_function: returning to ‘do_dump’ from ‘setup_dump_socket’
LVM2.2.03.36/daemons/lvmlockd/lvmlockctl.c:612:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/daemons/lvmlockd/lvmlockctl.c:617:17: branch_false: ...to here
LVM2.2.03.36/daemons/lvmlockd/lvmlockctl.c:619:12: branch_false: following ‘false’ branch (when ‘<unknown> == 0’)...
LVM2.2.03.36/daemons/lvmlockd/lvmlockctl.c:625:18: call_function: inlined call to ‘daemon_reply_int’ from ‘do_dump’
LVM2.2.03.36/daemons/lvmlockd/lvmlockctl.c:635:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/daemons/lvmlockd/lvmlockctl.c:638:9: branch_false: ...to here
LVM2.2.03.36/daemons/lvmlockd/lvmlockctl.c:643:12: branch_false: following ‘false’ branch (when ‘rv >= 0’)...
LVM2.2.03.36/daemons/lvmlockd/lvmlockctl.c:648:9: branch_false: ...to here
LVM2.2.03.36/daemons/lvmlockd/lvmlockctl.c:655:13: branch_false: following ‘false’ branch (when the strings are non-equal)...
LVM2.2.03.36/daemons/lvmlockd/lvmlockctl.c:658:17: branch_false: ...to here
LVM2.2.03.36/daemons/lvmlockd/lvmlockctl.c:658: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): [#def39]
LVM2.2.03.36/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.36/daemons/lvmlockd/lvmlockctl.c:604:12: enter_function: entry to ‘do_dump’
LVM2.2.03.36/daemons/lvmlockd/lvmlockctl.c:611:14: call_function: calling ‘setup_dump_socket’ from ‘do_dump’
LVM2.2.03.36/daemons/lvmlockd/lvmlockctl.c:611:14: return_function: returning to ‘do_dump’ from ‘setup_dump_socket’
LVM2.2.03.36/daemons/lvmlockd/lvmlockctl.c:612:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/daemons/lvmlockd/lvmlockctl.c:617:17: branch_false: ...to here
LVM2.2.03.36/daemons/lvmlockd/lvmlockctl.c:619:12: branch_false: following ‘false’ branch (when ‘<unknown> == 0’)...
LVM2.2.03.36/daemons/lvmlockd/lvmlockctl.c:625:18: call_function: inlined call to ‘daemon_reply_int’ from ‘do_dump’
LVM2.2.03.36/daemons/lvmlockd/lvmlockctl.c:635:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/daemons/lvmlockd/lvmlockctl.c:638:9: branch_false: ...to here
LVM2.2.03.36/daemons/lvmlockd/lvmlockctl.c:643:12: branch_false: following ‘false’ branch (when ‘rv >= 0’)...
LVM2.2.03.36/daemons/lvmlockd/lvmlockctl.c:648:9: branch_false: ...to here
LVM2.2.03.36/daemons/lvmlockd/lvmlockctl.c:655:13: branch_false: following ‘false’ branch (when the strings are non-equal)...
LVM2.2.03.36/daemons/lvmlockd/lvmlockctl.c:658:17: branch_false: ...to here
LVM2.2.03.36/daemons/lvmlockd/lvmlockctl.c:658: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-686): [#def40]
LVM2.2.03.36/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 3 of ‘args’
LVM2.2.03.36/daemons/lvmlockd/lvmlockctl.c:604:12: enter_function: entry to ‘do_dump’
LVM2.2.03.36/daemons/lvmlockd/lvmlockctl.c:611:14: call_function: calling ‘setup_dump_socket’ from ‘do_dump’
LVM2.2.03.36/daemons/lvmlockd/lvmlockctl.c:611:14: return_function: returning to ‘do_dump’ from ‘setup_dump_socket’
LVM2.2.03.36/daemons/lvmlockd/lvmlockctl.c:612:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/daemons/lvmlockd/lvmlockctl.c:617:17: branch_false: ...to here
LVM2.2.03.36/daemons/lvmlockd/lvmlockctl.c:619:12: branch_false: following ‘false’ branch (when ‘<unknown> == 0’)...
LVM2.2.03.36/daemons/lvmlockd/lvmlockctl.c:625:18: call_function: inlined call to ‘daemon_reply_int’ from ‘do_dump’
LVM2.2.03.36/daemons/lvmlockd/lvmlockctl.c:635:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/daemons/lvmlockd/lvmlockctl.c:638:9: branch_false: ...to here
LVM2.2.03.36/daemons/lvmlockd/lvmlockctl.c:643:12: branch_false: following ‘false’ branch (when ‘rv >= 0’)...
LVM2.2.03.36/daemons/lvmlockd/lvmlockctl.c:648:9: branch_false: ...to here
LVM2.2.03.36/daemons/lvmlockd/lvmlockctl.c:655:13: branch_false: following ‘false’ branch (when the strings are non-equal)...
LVM2.2.03.36/daemons/lvmlockd/lvmlockctl.c:658:17: branch_false: ...to here
LVM2.2.03.36/daemons/lvmlockd/lvmlockctl.c:658: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-686): [#def41]
LVM2.2.03.36/daemons/lvmlockd/lvmlockctl.c:157:40: warning[-Wanalyzer-va-arg-type-mismatch]: ‘va_arg’ expected ‘size_t’ {{aka ‘long unsigned int’}} but received ‘int *’ for variadic argument 2 of ‘args’
LVM2.2.03.36/daemons/lvmlockd/lvmlockctl.c:604:12: enter_function: entry to ‘do_dump’
LVM2.2.03.36/daemons/lvmlockd/lvmlockctl.c:611:14: call_function: calling ‘setup_dump_socket’ from ‘do_dump’
LVM2.2.03.36/daemons/lvmlockd/lvmlockctl.c:611:14: return_function: returning to ‘do_dump’ from ‘setup_dump_socket’
LVM2.2.03.36/daemons/lvmlockd/lvmlockctl.c:612:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/daemons/lvmlockd/lvmlockctl.c:617:17: branch_false: ...to here
LVM2.2.03.36/daemons/lvmlockd/lvmlockctl.c:619:12: branch_false: following ‘false’ branch (when ‘<unknown> == 0’)...
LVM2.2.03.36/daemons/lvmlockd/lvmlockctl.c:625:18: call_function: inlined call to ‘daemon_reply_int’ from ‘do_dump’
LVM2.2.03.36/daemons/lvmlockd/lvmlockctl.c:635:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/daemons/lvmlockd/lvmlockctl.c:638:9: branch_false: ...to here
LVM2.2.03.36/daemons/lvmlockd/lvmlockctl.c:643:12: branch_false: following ‘false’ branch (when ‘rv >= 0’)...
LVM2.2.03.36/daemons/lvmlockd/lvmlockctl.c:648:9: branch_false: ...to here
LVM2.2.03.36/daemons/lvmlockd/lvmlockctl.c:655:13: branch_false: following ‘false’ branch (when the strings are non-equal)...
LVM2.2.03.36/daemons/lvmlockd/lvmlockctl.c:658:17: branch_false: ...to here
LVM2.2.03.36/daemons/lvmlockd/lvmlockctl.c:658:17: call_function: calling ‘format_info’ from ‘do_dump’
#  155|   				 * but did not fit in the dest buffer are skipped.
#  156|   				 */
#  157|-> 				size_t dest_size = va_arg(args, size_t);
#  158|   				char *dest = va_arg(args, char *);
#  159|   				char *out = dest;

Error: GCC_ANALYZER_WARNING (CWE-686): [#def42]
LVM2.2.03.36/daemons/lvmlockd/lvmlockctl.c:157:40: warning[-Wanalyzer-va-arg-type-mismatch]: ‘va_arg’ expected ‘size_t’ {{aka ‘long unsigned int’}} but received ‘uint32_t *’ {{aka ‘unsigned int *’}} for variadic argument 1 of ‘args’
LVM2.2.03.36/daemons/lvmlockd/lvmlockctl.c:604:12: enter_function: entry to ‘do_dump’
LVM2.2.03.36/daemons/lvmlockd/lvmlockctl.c:611:14: call_function: calling ‘setup_dump_socket’ from ‘do_dump’
LVM2.2.03.36/daemons/lvmlockd/lvmlockctl.c:611:14: return_function: returning to ‘do_dump’ from ‘setup_dump_socket’
LVM2.2.03.36/daemons/lvmlockd/lvmlockctl.c:612:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/daemons/lvmlockd/lvmlockctl.c:617:17: branch_false: ...to here
LVM2.2.03.36/daemons/lvmlockd/lvmlockctl.c:619:12: branch_false: following ‘false’ branch (when ‘<unknown> == 0’)...
LVM2.2.03.36/daemons/lvmlockd/lvmlockctl.c:625:18: call_function: inlined call to ‘daemon_reply_int’ from ‘do_dump’
LVM2.2.03.36/daemons/lvmlockd/lvmlockctl.c:635:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/daemons/lvmlockd/lvmlockctl.c:638:9: branch_false: ...to here
LVM2.2.03.36/daemons/lvmlockd/lvmlockctl.c:643:12: branch_false: following ‘false’ branch (when ‘rv >= 0’)...
LVM2.2.03.36/daemons/lvmlockd/lvmlockctl.c:648:9: branch_false: ...to here
LVM2.2.03.36/daemons/lvmlockd/lvmlockctl.c:655:13: branch_false: following ‘false’ branch (when the strings are non-equal)...
LVM2.2.03.36/daemons/lvmlockd/lvmlockctl.c:658:17: branch_false: ...to here
LVM2.2.03.36/daemons/lvmlockd/lvmlockctl.c:658:17: call_function: calling ‘format_info’ from ‘do_dump’
#  155|   				 * but did not fit in the dest buffer are skipped.
#  156|   				 */
#  157|-> 				size_t dest_size = va_arg(args, size_t);
#  158|   				char *dest = va_arg(args, char *);
#  159|   				char *out = dest;

Error: GCC_ANALYZER_WARNING (CWE-404): [#def43]
LVM2.2.03.36/daemons/lvmlockd/lvmlockctl.c:524:9: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
LVM2.2.03.36/daemons/lvmlockd/lvmlockctl.c:665:12: enter_function: entry to ‘do_able’
LVM2.2.03.36/daemons/lvmlockd/lvmlockctl.c:671:17: call_function: calling ‘_lvmlockd_send’ from ‘do_able’
#  522|   
#  523|   	va_start(ap, req_name);
#  524|-> 	daemon_request_extend_v(req, ap);
#  525|   	va_end(ap);
#  526|   

Error: GCC_ANALYZER_WARNING (CWE-775): [#def44]
LVM2.2.03.36/daemons/lvmlockd/lvmlockctl.c:724:24: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘pipefd[(int)pid]’
LVM2.2.03.36/daemons/lvmlockd/lvmlockctl.c:971:12: enter_function: entry to ‘_run_kill_command’
LVM2.2.03.36/daemons/lvmlockd/lvmlockctl.c:977:9: call_function: calling ‘_run_command_pipe’ from ‘_run_kill_command’
#  722|   	int r = 0;
#  723|   
#  724|-> 	if ((null_fd = open("/dev/null", O_RDWR)) == -1) {
#  725|   		log_error("open error /dev/null %d", errno);
#  726|   		return 0;

Error: GCC_ANALYZER_WARNING (CWE-775): [#def45]
LVM2.2.03.36/daemons/lvmlockd/lvmlockctl.c:724:24: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘pipefd[0]’
LVM2.2.03.36/daemons/lvmlockd/lvmlockctl.c:752:13: enter_function: entry to ‘_run_command_pipe’
LVM2.2.03.36/daemons/lvmlockd/lvmlockctl.c:765:21: branch_true: following ‘true’ branch (when ‘i != 33’)...
LVM2.2.03.36/daemons/lvmlockd/lvmlockctl.c:766:17: branch_true: ...to here
LVM2.2.03.36/daemons/lvmlockd/lvmlockctl.c:813:12: branch_false: following ‘false’ branch (when ‘arg_len == 0’)...
LVM2.2.03.36/daemons/lvmlockd/lvmlockctl.c:821:13: branch_false: ...to here
LVM2.2.03.36/daemons/lvmlockd/lvmlockctl.c:821:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/daemons/lvmlockd/lvmlockctl.c:826:15: branch_false: ...to here
LVM2.2.03.36/daemons/lvmlockd/lvmlockctl.c:828:12: branch_false: following ‘false’ branch (when ‘pid >= 0’)...
LVM2.2.03.36/daemons/lvmlockd/lvmlockctl.c:834:12: branch_false: ...to here
LVM2.2.03.36/daemons/lvmlockd/lvmlockctl.c:834:12: branch_true: following ‘true’ branch (when ‘pid == 0’)...
LVM2.2.03.36/daemons/lvmlockd/lvmlockctl.c:836:22: branch_true: ...to here
LVM2.2.03.36/daemons/lvmlockd/lvmlockctl.c:836:22: call_function: calling ‘_reopen_fd_to_null’ from ‘_run_command_pipe’
#  722|   	int r = 0;
#  723|   
#  724|-> 	if ((null_fd = open("/dev/null", O_RDWR)) == -1) {
#  725|   		log_error("open error /dev/null %d", errno);
#  726|   		return 0;

Error: GCC_ANALYZER_WARNING (CWE-775): [#def46]
LVM2.2.03.36/daemons/lvmlockd/lvmlockctl.c:724:24: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘pipefd[1]’
LVM2.2.03.36/daemons/lvmlockd/lvmlockctl.c:752:13: enter_function: entry to ‘_run_command_pipe’
LVM2.2.03.36/daemons/lvmlockd/lvmlockctl.c:765:21: branch_true: following ‘true’ branch (when ‘i != 33’)...
LVM2.2.03.36/daemons/lvmlockd/lvmlockctl.c:766:17: branch_true: ...to here
LVM2.2.03.36/daemons/lvmlockd/lvmlockctl.c:813:12: branch_false: following ‘false’ branch (when ‘arg_len == 0’)...
LVM2.2.03.36/daemons/lvmlockd/lvmlockctl.c:821:13: branch_false: ...to here
LVM2.2.03.36/daemons/lvmlockd/lvmlockctl.c:821:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/daemons/lvmlockd/lvmlockctl.c:826:15: branch_false: ...to here
LVM2.2.03.36/daemons/lvmlockd/lvmlockctl.c:828:12: branch_false: following ‘false’ branch (when ‘pid >= 0’)...
LVM2.2.03.36/daemons/lvmlockd/lvmlockctl.c:834:12: branch_false: ...to here
LVM2.2.03.36/daemons/lvmlockd/lvmlockctl.c:834:12: branch_true: following ‘true’ branch (when ‘pid == 0’)...
LVM2.2.03.36/daemons/lvmlockd/lvmlockctl.c:836:22: branch_true: ...to here
LVM2.2.03.36/daemons/lvmlockd/lvmlockctl.c:836:22: call_function: calling ‘_reopen_fd_to_null’ from ‘_run_command_pipe’
#  722|   	int r = 0;
#  723|   
#  724|-> 	if ((null_fd = open("/dev/null", O_RDWR)) == -1) {
#  725|   		log_error("open error /dev/null %d", errno);
#  726|   		return 0;

Error: GCC_ANALYZER_WARNING (CWE-775): [#def47]
LVM2.2.03.36/daemons/lvmlockd/lvmlockctl.c:729:13: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘open("/dev/null", 2)’
LVM2.2.03.36/daemons/lvmlockd/lvmlockctl.c:724:24: acquire_resource: opened here
LVM2.2.03.36/daemons/lvmlockd/lvmlockctl.c:724:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/daemons/lvmlockd/lvmlockctl.c:729:13: branch_false: ...to here
LVM2.2.03.36/daemons/lvmlockd/lvmlockctl.c:729:13: danger: ‘open("/dev/null", 2)’ leaks here; was opened at [(1)](sarif:/runs/0/results/14/codeFlows/0/threadFlows/0/locations/0)
#  727|   	}
#  728|   
#  729|-> 	if (close(fd)) {
#  730|   		log_error("close error fd %d %d", fd, errno);
#  731|   		goto out;

Error: GCC_ANALYZER_WARNING (CWE-775): [#def48]
LVM2.2.03.36/daemons/lvmlockd/lvmlockctl.c:729:13: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘pipefd[(int)pid]’
LVM2.2.03.36/daemons/lvmlockd/lvmlockctl.c:971:12: enter_function: entry to ‘_run_kill_command’
LVM2.2.03.36/daemons/lvmlockd/lvmlockctl.c:977:9: call_function: calling ‘_run_command_pipe’ from ‘_run_kill_command’
#  727|   	}
#  728|   
#  729|-> 	if (close(fd)) {
#  730|   		log_error("close error fd %d %d", fd, errno);
#  731|   		goto out;

Error: GCC_ANALYZER_WARNING (CWE-775): [#def49]
LVM2.2.03.36/daemons/lvmlockd/lvmlockctl.c:729:13: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘pipefd[0]’
LVM2.2.03.36/daemons/lvmlockd/lvmlockctl.c:752:13: enter_function: entry to ‘_run_command_pipe’
LVM2.2.03.36/daemons/lvmlockd/lvmlockctl.c:765:21: branch_true: following ‘true’ branch (when ‘i != 33’)...
LVM2.2.03.36/daemons/lvmlockd/lvmlockctl.c:766:17: branch_true: ...to here
LVM2.2.03.36/daemons/lvmlockd/lvmlockctl.c:813:12: branch_false: following ‘false’ branch (when ‘arg_len == 0’)...
LVM2.2.03.36/daemons/lvmlockd/lvmlockctl.c:821:13: branch_false: ...to here
LVM2.2.03.36/daemons/lvmlockd/lvmlockctl.c:821:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/daemons/lvmlockd/lvmlockctl.c:826:15: branch_false: ...to here
LVM2.2.03.36/daemons/lvmlockd/lvmlockctl.c:828:12: branch_false: following ‘false’ branch (when ‘pid >= 0’)...
LVM2.2.03.36/daemons/lvmlockd/lvmlockctl.c:834:12: branch_false: ...to here
LVM2.2.03.36/daemons/lvmlockd/lvmlockctl.c:834:12: branch_true: following ‘true’ branch (when ‘pid == 0’)...
LVM2.2.03.36/daemons/lvmlockd/lvmlockctl.c:836:22: branch_true: ...to here
LVM2.2.03.36/daemons/lvmlockd/lvmlockctl.c:836:22: call_function: calling ‘_reopen_fd_to_null’ from ‘_run_command_pipe’
#  727|   	}
#  728|   
#  729|-> 	if (close(fd)) {
#  730|   		log_error("close error fd %d %d", fd, errno);
#  731|   		goto out;

Error: GCC_ANALYZER_WARNING (CWE-775): [#def50]
LVM2.2.03.36/daemons/lvmlockd/lvmlockctl.c:729:13: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘pipefd[1]’
LVM2.2.03.36/daemons/lvmlockd/lvmlockctl.c:752:13: enter_function: entry to ‘_run_command_pipe’
LVM2.2.03.36/daemons/lvmlockd/lvmlockctl.c:765:21: branch_true: following ‘true’ branch (when ‘i != 33’)...
LVM2.2.03.36/daemons/lvmlockd/lvmlockctl.c:766:17: branch_true: ...to here
LVM2.2.03.36/daemons/lvmlockd/lvmlockctl.c:813:12: branch_false: following ‘false’ branch (when ‘arg_len == 0’)...
LVM2.2.03.36/daemons/lvmlockd/lvmlockctl.c:821:13: branch_false: ...to here
LVM2.2.03.36/daemons/lvmlockd/lvmlockctl.c:821:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/daemons/lvmlockd/lvmlockctl.c:826:15: branch_false: ...to here
LVM2.2.03.36/daemons/lvmlockd/lvmlockctl.c:828:12: branch_false: following ‘false’ branch (when ‘pid >= 0’)...
LVM2.2.03.36/daemons/lvmlockd/lvmlockctl.c:834:12: branch_false: ...to here
LVM2.2.03.36/daemons/lvmlockd/lvmlockctl.c:834:12: branch_true: following ‘true’ branch (when ‘pid == 0’)...
LVM2.2.03.36/daemons/lvmlockd/lvmlockctl.c:836:22: branch_true: ...to here
LVM2.2.03.36/daemons/lvmlockd/lvmlockctl.c:836:22: call_function: calling ‘_reopen_fd_to_null’ from ‘_run_command_pipe’
#  727|   	}
#  728|   
#  729|-> 	if (close(fd)) {
#  730|   		log_error("close error fd %d %d", fd, errno);
#  731|   		goto out;

Error: GCC_ANALYZER_WARNING: [#def51]
LVM2.2.03.36/daemons/lvmlockd/lvmlockctl.c:734:13: warning[-Wanalyzer-fd-use-without-check]: ‘dup2’ on possibly invalid file descriptor ‘fd’
LVM2.2.03.36/daemons/lvmlockd/lvmlockctl.c:724:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/daemons/lvmlockd/lvmlockctl.c:729:13: branch_false: ...to here
LVM2.2.03.36/daemons/lvmlockd/lvmlockctl.c:729:13: release_resource: closed here
LVM2.2.03.36/daemons/lvmlockd/lvmlockctl.c:729:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/daemons/lvmlockd/lvmlockctl.c:734:13: branch_false: ...to here
LVM2.2.03.36/daemons/lvmlockd/lvmlockctl.c:734:13: danger: ‘fd’ could be invalid
#  732|   	}
#  733|   
#  734|-> 	if (dup2(null_fd, fd) == -1) {
#  735|   		log_error("dup2 error %d", errno);
#  736|   		goto out;

Error: GCC_ANALYZER_WARNING (CWE-775): [#def52]
LVM2.2.03.36/daemons/lvmlockd/lvmlockctl.c:741:13: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘open("/dev/null", 2)’
LVM2.2.03.36/daemons/lvmlockd/lvmlockctl.c:724:24: acquire_resource: opened here
LVM2.2.03.36/daemons/lvmlockd/lvmlockctl.c:724:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/daemons/lvmlockd/lvmlockctl.c:729:13: branch_false: ...to here
LVM2.2.03.36/daemons/lvmlockd/lvmlockctl.c:741:13: danger: ‘open("/dev/null", 2)’ leaks here; was opened at [(1)](sarif:/runs/0/results/22/codeFlows/0/threadFlows/0/locations/0)
#  739|   	r = 1;
#  740|   out:
#  741|-> 	if (close(null_fd)) {
#  742|   		log_error("close error fd %d %d", null_fd, errno);
#  743|   		return 0;

Error: GCC_ANALYZER_WARNING (CWE-775): [#def53]
LVM2.2.03.36/daemons/lvmlockd/lvmlockctl.c:741:13: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘pipefd[(int)pid]’
LVM2.2.03.36/daemons/lvmlockd/lvmlockctl.c:971:12: enter_function: entry to ‘_run_kill_command’
LVM2.2.03.36/daemons/lvmlockd/lvmlockctl.c:977:9: call_function: calling ‘_run_command_pipe’ from ‘_run_kill_command’
#  739|   	r = 1;
#  740|   out:
#  741|-> 	if (close(null_fd)) {
#  742|   		log_error("close error fd %d %d", null_fd, errno);
#  743|   		return 0;

Error: GCC_ANALYZER_WARNING (CWE-775): [#def54]
LVM2.2.03.36/daemons/lvmlockd/lvmlockctl.c:741:13: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘pipefd[0]’
LVM2.2.03.36/daemons/lvmlockd/lvmlockctl.c:752:13: enter_function: entry to ‘_run_command_pipe’
LVM2.2.03.36/daemons/lvmlockd/lvmlockctl.c:765:21: branch_true: following ‘true’ branch (when ‘i != 33’)...
LVM2.2.03.36/daemons/lvmlockd/lvmlockctl.c:766:17: branch_true: ...to here
LVM2.2.03.36/daemons/lvmlockd/lvmlockctl.c:813:12: branch_false: following ‘false’ branch (when ‘arg_len == 0’)...
LVM2.2.03.36/daemons/lvmlockd/lvmlockctl.c:821:13: branch_false: ...to here
LVM2.2.03.36/daemons/lvmlockd/lvmlockctl.c:821:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/daemons/lvmlockd/lvmlockctl.c:826:15: branch_false: ...to here
LVM2.2.03.36/daemons/lvmlockd/lvmlockctl.c:828:12: branch_false: following ‘false’ branch (when ‘pid >= 0’)...
LVM2.2.03.36/daemons/lvmlockd/lvmlockctl.c:834:12: branch_false: ...to here
LVM2.2.03.36/daemons/lvmlockd/lvmlockctl.c:834:12: branch_true: following ‘true’ branch (when ‘pid == 0’)...
LVM2.2.03.36/daemons/lvmlockd/lvmlockctl.c:836:22: branch_true: ...to here
LVM2.2.03.36/daemons/lvmlockd/lvmlockctl.c:836:22: call_function: calling ‘_reopen_fd_to_null’ from ‘_run_command_pipe’
#  739|   	r = 1;
#  740|   out:
#  741|-> 	if (close(null_fd)) {
#  742|   		log_error("close error fd %d %d", null_fd, errno);
#  743|   		return 0;

Error: GCC_ANALYZER_WARNING (CWE-775): [#def55]
LVM2.2.03.36/daemons/lvmlockd/lvmlockctl.c:741:13: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘pipefd[1]’
LVM2.2.03.36/daemons/lvmlockd/lvmlockctl.c:752:13: enter_function: entry to ‘_run_command_pipe’
LVM2.2.03.36/daemons/lvmlockd/lvmlockctl.c:765:21: branch_true: following ‘true’ branch (when ‘i != 33’)...
LVM2.2.03.36/daemons/lvmlockd/lvmlockctl.c:766:17: branch_true: ...to here
LVM2.2.03.36/daemons/lvmlockd/lvmlockctl.c:813:12: branch_false: following ‘false’ branch (when ‘arg_len == 0’)...
LVM2.2.03.36/daemons/lvmlockd/lvmlockctl.c:821:13: branch_false: ...to here
LVM2.2.03.36/daemons/lvmlockd/lvmlockctl.c:821:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/daemons/lvmlockd/lvmlockctl.c:826:15: branch_false: ...to here
LVM2.2.03.36/daemons/lvmlockd/lvmlockctl.c:828:12: branch_false: following ‘false’ branch (when ‘pid >= 0’)...
LVM2.2.03.36/daemons/lvmlockd/lvmlockctl.c:834:12: branch_false: ...to here
LVM2.2.03.36/daemons/lvmlockd/lvmlockctl.c:834:12: branch_true: following ‘true’ branch (when ‘pid == 0’)...
LVM2.2.03.36/daemons/lvmlockd/lvmlockctl.c:836:22: branch_true: ...to here
LVM2.2.03.36/daemons/lvmlockd/lvmlockctl.c:836:22: call_function: calling ‘_reopen_fd_to_null’ from ‘_run_command_pipe’
#  739|   	r = 1;
#  740|   out:
#  741|-> 	if (close(null_fd)) {
#  742|   		log_error("close error fd %d %d", null_fd, errno);
#  743|   		return 0;

Error: GCC_ANALYZER_WARNING (CWE-775): [#def56]
LVM2.2.03.36/daemons/lvmlockd/lvmlockctl.c:854:13: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘pipefd[(int)pid]’
LVM2.2.03.36/daemons/lvmlockd/lvmlockctl.c:971:12: enter_function: entry to ‘_run_kill_command’
LVM2.2.03.36/daemons/lvmlockd/lvmlockctl.c:977:9: call_function: calling ‘_run_command_pipe’ from ‘_run_kill_command’
#  852|   
#  853|   	/* Parent -> reader */
#  854|-> 	if (close(pipefd[1 /*write*/]))
#  855|   		log_error("close error STDOUT %d", errno);
#  856|   

Error: GCC_ANALYZER_WARNING (CWE-775): [#def57]
LVM2.2.03.36/daemons/lvmlockd/lvmlockctl.c:854:13: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘pipefd[0]’
LVM2.2.03.36/daemons/lvmlockd/lvmlockctl.c:765:21: branch_true: following ‘true’ branch (when ‘i != 33’)...
LVM2.2.03.36/daemons/lvmlockd/lvmlockctl.c:766:17: branch_true: ...to here
LVM2.2.03.36/daemons/lvmlockd/lvmlockctl.c:813:12: branch_false: following ‘false’ branch (when ‘arg_len == 0’)...
LVM2.2.03.36/daemons/lvmlockd/lvmlockctl.c:821:13: branch_false: ...to here
LVM2.2.03.36/daemons/lvmlockd/lvmlockctl.c:821:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/daemons/lvmlockd/lvmlockctl.c:826:15: branch_false: ...to here
LVM2.2.03.36/daemons/lvmlockd/lvmlockctl.c:828:12: branch_false: following ‘false’ branch (when ‘pid >= 0’)...
LVM2.2.03.36/daemons/lvmlockd/lvmlockctl.c:834:12: branch_false: ...to here
LVM2.2.03.36/daemons/lvmlockd/lvmlockctl.c:834:12: branch_false: following ‘false’ branch (when ‘pid != 0’)...
LVM2.2.03.36/daemons/lvmlockd/lvmlockctl.c:854:13: branch_false: ...to here
LVM2.2.03.36/daemons/lvmlockd/lvmlockctl.c:854:13: danger: ‘pipefd[0]’ leaks here
#  852|   
#  853|   	/* Parent -> reader */
#  854|-> 	if (close(pipefd[1 /*write*/]))
#  855|   		log_error("close error STDOUT %d", errno);
#  856|   

Error: GCC_ANALYZER_WARNING (CWE-775): [#def58]
LVM2.2.03.36/daemons/lvmlockd/lvmlockctl.c:854:13: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘pipefd[1]’
LVM2.2.03.36/daemons/lvmlockd/lvmlockctl.c:765:21: branch_true: following ‘true’ branch (when ‘i != 33’)...
LVM2.2.03.36/daemons/lvmlockd/lvmlockctl.c:766:17: branch_true: ...to here
LVM2.2.03.36/daemons/lvmlockd/lvmlockctl.c:813:12: branch_false: following ‘false’ branch (when ‘arg_len == 0’)...
LVM2.2.03.36/daemons/lvmlockd/lvmlockctl.c:821:13: branch_false: ...to here
LVM2.2.03.36/daemons/lvmlockd/lvmlockctl.c:821:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/daemons/lvmlockd/lvmlockctl.c:826:15: branch_false: ...to here
LVM2.2.03.36/daemons/lvmlockd/lvmlockctl.c:828:12: branch_false: following ‘false’ branch (when ‘pid >= 0’)...
LVM2.2.03.36/daemons/lvmlockd/lvmlockctl.c:834:12: branch_false: ...to here
LVM2.2.03.36/daemons/lvmlockd/lvmlockctl.c:834:12: branch_false: following ‘false’ branch (when ‘pid != 0’)...
LVM2.2.03.36/daemons/lvmlockd/lvmlockctl.c:854:13: branch_false: ...to here
LVM2.2.03.36/daemons/lvmlockd/lvmlockctl.c:854:13: danger: ‘pipefd[1]’ leaks here
#  852|   
#  853|   	/* Parent -> reader */
#  854|-> 	if (close(pipefd[1 /*write*/]))
#  855|   		log_error("close error STDOUT %d", errno);
#  856|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def59]
LVM2.2.03.36/daemons/lvmlockd/lvmlockctl.c:854:13: warning[-Wanalyzer-malloc-leak]: leak of ‘arg_dup’
LVM2.2.03.36/daemons/lvmlockd/lvmlockctl.c:765:21: branch_true: following ‘true’ branch (when ‘i != 33’)...
LVM2.2.03.36/daemons/lvmlockd/lvmlockctl.c:766:17: branch_true: ...to here
LVM2.2.03.36/daemons/lvmlockd/lvmlockctl.c:773:21: branch_true: following ‘true’ branch (when ‘i < cmd_len’)...
LVM2.2.03.36/daemons/lvmlockd/lvmlockctl.c:774:29: branch_true: ...to here
LVM2.2.03.36/daemons/lvmlockd/lvmlockctl.c:774:20: branch_false: following ‘false’ branch...
LVM2.2.03.36/daemons/lvmlockd/lvmlockctl.c:777:20: branch_false: ...to here
LVM2.2.03.36/daemons/lvmlockd/lvmlockctl.c:777:20: branch_false: following ‘false’ branch (when ‘av_count != 32’)...
LVM2.2.03.36/daemons/lvmlockd/lvmlockctl.c:780:20: branch_false: ...to here
LVM2.2.03.36/daemons/lvmlockd/lvmlockctl.c:781:28: branch_false: following ‘false’ branch...
LVM2.2.03.36/daemons/lvmlockd/lvmlockctl.c:783:25: branch_false: ...to here
LVM2.2.03.36/daemons/lvmlockd/lvmlockctl.c:773:21: branch_true: following ‘true’ branch (when ‘i < cmd_len’)...
LVM2.2.03.36/daemons/lvmlockd/lvmlockctl.c:774:29: branch_true: ...to here
LVM2.2.03.36/daemons/lvmlockd/lvmlockctl.c:774:20: branch_false: following ‘false’ branch...
LVM2.2.03.36/daemons/lvmlockd/lvmlockctl.c:777:20: branch_false: ...to here
LVM2.2.03.36/daemons/lvmlockd/lvmlockctl.c:777:20: branch_false: following ‘false’ branch (when ‘av_count != 32’)...
LVM2.2.03.36/daemons/lvmlockd/lvmlockctl.c:780:20: branch_false: ...to here
LVM2.2.03.36/daemons/lvmlockd/lvmlockctl.c:799:27: branch_true: following ‘true’ branch...
LVM2.2.03.36/daemons/lvmlockd/lvmlockctl.c:800:28: branch_true: ...to here
LVM2.2.03.36/daemons/lvmlockd/lvmlockctl.c:801:36: branch_false: following ‘false’ branch (when ‘arg_dup’ is non-NULL)...
LVM2.2.03.36/daemons/lvmlockd/lvmlockctl.c:803:36: branch_false: ...to here
LVM2.2.03.36/daemons/lvmlockd/lvmlockctl.c:773:21: branch_true: following ‘true’ branch (when ‘i < cmd_len’)...
LVM2.2.03.36/daemons/lvmlockd/lvmlockctl.c:774:29: branch_true: ...to here
LVM2.2.03.36/daemons/lvmlockd/lvmlockctl.c:774:20: branch_false: following ‘false’ branch...
LVM2.2.03.36/daemons/lvmlockd/lvmlockctl.c:777:20: branch_false: ...to here
LVM2.2.03.36/daemons/lvmlockd/lvmlockctl.c:777:20: branch_false: following ‘false’ branch (when ‘av_count != 32’)...
LVM2.2.03.36/daemons/lvmlockd/lvmlockctl.c:780:20: branch_false: ...to here
LVM2.2.03.36/daemons/lvmlockd/lvmlockctl.c:813:12: branch_true: following ‘true’ branch (when ‘arg_len != 0’)...
LVM2.2.03.36/daemons/lvmlockd/lvmlockctl.c:814:20: branch_true: ...to here
LVM2.2.03.36/daemons/lvmlockd/lvmlockctl.c:814:20: branch_false: following ‘false’ branch (when ‘av_count <= 31’)...
LVM2.2.03.36/daemons/lvmlockd/lvmlockctl.c:816:33: branch_false: ...to here
LVM2.2.03.36/daemons/lvmlockd/lvmlockctl.c:816:33: acquire_memory: allocated here
LVM2.2.03.36/daemons/lvmlockd/lvmlockctl.c:816:20: branch_false: following ‘false’ branch (when ‘arg_dup’ is non-NULL)...
LVM2.2.03.36/daemons/lvmlockd/lvmlockctl.c:818:17: branch_false: ...to here
LVM2.2.03.36/daemons/lvmlockd/lvmlockctl.c:821:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/daemons/lvmlockd/lvmlockctl.c:826:15: branch_false: ...to here
LVM2.2.03.36/daemons/lvmlockd/lvmlockctl.c:828:12: branch_false: following ‘false’ branch (when ‘pid >= 0’)...
LVM2.2.03.36/daemons/lvmlockd/lvmlockctl.c:834:12: branch_false: ...to here
LVM2.2.03.36/daemons/lvmlockd/lvmlockctl.c:834:12: branch_false: following ‘false’ branch (when ‘pid != 0’)...
LVM2.2.03.36/daemons/lvmlockd/lvmlockctl.c:854:13: branch_false: ...to here
LVM2.2.03.36/daemons/lvmlockd/lvmlockctl.c:854:13: danger: ‘arg_dup’ leaks here; was allocated at [(31)](sarif:/runs/0/results/27/codeFlows/0/threadFlows/0/locations/30)
#  852|   
#  853|   	/* Parent -> reader */
#  854|-> 	if (close(pipefd[1 /*write*/]))
#  855|   		log_error("close error STDOUT %d", errno);
#  856|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def60]
LVM2.2.03.36/daemons/lvmlockd/lvmlockctl.c:859:21: warning[-Wanalyzer-malloc-leak]: leak of ‘arg_dup’
LVM2.2.03.36/daemons/lvmlockd/lvmlockctl.c:765:21: branch_true: following ‘true’ branch (when ‘i != 33’)...
LVM2.2.03.36/daemons/lvmlockd/lvmlockctl.c:766:17: branch_true: ...to here
LVM2.2.03.36/daemons/lvmlockd/lvmlockctl.c:773:21: branch_true: following ‘true’ branch (when ‘i < cmd_len’)...
LVM2.2.03.36/daemons/lvmlockd/lvmlockctl.c:774:29: branch_true: ...to here
LVM2.2.03.36/daemons/lvmlockd/lvmlockctl.c:774:20: branch_false: following ‘false’ branch...
LVM2.2.03.36/daemons/lvmlockd/lvmlockctl.c:777:20: branch_false: ...to here
LVM2.2.03.36/daemons/lvmlockd/lvmlockctl.c:777:20: branch_false: following ‘false’ branch (when ‘av_count != 32’)...
LVM2.2.03.36/daemons/lvmlockd/lvmlockctl.c:780:20: branch_false: ...to here
LVM2.2.03.36/daemons/lvmlockd/lvmlockctl.c:781:28: branch_false: following ‘false’ branch...
LVM2.2.03.36/daemons/lvmlockd/lvmlockctl.c:783:25: branch_false: ...to here
LVM2.2.03.36/daemons/lvmlockd/lvmlockctl.c:773:21: branch_true: following ‘true’ branch (when ‘i < cmd_len’)...
LVM2.2.03.36/daemons/lvmlockd/lvmlockctl.c:774:29: branch_true: ...to here
LVM2.2.03.36/daemons/lvmlockd/lvmlockctl.c:774:20: branch_false: following ‘false’ branch...
LVM2.2.03.36/daemons/lvmlockd/lvmlockctl.c:777:20: branch_false: ...to here
LVM2.2.03.36/daemons/lvmlockd/lvmlockctl.c:777:20: branch_false: following ‘false’ branch (when ‘av_count != 32’)...
LVM2.2.03.36/daemons/lvmlockd/lvmlockctl.c:780:20: branch_false: ...to here
LVM2.2.03.36/daemons/lvmlockd/lvmlockctl.c:799:27: branch_true: following ‘true’ branch...
LVM2.2.03.36/daemons/lvmlockd/lvmlockctl.c:800:28: branch_true: ...to here
LVM2.2.03.36/daemons/lvmlockd/lvmlockctl.c:801:49: acquire_memory: allocated here
LVM2.2.03.36/daemons/lvmlockd/lvmlockctl.c:801:36: branch_false: following ‘false’ branch (when ‘arg_dup’ is non-NULL)...
LVM2.2.03.36/daemons/lvmlockd/lvmlockctl.c:803:36: branch_false: ...to here
LVM2.2.03.36/daemons/lvmlockd/lvmlockctl.c:773:21: branch_true: following ‘true’ branch (when ‘i < cmd_len’)...
LVM2.2.03.36/daemons/lvmlockd/lvmlockctl.c:774:29: branch_true: ...to here
LVM2.2.03.36/daemons/lvmlockd/lvmlockctl.c:774:20: branch_false: following ‘false’ branch...
LVM2.2.03.36/daemons/lvmlockd/lvmlockctl.c:777:20: branch_false: ...to here
LVM2.2.03.36/daemons/lvmlockd/lvmlockctl.c:777:20: branch_false: following ‘false’ branch (when ‘av_count != 32’)...
LVM2.2.03.36/daemons/lvmlockd/lvmlockctl.c:780:20: branch_false: ...to here
LVM2.2.03.36/daemons/lvmlockd/lvmlockctl.c:813:12: branch_true: following ‘true’ branch (when ‘arg_len != 0’)...
LVM2.2.03.36/daemons/lvmlockd/lvmlockctl.c:814:20: branch_true: ...to here
LVM2.2.03.36/daemons/lvmlockd/lvmlockctl.c:814:20: branch_false: following ‘false’ branch (when ‘av_count <= 31’)...
LVM2.2.03.36/daemons/lvmlockd/lvmlockctl.c:816:33: branch_false: ...to here
LVM2.2.03.36/daemons/lvmlockd/lvmlockctl.c:816:20: branch_false: following ‘false’ branch (when ‘arg_dup’ is non-NULL)...
LVM2.2.03.36/daemons/lvmlockd/lvmlockctl.c:818:17: branch_false: ...to here
LVM2.2.03.36/daemons/lvmlockd/lvmlockctl.c:821:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/daemons/lvmlockd/lvmlockctl.c:826:15: branch_false: ...to here
LVM2.2.03.36/daemons/lvmlockd/lvmlockctl.c:828:12: branch_false: following ‘false’ branch (when ‘pid >= 0’)...
LVM2.2.03.36/daemons/lvmlockd/lvmlockctl.c:834:12: branch_false: ...to here
LVM2.2.03.36/daemons/lvmlockd/lvmlockctl.c:834:12: branch_false: following ‘false’ branch (when ‘pid != 0’)...
LVM2.2.03.36/daemons/lvmlockd/lvmlockctl.c:854:13: branch_false: ...to here
LVM2.2.03.36/daemons/lvmlockd/lvmlockctl.c:857:12: branch_true: following ‘true’ branch (when ‘fp’ is NULL)...
LVM2.2.03.36/daemons/lvmlockd/lvmlockctl.c:858:17: branch_true: ...to here
LVM2.2.03.36/daemons/lvmlockd/lvmlockctl.c:859:21: danger: ‘arg_dup’ leaks here; was allocated at [(19)](sarif:/runs/0/results/29/codeFlows/0/threadFlows/0/locations/18)
#  857|   	if (!(fp = fdopen(pipefd[0 /*read*/],  "r"))) {
#  858|   		log_error("fdopen STDIN error %d", errno);
#  859|-> 		if (close(pipefd[0]))
#  860|   			log_error("close error STDIN %d", errno);
#  861|   	}

Error: GCC_ANALYZER_WARNING (CWE-775): [#def61]
LVM2.2.03.36/daemons/lvmlockd/lvmlockd-core.c:379:17: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘setup_dump_socket()’
LVM2.2.03.36/daemons/lvmlockd/lvmlockd-core.c:5399:14: enter_function: entry to ‘client_thread_main’
LVM2.2.03.36/daemons/lvmlockd/lvmlockd-core.c:5424:30: call_function: inlined call to ‘find_client_id’ from ‘client_thread_main’
LVM2.2.03.36/daemons/lvmlockd/lvmlockd-core.c:5425:25: branch_true: ...to here
LVM2.2.03.36/daemons/lvmlockd/lvmlockd-core.c:5427:28: branch_true: following ‘true’ branch...
LVM2.2.03.36/daemons/lvmlockd/lvmlockd-core.c:5428:33: branch_true: ...to here
LVM2.2.03.36/daemons/lvmlockd/lvmlockd-core.c:5429:38: call_function: calling ‘client_send_result’ from ‘client_thread_main’
#  377|   
#  378|   	if (level <= syslog_priority)
#  379|-> 		syslog(level, "%s", line);
#  380|   
#  381|   	if (daemon_debug)

Error: GCC_ANALYZER_WARNING (CWE-775): [#def62]
LVM2.2.03.36/daemons/lvmlockd/lvmlockd-core.c:379:17: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(adopt_file, "r")’
LVM2.2.03.36/daemons/lvmlockd/lvmlockd-core.c:5766:13: enter_function: entry to ‘adopt_locks’
LVM2.2.03.36/daemons/lvmlockd/lvmlockd-core.c:5786:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/daemons/lvmlockd/lvmlockd-core.c:5795:33: branch_false: ...to here
LVM2.2.03.36/daemons/lvmlockd/lvmlockd-core.c:5803:20: branch_false: following ‘false’ branch...
LVM2.2.03.36/daemons/lvmlockd/lvmlockd-core.c:5807:13: call_function: inlined call to ‘list_empty’ from ‘adopt_locks’
LVM2.2.03.36/daemons/lvmlockd/lvmlockd-core.c:5807:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/daemons/lvmlockd/lvmlockd-core.c:5816:14: branch_false: ...to here
LVM2.2.03.36/daemons/lvmlockd/lvmlockd-core.c:5816:14: call_function: calling ‘read_adopt_file’ from ‘adopt_locks’
#  377|   
#  378|   	if (level <= syslog_priority)
#  379|-> 		syslog(level, "%s", line);
#  380|   
#  381|   	if (daemon_debug)

Error: GCC_ANALYZER_WARNING (CWE-401): [#def63]
LVM2.2.03.36/daemons/lvmlockd/lvmlockd-core.c:379:17: warning[-Wanalyzer-malloc-leak]: leak of ‘alloc_client()’
LVM2.2.03.36/daemons/lvmlockd/lvmlockd-core.c:6359:13: enter_function: entry to ‘process_listener’
LVM2.2.03.36/daemons/lvmlockd/lvmlockd-core.c:6367:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/daemons/lvmlockd/lvmlockd-core.c:6370:20: branch_false: ...to here
LVM2.2.03.36/daemons/lvmlockd/lvmlockd-core.c:6370:20: call_function: calling ‘alloc_client’ from ‘process_listener’
LVM2.2.03.36/daemons/lvmlockd/lvmlockd-core.c:6370:20: return_function: returning to ‘process_listener’ from ‘alloc_client’
LVM2.2.03.36/daemons/lvmlockd/lvmlockd-core.c:6370:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/daemons/lvmlockd/lvmlockd-core.c:6376:14: branch_false: ...to here
LVM2.2.03.36/daemons/lvmlockd/lvmlockd-core.c:6376:14: call_function: calling ‘add_pollfd’ from ‘process_listener’
#  377|   
#  378|   	if (level <= syslog_priority)
#  379|-> 		syslog(level, "%s", line);
#  380|   
#  381|   	if (daemon_debug)

Error: GCC_ANALYZER_WARNING (CWE-401): [#def64]
LVM2.2.03.36/daemons/lvmlockd/lvmlockd-core.c:379:17: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(adopt_file, "r")’
LVM2.2.03.36/daemons/lvmlockd/lvmlockd-core.c:5766:13: enter_function: entry to ‘adopt_locks’
LVM2.2.03.36/daemons/lvmlockd/lvmlockd-core.c:5786:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/daemons/lvmlockd/lvmlockd-core.c:5795:33: branch_false: ...to here
LVM2.2.03.36/daemons/lvmlockd/lvmlockd-core.c:5803:20: branch_false: following ‘false’ branch...
LVM2.2.03.36/daemons/lvmlockd/lvmlockd-core.c:5807:13: call_function: inlined call to ‘list_empty’ from ‘adopt_locks’
LVM2.2.03.36/daemons/lvmlockd/lvmlockd-core.c:5807:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/daemons/lvmlockd/lvmlockd-core.c:5816:14: branch_false: ...to here
LVM2.2.03.36/daemons/lvmlockd/lvmlockd-core.c:5816:14: call_function: calling ‘read_adopt_file’ from ‘adopt_locks’
#  377|   
#  378|   	if (level <= syslog_priority)
#  379|-> 		syslog(level, "%s", line);
#  380|   
#  381|   	if (daemon_debug)

Error: GCC_ANALYZER_WARNING (CWE-775): [#def65]
LVM2.2.03.36/daemons/lvmlockd/lvmlockd-core.c:4302:23: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘setup_dump_socket()’
LVM2.2.03.36/daemons/lvmlockd/lvmlockd-core.c:5399:14: enter_function: entry to ‘client_thread_main’
LVM2.2.03.36/daemons/lvmlockd/lvmlockd-core.c:5424:30: call_function: inlined call to ‘find_client_id’ from ‘client_thread_main’
LVM2.2.03.36/daemons/lvmlockd/lvmlockd-core.c:5425:25: branch_true: ...to here
LVM2.2.03.36/daemons/lvmlockd/lvmlockd-core.c:5427:28: branch_true: following ‘true’ branch...
LVM2.2.03.36/daemons/lvmlockd/lvmlockd-core.c:5428:33: branch_true: ...to here
LVM2.2.03.36/daemons/lvmlockd/lvmlockd-core.c:5429:38: call_function: calling ‘client_send_result’ from ‘client_thread_main’
# 4300|   			  act->result, dump_len);
# 4301|   
# 4302|-> 		res = daemon_reply_simple("OK",
# 4303|   					  "result = " FMTd64, (int64_t) act->result,
# 4304|   					  "dump_len = " FMTd64, (int64_t) dump_len,

Error: GCC_ANALYZER_WARNING (CWE-775): [#def66]
LVM2.2.03.36/daemons/lvmlockd/lvmlockd-core.c:4392:14: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘dump_fd’
LVM2.2.03.36/daemons/lvmlockd/lvmlockd-core.c:5399:14: enter_function: entry to ‘client_thread_main’
LVM2.2.03.36/daemons/lvmlockd/lvmlockd-core.c:5424:30: call_function: inlined call to ‘find_client_id’ from ‘client_thread_main’
LVM2.2.03.36/daemons/lvmlockd/lvmlockd-core.c:5425:25: branch_true: ...to here
LVM2.2.03.36/daemons/lvmlockd/lvmlockd-core.c:5427:28: branch_true: following ‘true’ branch...
LVM2.2.03.36/daemons/lvmlockd/lvmlockd-core.c:5428:33: branch_true: ...to here
LVM2.2.03.36/daemons/lvmlockd/lvmlockd-core.c:5429:38: call_function: calling ‘client_send_result’ from ‘client_thread_main’
# 4390|   	}
# 4391|   
# 4392|-> 	if (!buffer_write(cl->fd, &res.buffer)) {
# 4393|   		rv = -errno;
# 4394|   		if (rv >= 0)

Error: GCC_ANALYZER_WARNING (CWE-775): [#def67]
LVM2.2.03.36/daemons/lvmlockd/lvmlockd-core.c:4399:9: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘dump_fd’
LVM2.2.03.36/daemons/lvmlockd/lvmlockd-core.c:5399:14: enter_function: entry to ‘client_thread_main’
LVM2.2.03.36/daemons/lvmlockd/lvmlockd-core.c:5424:30: call_function: inlined call to ‘find_client_id’ from ‘client_thread_main’
LVM2.2.03.36/daemons/lvmlockd/lvmlockd-core.c:5425:25: branch_true: ...to here
LVM2.2.03.36/daemons/lvmlockd/lvmlockd-core.c:5427:28: branch_true: following ‘true’ branch...
LVM2.2.03.36/daemons/lvmlockd/lvmlockd-core.c:5428:33: branch_true: ...to here
LVM2.2.03.36/daemons/lvmlockd/lvmlockd-core.c:5429:38: call_function: calling ‘client_send_result’ from ‘client_thread_main’
# 4397|   	}
# 4398|   
# 4399|-> 	buffer_destroy(&res.buffer);
# 4400|   
# 4401|   	client_resume(cl);

Error: GCC_ANALYZER_WARNING (CWE-775): [#def68]
LVM2.2.03.36/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.36/daemons/lvmlockd/lvmlockd-dlm.c:107:14: acquire_resource: opened here
LVM2.2.03.36/daemons/lvmlockd/lvmlockd-dlm.c:108:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/daemons/lvmlockd/lvmlockd-dlm.c:113:14: branch_false: ...to here
LVM2.2.03.36/daemons/lvmlockd/lvmlockd-dlm.c:114:12: branch_true: following ‘true’ branch (when ‘rv < 0’)...
LVM2.2.03.36/daemons/lvmlockd/lvmlockd-dlm.c:115:17: branch_true: ...to here
LVM2.2.03.36/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): [#def69]
LVM2.2.03.36/daemons/lvmlockd/lvmlockd-dlm.c:125:13: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘open("/sys/kernel/config/dlm/cluster/cluster_name", 0)’
LVM2.2.03.36/daemons/lvmlockd/lvmlockd-dlm.c:107:14: acquire_resource: opened here
LVM2.2.03.36/daemons/lvmlockd/lvmlockd-dlm.c:108:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/daemons/lvmlockd/lvmlockd-dlm.c:113:14: branch_false: ...to here
LVM2.2.03.36/daemons/lvmlockd/lvmlockd-dlm.c:114:12: branch_false: following ‘false’ branch (when ‘rv >= 0’)...
LVM2.2.03.36/daemons/lvmlockd/lvmlockd-dlm.c:118:20: branch_false: ...to here
LVM2.2.03.36/daemons/lvmlockd/lvmlockd-dlm.c:121:12: branch_false: following ‘false’ branch (when ‘n’ is NULL)...
 branch_false: ...to here
LVM2.2.03.36/daemons/lvmlockd/lvmlockd-dlm.c:125:13: 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)
#  123|   	rv = 0;
#  124|   out:
#  125|-> 	if (close(fd))
#  126|   		log_error("read_cluster_name: close_error %d", fd);
#  127|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def70]
LVM2.2.03.36/daemons/lvmlockd/lvmlockd-dlm.c:242:22: warning[-Wanalyzer-malloc-leak]: leak of ‘opendir(&ls_comms_path)’
LVM2.2.03.36/daemons/lvmlockd/lvmlockd-dlm.c:239:24: acquire_memory: allocated here
LVM2.2.03.36/daemons/lvmlockd/lvmlockd-dlm.c:239:12: branch_false: following ‘false’ branch...
 branch_false: ...to here
LVM2.2.03.36/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): [#def71]
LVM2.2.03.36/daemons/lvmlockd/lvmlockd-dlm.c:826:22: warning[-Wanalyzer-malloc-leak]: leak of ‘opendir(&ls_nodes_path)’
LVM2.2.03.36/daemons/lvmlockd/lvmlockd-dlm.c:816:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/daemons/lvmlockd/lvmlockd-dlm.c:819:9: branch_false: ...to here
LVM2.2.03.36/daemons/lvmlockd/lvmlockd-dlm.c:823:24: acquire_memory: allocated here
LVM2.2.03.36/daemons/lvmlockd/lvmlockd-dlm.c:823:12: branch_false: following ‘false’ branch...
 branch_false: ...to here
LVM2.2.03.36/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): [#def72]
LVM2.2.03.36/daemons/lvmlockd/lvmlockd-dlm.c:858:22: warning[-Wanalyzer-malloc-leak]: leak of ‘opendir("/sys/kernel/config/dlm/cluster/spaces")’
LVM2.2.03.36/daemons/lvmlockd/lvmlockd-dlm.c:855:24: acquire_memory: allocated here
LVM2.2.03.36/daemons/lvmlockd/lvmlockd-dlm.c:855:12: branch_false: following ‘false’ branch...
 branch_false: ...to here
LVM2.2.03.36/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-121): [#def73]
LVM2.2.03.36/daemons/lvmlockd/lvmlockd-internal.h:265:9: warning[-Wanalyzer-out-of-bounds]: stack-based buffer overflow
LVM2.2.03.36/daemons/lvmlockd/lvmlockd-core.c:5766:13: enter_function: entry to ‘adopt_locks’
LVM2.2.03.36/daemons/lvmlockd/lvmlockd-core.c:5786:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/daemons/lvmlockd/lvmlockd-core.c:5795:33: branch_false: ...to here
LVM2.2.03.36/daemons/lvmlockd/lvmlockd-core.c:5803:20: branch_false: following ‘false’ branch...
LVM2.2.03.36/daemons/lvmlockd/lvmlockd-core.c:5807:13: call_function: inlined call to ‘list_empty’ from ‘adopt_locks’
LVM2.2.03.36/daemons/lvmlockd/lvmlockd-core.c:5807:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/daemons/lvmlockd/lvmlockd-core.c:5816:14: branch_false: ...to here
LVM2.2.03.36/daemons/lvmlockd/lvmlockd-core.c:5816:14: call_function: calling ‘read_adopt_file’ from ‘adopt_locks’
#  263|   	new->next = next;
#  264|   	new->prev = prev;
#  265|-> 	prev->next = new;
#  266|   }
#  267|   

Error: GCC_ANALYZER_WARNING (CWE-126): [#def74]
LVM2.2.03.36/daemons/lvmlockd/lvmlockd-internal.h:276:9: warning[-Wanalyzer-out-of-bounds]: stack-based buffer over-read
LVM2.2.03.36/daemons/lvmlockd/lvmlockd-core.c:5766:13: enter_function: entry to ‘adopt_locks’
LVM2.2.03.36/daemons/lvmlockd/lvmlockd-core.c:5786:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/daemons/lvmlockd/lvmlockd-core.c:5795:33: branch_false: ...to here
LVM2.2.03.36/daemons/lvmlockd/lvmlockd-core.c:5803:20: branch_false: following ‘false’ branch...
LVM2.2.03.36/daemons/lvmlockd/lvmlockd-core.c:5807:13: call_function: inlined call to ‘list_empty’ from ‘adopt_locks’
LVM2.2.03.36/daemons/lvmlockd/lvmlockd-core.c:5807:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/daemons/lvmlockd/lvmlockd-core.c:5816:14: branch_false: ...to here
LVM2.2.03.36/daemons/lvmlockd/lvmlockd-core.c:5816:14: call_function: calling ‘read_adopt_file’ from ‘adopt_locks’
#  274|   static inline void list_add(struct list_head *new, struct list_head *head)
#  275|   {
#  276|-> 	__list_add(new, head, head->next);
#  277|   }
#  278|   

Error: COMPILER_WARNING (CWE-9001): [#def75]
LVM2.2.03.36/daemons/lvmlockd/lvmlockd-internal.h:395:27: warning[-Winline]: inlining failed in call to ‘mode_str’: call is unlikely and code size would grow
#  395 | static inline const char *mode_str(int x)
#      |                           ^~~~~~~~
LVM2.2.03.36/daemons/lvmlockd/lvmlockd-internal.h:384:33: note: called from here
#  384 | #define log_debug(fmt, args...) log_level(LOG_DEBUG, fmt, ##args)
#      |                                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#  393|   int version_from_args(char *args, unsigned int *major, unsigned int *minor, unsigned int *patch);
#  394|   
#  395|-> static inline const char *mode_str(int x)
#  396|   {
#  397|   	switch (x) {

Error: GCC_ANALYZER_WARNING (CWE-775): [#def76]
LVM2.2.03.36/daemons/lvmlockd/lvmlockd-sanlock.c:400:13: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(&path, "w")’
LVM2.2.03.36/daemons/lvmlockd/lvmlockd-sanlock.c:386:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/daemons/lvmlockd/lvmlockd-sanlock.c:389:20: branch_false: ...to here
LVM2.2.03.36/daemons/lvmlockd/lvmlockd-sanlock.c:389:20: acquire_resource: opened here
LVM2.2.03.36/daemons/lvmlockd/lvmlockd-sanlock.c:389:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/daemons/lvmlockd/lvmlockd-sanlock.c:394:9: branch_false: ...to here
LVM2.2.03.36/daemons/lvmlockd/lvmlockd-sanlock.c:400:13: danger: ‘fopen(&path, "w")’ leaks here; was opened at [(3)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/2)
#  398|   	fprintf(fp, "align_size %d\n", lms->align_size);
#  399|   
#  400|-> 	if (fflush(fp))
#  401|   		log_warn("Failed to write/flush %s", path);
#  402|   	_fclose(fp, path);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def77]
LVM2.2.03.36/daemons/lvmlockd/lvmlockd-sanlock.c:400:13: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(&path, "w")’
LVM2.2.03.36/daemons/lvmlockd/lvmlockd-sanlock.c:386:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/daemons/lvmlockd/lvmlockd-sanlock.c:389:20: branch_false: ...to here
LVM2.2.03.36/daemons/lvmlockd/lvmlockd-sanlock.c:389:20: acquire_memory: allocated here
LVM2.2.03.36/daemons/lvmlockd/lvmlockd-sanlock.c:389:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/daemons/lvmlockd/lvmlockd-sanlock.c:394:9: branch_false: ...to here
LVM2.2.03.36/daemons/lvmlockd/lvmlockd-sanlock.c:400:13: danger: ‘fopen(&path, "w")’ leaks here; was allocated at [(3)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/2)
#  398|   	fprintf(fp, "align_size %d\n", lms->align_size);
#  399|   
#  400|-> 	if (fflush(fp))
#  401|   		log_warn("Failed to write/flush %s", path);
#  402|   	_fclose(fp, path);

Error: GCC_ANALYZER_WARNING (CWE-775): [#def78]
LVM2.2.03.36/daemons/lvmlockd/lvmlockd-sanlock.c:401:17: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(&path, "w")’
LVM2.2.03.36/daemons/lvmlockd/lvmlockd-sanlock.c:386:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/daemons/lvmlockd/lvmlockd-sanlock.c:389:20: branch_false: ...to here
LVM2.2.03.36/daemons/lvmlockd/lvmlockd-sanlock.c:389:20: acquire_resource: opened here
LVM2.2.03.36/daemons/lvmlockd/lvmlockd-sanlock.c:389:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/daemons/lvmlockd/lvmlockd-sanlock.c:394:9: branch_false: ...to here
LVM2.2.03.36/daemons/lvmlockd/lvmlockd-sanlock.c:400:12: branch_true: following ‘true’ branch...
LVM2.2.03.36/daemons/lvmlockd/lvmlockd-sanlock.c:401:17: branch_true: ...to here
LVM2.2.03.36/daemons/lvmlockd/lvmlockd-sanlock.c:401:17: danger: ‘fopen(&path, "w")’ leaks here; was opened at [(3)](sarif:/runs/0/results/2/codeFlows/0/threadFlows/0/locations/2)
#  399|   
#  400|   	if (fflush(fp))
#  401|-> 		log_warn("Failed to write/flush %s", path);
#  402|   	_fclose(fp, path);
#  403|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def79]
LVM2.2.03.36/daemons/lvmlockd/lvmlockd-sanlock.c:401:17: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(&path, "w")’
LVM2.2.03.36/daemons/lvmlockd/lvmlockd-sanlock.c:386:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/daemons/lvmlockd/lvmlockd-sanlock.c:389:20: branch_false: ...to here
LVM2.2.03.36/daemons/lvmlockd/lvmlockd-sanlock.c:389:20: acquire_memory: allocated here
LVM2.2.03.36/daemons/lvmlockd/lvmlockd-sanlock.c:389:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/daemons/lvmlockd/lvmlockd-sanlock.c:394:9: branch_false: ...to here
LVM2.2.03.36/daemons/lvmlockd/lvmlockd-sanlock.c:400:12: branch_true: following ‘true’ branch...
LVM2.2.03.36/daemons/lvmlockd/lvmlockd-sanlock.c:401:17: branch_true: ...to here
LVM2.2.03.36/daemons/lvmlockd/lvmlockd-sanlock.c:401:17: danger: ‘fopen(&path, "w")’ leaks here; was allocated at [(3)](sarif:/runs/0/results/3/codeFlows/0/threadFlows/0/locations/2)
#  399|   
#  400|   	if (fflush(fp))
#  401|-> 		log_warn("Failed to write/flush %s", path);
#  402|   	_fclose(fp, path);
#  403|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def80]
LVM2.2.03.36/daemons/lvmlockd/lvmlockd-sanlock.c:1297:14: warning[-Wanalyzer-malloc-leak]: leak of ‘rs_args’
LVM2.2.03.36/daemons/lvmlockd/lvmlockd-sanlock.c:1271:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/daemons/lvmlockd/lvmlockd-sanlock.c:1274:19: branch_false: ...to here
LVM2.2.03.36/daemons/lvmlockd/lvmlockd-sanlock.c:1274:19: acquire_memory: allocated here
LVM2.2.03.36/daemons/lvmlockd/lvmlockd-sanlock.c:1275:12: branch_false: following ‘false’ branch (when ‘rs_args’ is non-NULL)...
LVM2.2.03.36/daemons/lvmlockd/lvmlockd-sanlock.c:1278:9: branch_false: ...to here
LVM2.2.03.36/daemons/lvmlockd/lvmlockd-sanlock.c:1297:14: danger: ‘rs_args’ leaks here; was allocated at [(3)](sarif:/runs/0/results/4/codeFlows/0/threadFlows/0/locations/2)
# 1295|   	rd2.rs.flags = lms->rs_flags;
# 1296|   
# 1297|-> 	rv = sanlock_acquire(lms->sock, -1, 0, 1, &rs1, NULL);
# 1298|   	if (rv < 0) {
# 1299|   		log_error("S %s ex_disable_gl_san acquire error %d",

Error: GCC_ANALYZER_WARNING (CWE-401): [#def81]
LVM2.2.03.36/daemons/lvmlockd/lvmlockd-sanlock.c:1299:17: warning[-Wanalyzer-malloc-leak]: leak of ‘rs_args’
LVM2.2.03.36/daemons/lvmlockd/lvmlockd-sanlock.c:1271:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/daemons/lvmlockd/lvmlockd-sanlock.c:1274:19: branch_false: ...to here
LVM2.2.03.36/daemons/lvmlockd/lvmlockd-sanlock.c:1274:19: acquire_memory: allocated here
LVM2.2.03.36/daemons/lvmlockd/lvmlockd-sanlock.c:1275:12: branch_false: following ‘false’ branch (when ‘rs_args’ is non-NULL)...
LVM2.2.03.36/daemons/lvmlockd/lvmlockd-sanlock.c:1278:9: branch_false: ...to here
LVM2.2.03.36/daemons/lvmlockd/lvmlockd-sanlock.c:1298:12: branch_true: following ‘true’ branch...
LVM2.2.03.36/daemons/lvmlockd/lvmlockd-sanlock.c:1299:17: branch_true: ...to here
LVM2.2.03.36/daemons/lvmlockd/lvmlockd-sanlock.c:1299:17: danger: ‘rs_args’ leaks here; was allocated at [(3)](sarif:/runs/0/results/5/codeFlows/0/threadFlows/0/locations/2)
# 1297|   	rv = sanlock_acquire(lms->sock, -1, 0, 1, &rs1, NULL);
# 1298|   	if (rv < 0) {
# 1299|-> 		log_error("S %s ex_disable_gl_san acquire error %d",
# 1300|   			  ls->name, rv);
# 1301|   		goto out;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def82]
LVM2.2.03.36/daemons/lvmlockd/lvmlockd-sanlock.c:1307:14: warning[-Wanalyzer-malloc-leak]: leak of ‘rs_args’
LVM2.2.03.36/daemons/lvmlockd/lvmlockd-sanlock.c:1271:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/daemons/lvmlockd/lvmlockd-sanlock.c:1274:19: branch_false: ...to here
LVM2.2.03.36/daemons/lvmlockd/lvmlockd-sanlock.c:1274:19: acquire_memory: allocated here
LVM2.2.03.36/daemons/lvmlockd/lvmlockd-sanlock.c:1275:12: branch_false: following ‘false’ branch (when ‘rs_args’ is non-NULL)...
LVM2.2.03.36/daemons/lvmlockd/lvmlockd-sanlock.c:1278:9: branch_false: ...to here
LVM2.2.03.36/daemons/lvmlockd/lvmlockd-sanlock.c:1298:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/daemons/lvmlockd/lvmlockd-sanlock.c:1304:9: branch_false: ...to here
LVM2.2.03.36/daemons/lvmlockd/lvmlockd-sanlock.c:1307:14: danger: ‘rs_args’ leaks here; was allocated at [(3)](sarif:/runs/0/results/6/codeFlows/0/threadFlows/0/locations/2)
# 1305|   	rs_args[1] = rs2;
# 1306|   
# 1307|-> 	rv = sanlock_release(lms->sock, -1, SANLK_REL_RENAME, 2, rs_args);
# 1308|   	if (rv < 0) {
# 1309|   		log_error("S %s ex_disable_gl_san release_rename error %d",

Error: GCC_ANALYZER_WARNING (CWE-401): [#def83]
LVM2.2.03.36/daemons/lvmlockd/lvmlockd-sanlock.c:2461:17: warning[-Wanalyzer-malloc-leak]: leak of ‘res_args’
LVM2.2.03.36/daemons/lvmlockd/lvmlockd-sanlock.c:2450:20: acquire_memory: allocated here
LVM2.2.03.36/daemons/lvmlockd/lvmlockd-sanlock.c:2451:12: branch_false: following ‘false’ branch (when ‘res_args’ is non-NULL)...
LVM2.2.03.36/daemons/lvmlockd/lvmlockd-sanlock.c:2454:9: branch_false: ...to here
LVM2.2.03.36/daemons/lvmlockd/lvmlockd-sanlock.c:2460:12: branch_true: following ‘true’ branch...
LVM2.2.03.36/daemons/lvmlockd/lvmlockd-sanlock.c:2461:17: branch_true: ...to here
LVM2.2.03.36/daemons/lvmlockd/lvmlockd-sanlock.c:2461:17: danger: ‘res_args’ leaks here; was allocated at [(1)](sarif:/runs/0/results/7/codeFlows/0/threadFlows/0/locations/0)
# 2459|   
# 2460|   	if (memcmp(res1->name, r->name, SANLK_NAME_LEN))
# 2461|-> 		log_error("%s:%s unlock_san release rename bad name %.48s", ls->name, r->name, res1->name);
# 2462|   
# 2463|   	strcpy_name_len(res2->name, "invalid_removed", SANLK_NAME_LEN);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def84]
LVM2.2.03.36/daemons/lvmlockd/lvmlockd-sanlock.c:2468:14: warning[-Wanalyzer-malloc-leak]: leak of ‘res_args’
LVM2.2.03.36/daemons/lvmlockd/lvmlockd-sanlock.c:2450:20: acquire_memory: allocated here
LVM2.2.03.36/daemons/lvmlockd/lvmlockd-sanlock.c:2451:12: branch_false: following ‘false’ branch (when ‘res_args’ is non-NULL)...
LVM2.2.03.36/daemons/lvmlockd/lvmlockd-sanlock.c:2454:9: branch_false: ...to here
LVM2.2.03.36/daemons/lvmlockd/lvmlockd-sanlock.c:2468:14: danger: ‘res_args’ leaks here; was allocated at [(1)](sarif:/runs/0/results/8/codeFlows/0/threadFlows/0/locations/0)
# 2466|   	res_args[1] = res2;
# 2467|   
# 2468|-> 	rv = sanlock_release(lms->sock, -1, SANLK_REL_RENAME, 2, res_args);
# 2469|   	if (rv < 0) {
# 2470|   		log_error("%s:%s unlock_san release rename error %d", ls->name, r->name, rv);

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

Error: GCC_ANALYZER_WARNING (CWE-775): [#def86]
LVM2.2.03.36/daemons/lvmpolld/lvmpolld-core.c:414:20: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘dup2(outfd, 1)’
LVM2.2.03.36/daemons/lvmpolld/lvmpolld-core.c:388:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/daemons/lvmpolld/lvmpolld-core.c:393:14: branch_false: ...to here
LVM2.2.03.36/daemons/lvmpolld/lvmpolld-core.c:393:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/daemons/lvmpolld/lvmpolld-core.c:410:12: branch_true: following ‘true’ branch (when ‘r == 0’)...
LVM2.2.03.36/daemons/lvmpolld/lvmpolld-core.c:414:22: branch_true: ...to here
LVM2.2.03.36/daemons/lvmpolld/lvmpolld-core.c:414:22: acquire_resource: opened here
LVM2.2.03.36/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): [#def87]
LVM2.2.03.36/daemons/lvmpolld/lvmpolld-core.c:414:21: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘dup2(errfd, 2)’
LVM2.2.03.36/daemons/lvmpolld/lvmpolld-core.c:388:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/daemons/lvmpolld/lvmpolld-core.c:393:14: branch_false: ...to here
LVM2.2.03.36/daemons/lvmpolld/lvmpolld-core.c:393:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/daemons/lvmpolld/lvmpolld-core.c:410:12: branch_true: following ‘true’ branch (when ‘r == 0’)...
LVM2.2.03.36/daemons/lvmpolld/lvmpolld-core.c:414:22: branch_true: ...to here
LVM2.2.03.36/daemons/lvmpolld/lvmpolld-core.c:414:20: branch_false: following ‘false’ branch...
LVM2.2.03.36/daemons/lvmpolld/lvmpolld-core.c:415:22: branch_false: ...to here
LVM2.2.03.36/daemons/lvmpolld/lvmpolld-core.c:415:22: acquire_resource: opened here
LVM2.2.03.36/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): [#def88]
LVM2.2.03.36/daemons/lvmpolld/lvmpolld-data-utils.c:34:13: warning[-Wanalyzer-malloc-leak]: leak of ‘name’
LVM2.2.03.36/daemons/lvmpolld/lvmpolld-data-utils.c:30:25: acquire_memory: allocated here
LVM2.2.03.36/daemons/lvmpolld/lvmpolld-data-utils.c:31:12: branch_false: following ‘false’ branch (when ‘name’ is non-NULL)...
LVM2.2.03.36/daemons/lvmpolld/lvmpolld-data-utils.c:34:13: branch_false: ...to here
LVM2.2.03.36/daemons/lvmpolld/lvmpolld-data-utils.c:34:13: danger: ‘name’ leaks here; was allocated at [(1)](sarif:/runs/0/results/2/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): [#def89]
LVM2.2.03.36/daemons/lvmpolld/lvmpolld-data-utils.c:34:13: warning[-Wanalyzer-malloc-leak]: leak of ‘tmp.devicesfile’
LVM2.2.03.36/daemons/lvmpolld/lvmpolld-data-utils.c:103:21: enter_function: entry to ‘pdlv_create’
LVM2.2.03.36/daemons/lvmpolld/lvmpolld-data-utils.c:115:32: branch_true: following ‘true’ branch (when ‘devicesfile’ is non-NULL)...
LVM2.2.03.36/daemons/lvmpolld/lvmpolld-data-utils.c:115:46: branch_true: ...to here
LVM2.2.03.36/daemons/lvmpolld/lvmpolld-data-utils.c:115:46: acquire_memory: allocated here
LVM2.2.03.36/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): [#def90]
LVM2.2.03.36/daemons/lvmpolld/lvmpolld-data-utils.c:34:13: warning[-Wanalyzer-malloc-leak]: leak of ‘tmp.lvmpolld_id’
LVM2.2.03.36/daemons/lvmpolld/lvmpolld-data-utils.c:103:21: enter_function: entry to ‘pdlv_create’
LVM2.2.03.36/daemons/lvmpolld/lvmpolld-data-utils.c:113:32: acquire_memory: allocated here
LVM2.2.03.36/daemons/lvmpolld/lvmpolld-data-utils.c:115:32: branch_false: following ‘false’ branch (when ‘devicesfile’ is NULL)...
LVM2.2.03.36/daemons/lvmpolld/lvmpolld-data-utils.c:110:28: branch_false: ...to here
LVM2.2.03.36/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): [#def91]
LVM2.2.03.36/daemons/lvmpolld/lvmpolld-data-utils.c:57:23: warning[-Wanalyzer-malloc-leak]: leak of ‘env’
LVM2.2.03.36/daemons/lvmpolld/lvmpolld-data-utils.c:50:30: acquire_memory: allocated here
LVM2.2.03.36/daemons/lvmpolld/lvmpolld-data-utils.c:52:12: branch_false: following ‘false’ branch (when ‘env’ is non-NULL)...
LVM2.2.03.36/daemons/lvmpolld/lvmpolld-data-utils.c:55:9: branch_false: ...to here
LVM2.2.03.36/daemons/lvmpolld/lvmpolld-data-utils.c:57:12: branch_true: following ‘true’ branch (when ‘sysdir’ is non-NULL)...
LVM2.2.03.36/daemons/lvmpolld/lvmpolld-data-utils.c:57:23: branch_true: ...to here
LVM2.2.03.36/daemons/lvmpolld/lvmpolld-data-utils.c:57:23: danger: ‘env’ leaks here; was allocated at [(1)](sarif:/runs/0/results/5/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): [#def92]
LVM2.2.03.36/daemons/lvmpolld/lvmpolld-data-utils.c:57:23: warning[-Wanalyzer-malloc-leak]: leak of ‘tmp.devicesfile’
LVM2.2.03.36/daemons/lvmpolld/lvmpolld-data-utils.c:103:21: enter_function: entry to ‘pdlv_create’
LVM2.2.03.36/daemons/lvmpolld/lvmpolld-data-utils.c:115:32: branch_true: following ‘true’ branch (when ‘devicesfile’ is non-NULL)...
LVM2.2.03.36/daemons/lvmpolld/lvmpolld-data-utils.c:115:46: branch_true: ...to here
LVM2.2.03.36/daemons/lvmpolld/lvmpolld-data-utils.c:115:46: acquire_memory: allocated here
LVM2.2.03.36/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): [#def93]
LVM2.2.03.36/daemons/lvmpolld/lvmpolld-data-utils.c:57:23: warning[-Wanalyzer-malloc-leak]: leak of ‘tmp.lvmpolld_id’
LVM2.2.03.36/daemons/lvmpolld/lvmpolld-data-utils.c:103:21: enter_function: entry to ‘pdlv_create’
LVM2.2.03.36/daemons/lvmpolld/lvmpolld-data-utils.c:113:32: acquire_memory: allocated here
LVM2.2.03.36/daemons/lvmpolld/lvmpolld-data-utils.c:115:32: branch_false: following ‘false’ branch (when ‘devicesfile’ is NULL)...
LVM2.2.03.36/daemons/lvmpolld/lvmpolld-data-utils.c:110:28: branch_false: ...to here
LVM2.2.03.36/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): [#def94]
LVM2.2.03.36/daemons/lvmpolld/lvmpolld-data-utils.c:57:23: warning[-Wanalyzer-malloc-leak]: leak of ‘tmp.sinterval’
LVM2.2.03.36/daemons/lvmpolld/lvmpolld-data-utils.c:103:21: enter_function: entry to ‘pdlv_create’
LVM2.2.03.36/daemons/lvmpolld/lvmpolld-data-utils.c:115:32: branch_false: following ‘false’ branch (when ‘devicesfile’ is NULL)...
LVM2.2.03.36/daemons/lvmpolld/lvmpolld-data-utils.c:110:28: branch_false: ...to here
LVM2.2.03.36/daemons/lvmpolld/lvmpolld-data-utils.c:114:27: call_function: calling ‘_construct_full_lvname’ from ‘pdlv_create’
LVM2.2.03.36/daemons/lvmpolld/lvmpolld-data-utils.c:114:27: return_function: returning to ‘pdlv_create’ from ‘_construct_full_lvname’
LVM2.2.03.36/daemons/lvmpolld/lvmpolld-data-utils.c:117:30: acquire_memory: allocated here
LVM2.2.03.36/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): [#def95]
LVM2.2.03.36/daemons/lvmpolld/lvmpolld-data-utils.c:81:22: warning[-Wanalyzer-malloc-leak]: leak of ‘id’
LVM2.2.03.36/daemons/lvmpolld/lvmpolld-data-utils.c:77:23: acquire_memory: allocated here
LVM2.2.03.36/daemons/lvmpolld/lvmpolld-data-utils.c:78:12: branch_false: following ‘false’ branch (when ‘id’ is non-NULL)...
LVM2.2.03.36/daemons/lvmpolld/lvmpolld-data-utils.c:81:13: branch_false: ...to here
LVM2.2.03.36/daemons/lvmpolld/lvmpolld-data-utils.c:81:13: branch_true: following ‘true’ branch (when ‘sysdir’ is non-NULL)...
LVM2.2.03.36/daemons/lvmpolld/lvmpolld-data-utils.c:81:22: branch_true: ...to here
LVM2.2.03.36/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): [#def96]
LVM2.2.03.36/daemons/lvmpolld/lvmpolld-data-utils.c:82:22: warning[-Wanalyzer-malloc-leak]: leak of ‘id’
LVM2.2.03.36/daemons/lvmpolld/lvmpolld-data-utils.c:77:23: acquire_memory: allocated here
LVM2.2.03.36/daemons/lvmpolld/lvmpolld-data-utils.c:78:12: branch_false: following ‘false’ branch (when ‘id’ is non-NULL)...
LVM2.2.03.36/daemons/lvmpolld/lvmpolld-data-utils.c:81:13: branch_false: ...to here
LVM2.2.03.36/daemons/lvmpolld/lvmpolld-data-utils.c:81:13: branch_false: following ‘false’ branch (when ‘sysdir’ is NULL)...
LVM2.2.03.36/daemons/lvmpolld/lvmpolld-data-utils.c:82:22: branch_false: ...to here
LVM2.2.03.36/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): [#def97]
LVM2.2.03.36/daemons/lvmpolld/lvmpolld-data-utils.c:204:23: warning[-Wanalyzer-malloc-leak]: leak of ‘pdst’
LVM2.2.03.36/daemons/lvmpolld/lvmpolld-data-utils.c:200:65: acquire_memory: allocated here
LVM2.2.03.36/daemons/lvmpolld/lvmpolld-data-utils.c:201:12: branch_false: following ‘false’ branch (when ‘pdst’ is non-NULL)...
LVM2.2.03.36/daemons/lvmpolld/lvmpolld-data-utils.c:204:23: branch_false: ...to here
LVM2.2.03.36/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): [#def98]
LVM2.2.03.36/daemons/lvmpolld/lvmpolld-data-utils.c:342:13: warning[-Wanalyzer-fd-leak]: leak of file descriptor
LVM2.2.03.36/daemons/lvmpolld/lvmpolld-data-utils.c:328:12: branch_false: following ‘false’ branch (when ‘data’ is non-NULL)...
LVM2.2.03.36/daemons/lvmpolld/lvmpolld-data-utils.c:331:9: branch_false: ...to here
LVM2.2.03.36/daemons/lvmpolld/lvmpolld-data-utils.c:337:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/daemons/lvmpolld/lvmpolld-data-utils.c:337:41: branch_false: ...to here
LVM2.2.03.36/daemons/lvmpolld/lvmpolld-data-utils.c:337:13: branch_false: following ‘false’ branch...
LVM2.2.03.36/daemons/lvmpolld/lvmpolld-data-utils.c:342:13: branch_false: ...to here
LVM2.2.03.36/daemons/lvmpolld/lvmpolld-data-utils.c:342:13: danger: leaks here
#  340|   	}
#  341|   
#  342|-> 	if (fcntl(data->outpipe[0], F_SETFD, FD_CLOEXEC) ||
#  343|   	    fcntl(data->outpipe[1], F_SETFD, FD_CLOEXEC) ||
#  344|   	    fcntl(data->errpipe[0], F_SETFD, FD_CLOEXEC) ||

Error: GCC_ANALYZER_WARNING (CWE-401): [#def99]
LVM2.2.03.36/daemons/lvmpolld/lvmpolld-data-utils.c:342:13: warning[-Wanalyzer-malloc-leak]: leak of ‘data’
LVM2.2.03.36/daemons/lvmpolld/lvmpolld-data-utils.c:327:77: acquire_memory: allocated here
LVM2.2.03.36/daemons/lvmpolld/lvmpolld-data-utils.c:328:12: branch_false: following ‘false’ branch (when ‘data’ is non-NULL)...
LVM2.2.03.36/daemons/lvmpolld/lvmpolld-data-utils.c:331:9: branch_false: ...to here
LVM2.2.03.36/daemons/lvmpolld/lvmpolld-data-utils.c:337:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/daemons/lvmpolld/lvmpolld-data-utils.c:337:41: branch_false: ...to here
LVM2.2.03.36/daemons/lvmpolld/lvmpolld-data-utils.c:337:13: branch_false: following ‘false’ branch...
LVM2.2.03.36/daemons/lvmpolld/lvmpolld-data-utils.c:342:13: branch_false: ...to here
LVM2.2.03.36/daemons/lvmpolld/lvmpolld-data-utils.c:342:13: danger: ‘data’ leaks here; was allocated at [(1)](sarif:/runs/0/results/11/codeFlows/0/threadFlows/0/locations/0)
#  340|   	}
#  341|   
#  342|-> 	if (fcntl(data->outpipe[0], F_SETFD, FD_CLOEXEC) ||
#  343|   	    fcntl(data->outpipe[1], F_SETFD, FD_CLOEXEC) ||
#  344|   	    fcntl(data->errpipe[0], F_SETFD, FD_CLOEXEC) ||

Error: GCC_ANALYZER_WARNING (CWE-775): [#def100]
LVM2.2.03.36/daemons/lvmpolld/lvmpolld-data-utils.c:343:13: warning[-Wanalyzer-fd-leak]: leak of file descriptor
LVM2.2.03.36/daemons/lvmpolld/lvmpolld-data-utils.c:328:12: branch_false: following ‘false’ branch (when ‘data’ is non-NULL)...
LVM2.2.03.36/daemons/lvmpolld/lvmpolld-data-utils.c:331:9: branch_false: ...to here
LVM2.2.03.36/daemons/lvmpolld/lvmpolld-data-utils.c:337:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/daemons/lvmpolld/lvmpolld-data-utils.c:337:41: branch_false: ...to here
LVM2.2.03.36/daemons/lvmpolld/lvmpolld-data-utils.c:337:13: branch_false: following ‘false’ branch...
LVM2.2.03.36/daemons/lvmpolld/lvmpolld-data-utils.c:342:13: branch_false: ...to here
LVM2.2.03.36/daemons/lvmpolld/lvmpolld-data-utils.c:342:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/daemons/lvmpolld/lvmpolld-data-utils.c:343:13: branch_false: ...to here
LVM2.2.03.36/daemons/lvmpolld/lvmpolld-data-utils.c:343:13: danger: leaks here
#  341|   
#  342|   	if (fcntl(data->outpipe[0], F_SETFD, FD_CLOEXEC) ||
#  343|-> 	    fcntl(data->outpipe[1], F_SETFD, FD_CLOEXEC) ||
#  344|   	    fcntl(data->errpipe[0], F_SETFD, FD_CLOEXEC) ||
#  345|   	    fcntl(data->errpipe[1], F_SETFD, FD_CLOEXEC)) {

Error: GCC_ANALYZER_WARNING (CWE-401): [#def101]
LVM2.2.03.36/daemons/lvmpolld/lvmpolld-data-utils.c:343:13: warning[-Wanalyzer-malloc-leak]: leak of ‘data’
LVM2.2.03.36/daemons/lvmpolld/lvmpolld-data-utils.c:327:77: acquire_memory: allocated here
LVM2.2.03.36/daemons/lvmpolld/lvmpolld-data-utils.c:328:12: branch_false: following ‘false’ branch (when ‘data’ is non-NULL)...
LVM2.2.03.36/daemons/lvmpolld/lvmpolld-data-utils.c:331:9: branch_false: ...to here
LVM2.2.03.36/daemons/lvmpolld/lvmpolld-data-utils.c:337:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/daemons/lvmpolld/lvmpolld-data-utils.c:337:41: branch_false: ...to here
LVM2.2.03.36/daemons/lvmpolld/lvmpolld-data-utils.c:337:13: branch_false: following ‘false’ branch...
LVM2.2.03.36/daemons/lvmpolld/lvmpolld-data-utils.c:342:13: branch_false: ...to here
LVM2.2.03.36/daemons/lvmpolld/lvmpolld-data-utils.c:342:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/daemons/lvmpolld/lvmpolld-data-utils.c:343:13: branch_false: ...to here
LVM2.2.03.36/daemons/lvmpolld/lvmpolld-data-utils.c:343:13: danger: ‘data’ leaks here; was allocated at [(1)](sarif:/runs/0/results/13/codeFlows/0/threadFlows/0/locations/0)
#  341|   
#  342|   	if (fcntl(data->outpipe[0], F_SETFD, FD_CLOEXEC) ||
#  343|-> 	    fcntl(data->outpipe[1], F_SETFD, FD_CLOEXEC) ||
#  344|   	    fcntl(data->errpipe[0], F_SETFD, FD_CLOEXEC) ||
#  345|   	    fcntl(data->errpipe[1], F_SETFD, FD_CLOEXEC)) {

Error: GCC_ANALYZER_WARNING (CWE-775): [#def102]
LVM2.2.03.36/daemons/lvmpolld/lvmpolld-data-utils.c:344:13: warning[-Wanalyzer-fd-leak]: leak of file descriptor
LVM2.2.03.36/daemons/lvmpolld/lvmpolld-data-utils.c:328:12: branch_false: following ‘false’ branch (when ‘data’ is non-NULL)...
LVM2.2.03.36/daemons/lvmpolld/lvmpolld-data-utils.c:331:9: branch_false: ...to here
LVM2.2.03.36/daemons/lvmpolld/lvmpolld-data-utils.c:337:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/daemons/lvmpolld/lvmpolld-data-utils.c:337:41: branch_false: ...to here
LVM2.2.03.36/daemons/lvmpolld/lvmpolld-data-utils.c:337:13: branch_false: following ‘false’ branch...
LVM2.2.03.36/daemons/lvmpolld/lvmpolld-data-utils.c:342:13: branch_false: ...to here
LVM2.2.03.36/daemons/lvmpolld/lvmpolld-data-utils.c:342:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/daemons/lvmpolld/lvmpolld-data-utils.c:343:13: branch_false: ...to here
LVM2.2.03.36/daemons/lvmpolld/lvmpolld-data-utils.c:342:13: branch_false: following ‘false’ branch...
LVM2.2.03.36/daemons/lvmpolld/lvmpolld-data-utils.c:344:13: branch_false: ...to here
LVM2.2.03.36/daemons/lvmpolld/lvmpolld-data-utils.c:344:13: danger: leaks here
#  342|   	if (fcntl(data->outpipe[0], F_SETFD, FD_CLOEXEC) ||
#  343|   	    fcntl(data->outpipe[1], F_SETFD, FD_CLOEXEC) ||
#  344|-> 	    fcntl(data->errpipe[0], F_SETFD, FD_CLOEXEC) ||
#  345|   	    fcntl(data->errpipe[1], F_SETFD, FD_CLOEXEC)) {
#  346|   		lvmpolld_thread_data_destroy(data);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def103]
LVM2.2.03.36/daemons/lvmpolld/lvmpolld-data-utils.c:344:13: warning[-Wanalyzer-malloc-leak]: leak of ‘data’
LVM2.2.03.36/daemons/lvmpolld/lvmpolld-data-utils.c:327:77: acquire_memory: allocated here
LVM2.2.03.36/daemons/lvmpolld/lvmpolld-data-utils.c:328:12: branch_false: following ‘false’ branch (when ‘data’ is non-NULL)...
LVM2.2.03.36/daemons/lvmpolld/lvmpolld-data-utils.c:331:9: branch_false: ...to here
LVM2.2.03.36/daemons/lvmpolld/lvmpolld-data-utils.c:337:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/daemons/lvmpolld/lvmpolld-data-utils.c:337:41: branch_false: ...to here
LVM2.2.03.36/daemons/lvmpolld/lvmpolld-data-utils.c:337:13: branch_false: following ‘false’ branch...
LVM2.2.03.36/daemons/lvmpolld/lvmpolld-data-utils.c:342:13: branch_false: ...to here
LVM2.2.03.36/daemons/lvmpolld/lvmpolld-data-utils.c:342:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/daemons/lvmpolld/lvmpolld-data-utils.c:343:13: branch_false: ...to here
LVM2.2.03.36/daemons/lvmpolld/lvmpolld-data-utils.c:342:13: branch_false: following ‘false’ branch...
LVM2.2.03.36/daemons/lvmpolld/lvmpolld-data-utils.c:344:13: branch_false: ...to here
LVM2.2.03.36/daemons/lvmpolld/lvmpolld-data-utils.c:344:13: danger: ‘data’ leaks here; was allocated at [(1)](sarif:/runs/0/results/15/codeFlows/0/threadFlows/0/locations/0)
#  342|   	if (fcntl(data->outpipe[0], F_SETFD, FD_CLOEXEC) ||
#  343|   	    fcntl(data->outpipe[1], F_SETFD, FD_CLOEXEC) ||
#  344|-> 	    fcntl(data->errpipe[0], F_SETFD, FD_CLOEXEC) ||
#  345|   	    fcntl(data->errpipe[1], F_SETFD, FD_CLOEXEC)) {
#  346|   		lvmpolld_thread_data_destroy(data);

Error: GCC_ANALYZER_WARNING (CWE-775): [#def104]
LVM2.2.03.36/daemons/lvmpolld/lvmpolld-data-utils.c:345:13: warning[-Wanalyzer-fd-leak]: leak of file descriptor
LVM2.2.03.36/daemons/lvmpolld/lvmpolld-data-utils.c:328:12: branch_false: following ‘false’ branch (when ‘data’ is non-NULL)...
LVM2.2.03.36/daemons/lvmpolld/lvmpolld-data-utils.c:331:9: branch_false: ...to here
LVM2.2.03.36/daemons/lvmpolld/lvmpolld-data-utils.c:337:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/daemons/lvmpolld/lvmpolld-data-utils.c:337:41: branch_false: ...to here
LVM2.2.03.36/daemons/lvmpolld/lvmpolld-data-utils.c:337:13: branch_false: following ‘false’ branch...
LVM2.2.03.36/daemons/lvmpolld/lvmpolld-data-utils.c:342:13: branch_false: ...to here
LVM2.2.03.36/daemons/lvmpolld/lvmpolld-data-utils.c:342:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/daemons/lvmpolld/lvmpolld-data-utils.c:343:13: branch_false: ...to here
LVM2.2.03.36/daemons/lvmpolld/lvmpolld-data-utils.c:342:13: branch_false: following ‘false’ branch...
LVM2.2.03.36/daemons/lvmpolld/lvmpolld-data-utils.c:344:13: branch_false: ...to here
LVM2.2.03.36/daemons/lvmpolld/lvmpolld-data-utils.c:342:13: branch_false: following ‘false’ branch...
LVM2.2.03.36/daemons/lvmpolld/lvmpolld-data-utils.c:345:13: branch_false: ...to here
LVM2.2.03.36/daemons/lvmpolld/lvmpolld-data-utils.c:345:13: danger: leaks here
#  343|   	    fcntl(data->outpipe[1], F_SETFD, FD_CLOEXEC) ||
#  344|   	    fcntl(data->errpipe[0], F_SETFD, FD_CLOEXEC) ||
#  345|-> 	    fcntl(data->errpipe[1], F_SETFD, FD_CLOEXEC)) {
#  346|   		lvmpolld_thread_data_destroy(data);
#  347|   		return NULL;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def105]
LVM2.2.03.36/daemons/lvmpolld/lvmpolld-data-utils.c:345:13: warning[-Wanalyzer-malloc-leak]: leak of ‘data’
LVM2.2.03.36/daemons/lvmpolld/lvmpolld-data-utils.c:327:77: acquire_memory: allocated here
LVM2.2.03.36/daemons/lvmpolld/lvmpolld-data-utils.c:328:12: branch_false: following ‘false’ branch (when ‘data’ is non-NULL)...
LVM2.2.03.36/daemons/lvmpolld/lvmpolld-data-utils.c:331:9: branch_false: ...to here
LVM2.2.03.36/daemons/lvmpolld/lvmpolld-data-utils.c:337:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/daemons/lvmpolld/lvmpolld-data-utils.c:337:41: branch_false: ...to here
LVM2.2.03.36/daemons/lvmpolld/lvmpolld-data-utils.c:337:13: branch_false: following ‘false’ branch...
LVM2.2.03.36/daemons/lvmpolld/lvmpolld-data-utils.c:342:13: branch_false: ...to here
LVM2.2.03.36/daemons/lvmpolld/lvmpolld-data-utils.c:342:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/daemons/lvmpolld/lvmpolld-data-utils.c:343:13: branch_false: ...to here
LVM2.2.03.36/daemons/lvmpolld/lvmpolld-data-utils.c:342:13: branch_false: following ‘false’ branch...
LVM2.2.03.36/daemons/lvmpolld/lvmpolld-data-utils.c:344:13: branch_false: ...to here
LVM2.2.03.36/daemons/lvmpolld/lvmpolld-data-utils.c:342:13: branch_false: following ‘false’ branch...
LVM2.2.03.36/daemons/lvmpolld/lvmpolld-data-utils.c:345:13: branch_false: ...to here
LVM2.2.03.36/daemons/lvmpolld/lvmpolld-data-utils.c:345:13: danger: ‘data’ leaks here; was allocated at [(1)](sarif:/runs/0/results/17/codeFlows/0/threadFlows/0/locations/0)
#  343|   	    fcntl(data->outpipe[1], F_SETFD, FD_CLOEXEC) ||
#  344|   	    fcntl(data->errpipe[0], F_SETFD, FD_CLOEXEC) ||
#  345|-> 	    fcntl(data->errpipe[1], F_SETFD, FD_CLOEXEC)) {
#  346|   		lvmpolld_thread_data_destroy(data);
#  347|   		return NULL;

Error: GCC_ANALYZER_WARNING (CWE-775): [#def106]
LVM2.2.03.36/daemons/lvmpolld/lvmpolld-data-utils.c:384:24: warning[-Wanalyzer-fd-leak]: leak of file descriptor
LVM2.2.03.36/daemons/lvmpolld/lvmpolld-data-utils.c:325:30: enter_function: entry to ‘lvmpolld_thread_data_constructor’
LVM2.2.03.36/daemons/lvmpolld/lvmpolld-data-utils.c:328:12: branch_false: following ‘false’ branch (when ‘data’ is non-NULL)...
LVM2.2.03.36/daemons/lvmpolld/lvmpolld-data-utils.c:331:9: branch_false: ...to here
LVM2.2.03.36/daemons/lvmpolld/lvmpolld-data-utils.c:337:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/daemons/lvmpolld/lvmpolld-data-utils.c:337:41: branch_false: ...to here
LVM2.2.03.36/daemons/lvmpolld/lvmpolld-data-utils.c:337:13: branch_true: following ‘true’ branch...
LVM2.2.03.36/daemons/lvmpolld/lvmpolld-data-utils.c:338:17: branch_true: ...to here
LVM2.2.03.36/daemons/lvmpolld/lvmpolld-data-utils.c:338:17: call_function: calling ‘lvmpolld_thread_data_destroy’ from ‘lvmpolld_thread_data_constructor’
#  382|   
#  383|   	if (data->outpipe[0] >= 0)
#  384|-> 		(void) close(data->outpipe[0]);
#  385|   
#  386|   	if (data->outpipe[1] >= 0)

Error: GCC_ANALYZER_WARNING (CWE-401): [#def107]
LVM2.2.03.36/daemons/lvmpolld/lvmpolld-data-utils.c:384:24: warning[-Wanalyzer-malloc-leak]: leak of ‘data’
LVM2.2.03.36/daemons/lvmpolld/lvmpolld-data-utils.c:325:30: enter_function: entry to ‘lvmpolld_thread_data_constructor’
LVM2.2.03.36/daemons/lvmpolld/lvmpolld-data-utils.c:327:77: acquire_memory: allocated here
LVM2.2.03.36/daemons/lvmpolld/lvmpolld-data-utils.c:328:12: branch_false: following ‘false’ branch (when ‘data’ is non-NULL)...
LVM2.2.03.36/daemons/lvmpolld/lvmpolld-data-utils.c:331:9: branch_false: ...to here
LVM2.2.03.36/daemons/lvmpolld/lvmpolld-data-utils.c:337:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/daemons/lvmpolld/lvmpolld-data-utils.c:337:41: branch_false: ...to here
LVM2.2.03.36/daemons/lvmpolld/lvmpolld-data-utils.c:337:13: branch_true: following ‘true’ branch...
LVM2.2.03.36/daemons/lvmpolld/lvmpolld-data-utils.c:338:17: branch_true: ...to here
LVM2.2.03.36/daemons/lvmpolld/lvmpolld-data-utils.c:338:17: call_function: calling ‘lvmpolld_thread_data_destroy’ from ‘lvmpolld_thread_data_constructor’
#  382|   
#  383|   	if (data->outpipe[0] >= 0)
#  384|-> 		(void) close(data->outpipe[0]);
#  385|   
#  386|   	if (data->outpipe[1] >= 0)

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

Error: GCC_ANALYZER_WARNING (CWE-401): [#def109]
LVM2.2.03.36/daemons/lvmpolld/lvmpolld-data-utils.c:387:24: warning[-Wanalyzer-malloc-leak]: leak of ‘data’
LVM2.2.03.36/daemons/lvmpolld/lvmpolld-data-utils.c:325:30: enter_function: entry to ‘lvmpolld_thread_data_constructor’
LVM2.2.03.36/daemons/lvmpolld/lvmpolld-data-utils.c:327:77: acquire_memory: allocated here
LVM2.2.03.36/daemons/lvmpolld/lvmpolld-data-utils.c:328:12: branch_false: following ‘false’ branch (when ‘data’ is non-NULL)...
LVM2.2.03.36/daemons/lvmpolld/lvmpolld-data-utils.c:331:9: branch_false: ...to here
LVM2.2.03.36/daemons/lvmpolld/lvmpolld-data-utils.c:337:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/daemons/lvmpolld/lvmpolld-data-utils.c:337:41: branch_false: ...to here
LVM2.2.03.36/daemons/lvmpolld/lvmpolld-data-utils.c:337:13: branch_true: following ‘true’ branch...
LVM2.2.03.36/daemons/lvmpolld/lvmpolld-data-utils.c:338:17: branch_true: ...to here
LVM2.2.03.36/daemons/lvmpolld/lvmpolld-data-utils.c:338:17: call_function: calling ‘lvmpolld_thread_data_destroy’ from ‘lvmpolld_thread_data_constructor’
#  385|   
#  386|   	if (data->outpipe[1] >= 0)
#  387|-> 		(void) close(data->outpipe[1]);
#  388|   
#  389|   	if (data->errpipe[0] >= 0)

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

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

Error: GCC_ANALYZER_WARNING (CWE-775): [#def112]
LVM2.2.03.36/daemons/lvmpolld/lvmpolld-data-utils.c:395:9: warning[-Wanalyzer-fd-leak]: leak of file descriptor
LVM2.2.03.36/daemons/lvmpolld/lvmpolld-data-utils.c:325:30: enter_function: entry to ‘lvmpolld_thread_data_constructor’
LVM2.2.03.36/daemons/lvmpolld/lvmpolld-data-utils.c:328:12: branch_false: following ‘false’ branch (when ‘data’ is non-NULL)...
LVM2.2.03.36/daemons/lvmpolld/lvmpolld-data-utils.c:331:9: branch_false: ...to here
LVM2.2.03.36/daemons/lvmpolld/lvmpolld-data-utils.c:337:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/daemons/lvmpolld/lvmpolld-data-utils.c:337:41: branch_false: ...to here
LVM2.2.03.36/daemons/lvmpolld/lvmpolld-data-utils.c:337:13: branch_true: following ‘true’ branch...
LVM2.2.03.36/daemons/lvmpolld/lvmpolld-data-utils.c:338:17: branch_true: ...to here
LVM2.2.03.36/daemons/lvmpolld/lvmpolld-data-utils.c:338:17: call_function: calling ‘lvmpolld_thread_data_destroy’ from ‘lvmpolld_thread_data_constructor’
#  393|   		(void) close(data->errpipe[1]);
#  394|   
#  395|-> 	free(data);
#  396|   }

Error: GCC_ANALYZER_WARNING (CWE-401): [#def113]
LVM2.2.03.36/device_mapper/datastruct/bitset.c:195:41: warning[-Wanalyzer-malloc-leak]: leak of ‘mask’
LVM2.2.03.36/device_mapper/datastruct/bitset.c:149:13: enter_function: entry to ‘dm_bitset_parse_list’
LVM2.2.03.36/device_mapper/datastruct/bitset.c:211:20: branch_true: following ‘true’ branch (when ‘totaldigits == totaldigits’)...
LVM2.2.03.36/device_mapper/datastruct/bitset.c:211:20: branch_true: ...to here
LVM2.2.03.36/device_mapper/datastruct/bitset.c:226:12: branch_true: following ‘true’ branch (when ‘mask’ is NULL)...
LVM2.2.03.36/device_mapper/datastruct/bitset.c:227:20: branch_true: ...to here
LVM2.2.03.36/device_mapper/datastruct/bitset.c:230:30: call_function: calling ‘dm_bitset_create’ from ‘dm_bitset_parse_list’
LVM2.2.03.36/device_mapper/datastruct/bitset.c:230:30: return_function: returning to ‘dm_bitset_parse_list’ from ‘dm_bitset_create’
LVM2.2.03.36/device_mapper/datastruct/bitset.c:230:20: branch_false: following ‘false’ branch...
LVM2.2.03.36/device_mapper/datastruct/bitset.c:233:17: branch_false: ...to here
LVM2.2.03.36/device_mapper/datastruct/bitset.c:175:28: branch_false: following ‘false’ branch...
LVM2.2.03.36/device_mapper/datastruct/bitset.c:179:29: branch_false: ...to here
LVM2.2.03.36/device_mapper/datastruct/bitset.c:190:28: branch_false: following ‘false’ branch (when ‘totaldigits == totaldigits’)...
LVM2.2.03.36/device_mapper/datastruct/bitset.c:193:28: branch_false: ...to here
LVM2.2.03.36/device_mapper/datastruct/bitset.c:193:28: branch_true: following ‘true’ branch (when ‘c == 45’)...
LVM2.2.03.36/device_mapper/datastruct/bitset.c:194:37: branch_true: ...to here
LVM2.2.03.36/device_mapper/datastruct/bitset.c:194:36: branch_true: following ‘true’ branch...
LVM2.2.03.36/device_mapper/datastruct/bitset.c:195:41: branch_true: ...to here
LVM2.2.03.36/device_mapper/datastruct/bitset.c:195:41: danger: ‘mask’ leaks here; was allocated at [(11)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/10)
#  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): [#def114]
LVM2.2.03.36/device_mapper/datastruct/bitset.c:203:33: warning[-Wanalyzer-malloc-leak]: leak of ‘mask’
LVM2.2.03.36/device_mapper/datastruct/bitset.c:149:13: enter_function: entry to ‘dm_bitset_parse_list’
LVM2.2.03.36/device_mapper/datastruct/bitset.c:211:20: branch_true: following ‘true’ branch (when ‘totaldigits == totaldigits’)...
LVM2.2.03.36/device_mapper/datastruct/bitset.c:211:20: branch_true: ...to here
LVM2.2.03.36/device_mapper/datastruct/bitset.c:226:12: branch_true: following ‘true’ branch (when ‘mask’ is NULL)...
LVM2.2.03.36/device_mapper/datastruct/bitset.c:227:20: branch_true: ...to here
LVM2.2.03.36/device_mapper/datastruct/bitset.c:230:30: call_function: calling ‘dm_bitset_create’ from ‘dm_bitset_parse_list’
LVM2.2.03.36/device_mapper/datastruct/bitset.c:230:30: return_function: returning to ‘dm_bitset_parse_list’ from ‘dm_bitset_create’
LVM2.2.03.36/device_mapper/datastruct/bitset.c:230:20: branch_false: following ‘false’ branch...
LVM2.2.03.36/device_mapper/datastruct/bitset.c:233:17: branch_false: ...to here
LVM2.2.03.36/device_mapper/datastruct/bitset.c:175:28: branch_false: following ‘false’ branch...
LVM2.2.03.36/device_mapper/datastruct/bitset.c:179:29: branch_false: ...to here
LVM2.2.03.36/device_mapper/datastruct/bitset.c:190:28: branch_false: following ‘false’ branch (when ‘totaldigits == totaldigits’)...
LVM2.2.03.36/device_mapper/datastruct/bitset.c:193:28: branch_false: ...to here
LVM2.2.03.36/device_mapper/datastruct/bitset.c:193:28: branch_false: following ‘false’ branch (when ‘c != 45’)...
LVM2.2.03.36/device_mapper/datastruct/bitset.c:202:28: branch_false: ...to here
LVM2.2.03.36/device_mapper/datastruct/bitset.c:202:28: branch_true: following ‘true’ branch...
LVM2.2.03.36/device_mapper/datastruct/bitset.c:203:33: branch_true: ...to here
LVM2.2.03.36/device_mapper/datastruct/bitset.c:203:33: danger: ‘mask’ leaks here; was allocated at [(11)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/10)
#  201|   
#  202|   			if (!isdigit(c))
#  203|-> 				goto_bad;
#  204|   
#  205|   			b = b * 10 + (c - '0');

Error: GCC_ANALYZER_WARNING (CWE-775): [#def115]
LVM2.2.03.36/device_mapper/libdm-common.c:315:17: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(&_mountinfo, "r")’
LVM2.2.03.36/device_mapper/libdm-common.c:1802:5: enter_function: entry to ‘dm_mountinfo_read’
LVM2.2.03.36/device_mapper/libdm-common.c:1810:23: acquire_resource: opened here
LVM2.2.03.36/device_mapper/libdm-common.c:1810:12: branch_false: following ‘false’ branch...
 branch_false: ...to here
LVM2.2.03.36/device_mapper/libdm-common.c:1818:16: branch_true: following ‘true’ branch...
LVM2.2.03.36/device_mapper/libdm-common.c:1820:22: call_function: calling ‘_mountinfo_parse_line’ from ‘dm_mountinfo_read’
#  313|   
#  314|   	if (!dmt) {
#  315|-> 		log_error("dm_task_create: malloc(%" PRIsize_t ") failed",
#  316|   			  sizeof(*dmt));
#  317|   		return NULL;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def116]
LVM2.2.03.36/device_mapper/libdm-common.c:315:17: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(&_mountinfo, "r")’
LVM2.2.03.36/device_mapper/libdm-common.c:1802:5: enter_function: entry to ‘dm_mountinfo_read’
LVM2.2.03.36/device_mapper/libdm-common.c:1810:23: acquire_memory: allocated here
LVM2.2.03.36/device_mapper/libdm-common.c:1810:12: branch_false: following ‘false’ branch...
 branch_false: ...to here
LVM2.2.03.36/device_mapper/libdm-common.c:1818:16: branch_true: following ‘true’ branch...
LVM2.2.03.36/device_mapper/libdm-common.c:1820:22: call_function: calling ‘_mountinfo_parse_line’ from ‘dm_mountinfo_read’
#  313|   
#  314|   	if (!dmt) {
#  315|-> 		log_error("dm_task_create: malloc(%" PRIsize_t ") failed",
#  316|   			  sizeof(*dmt));
#  317|   		return NULL;

Error: GCC_ANALYZER_WARNING (CWE-775): [#def117]
LVM2.2.03.36/device_mapper/libdm-common.c:320:14: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(&_mountinfo, "r")’
LVM2.2.03.36/device_mapper/libdm-common.c:1802:5: enter_function: entry to ‘dm_mountinfo_read’
LVM2.2.03.36/device_mapper/libdm-common.c:1810:23: acquire_resource: opened here
LVM2.2.03.36/device_mapper/libdm-common.c:1810:12: branch_false: following ‘false’ branch...
 branch_false: ...to here
LVM2.2.03.36/device_mapper/libdm-common.c:1818:16: branch_true: following ‘true’ branch...
LVM2.2.03.36/device_mapper/libdm-common.c:1820:22: call_function: calling ‘_mountinfo_parse_line’ from ‘dm_mountinfo_read’
#  318|   	}
#  319|   
#  320|-> 	if (!dm_check_version()) {
#  321|   		free(dmt);
#  322|   		return_NULL;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def118]
LVM2.2.03.36/device_mapper/libdm-common.c:320:14: warning[-Wanalyzer-malloc-leak]: leak of ‘calloc(1, 216)’
LVM2.2.03.36/device_mapper/libdm-common.c:2214:5: enter_function: entry to ‘dm_driver_version’
LVM2.2.03.36/device_mapper/libdm-common.c:2219: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): [#def119]
LVM2.2.03.36/device_mapper/libdm-common.c:320:14: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(&_mountinfo, "r")’
LVM2.2.03.36/device_mapper/libdm-common.c:1802:5: enter_function: entry to ‘dm_mountinfo_read’
LVM2.2.03.36/device_mapper/libdm-common.c:1810:23: acquire_memory: allocated here
LVM2.2.03.36/device_mapper/libdm-common.c:1810:12: branch_false: following ‘false’ branch...
 branch_false: ...to here
LVM2.2.03.36/device_mapper/libdm-common.c:1818:16: branch_true: following ‘true’ branch...
LVM2.2.03.36/device_mapper/libdm-common.c:1820:22: call_function: calling ‘_mountinfo_parse_line’ from ‘dm_mountinfo_read’
#  318|   	}
#  319|   
#  320|-> 	if (!dm_check_version()) {
#  321|   		free(dmt);
#  322|   		return_NULL;

Error: GCC_ANALYZER_WARNING (CWE-775): [#def120]
LVM2.2.03.36/device_mapper/libdm-common.c:322:17: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(&_mountinfo, "r")’
LVM2.2.03.36/device_mapper/libdm-common.c:1802:5: enter_function: entry to ‘dm_mountinfo_read’
LVM2.2.03.36/device_mapper/libdm-common.c:1810:23: acquire_resource: opened here
LVM2.2.03.36/device_mapper/libdm-common.c:1810:12: branch_false: following ‘false’ branch...
 branch_false: ...to here
LVM2.2.03.36/device_mapper/libdm-common.c:1818:16: branch_true: following ‘true’ branch...
LVM2.2.03.36/device_mapper/libdm-common.c:1820:22: call_function: calling ‘_mountinfo_parse_line’ from ‘dm_mountinfo_read’
#  320|   	if (!dm_check_version()) {
#  321|   		free(dmt);
#  322|-> 		return_NULL;
#  323|   	}
#  324|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def121]
LVM2.2.03.36/device_mapper/libdm-common.c:322:17: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(&_mountinfo, "r")’
LVM2.2.03.36/device_mapper/libdm-common.c:1802:5: enter_function: entry to ‘dm_mountinfo_read’
LVM2.2.03.36/device_mapper/libdm-common.c:1810:23: acquire_memory: allocated here
LVM2.2.03.36/device_mapper/libdm-common.c:1810:12: branch_false: following ‘false’ branch...
 branch_false: ...to here
LVM2.2.03.36/device_mapper/libdm-common.c:1818:16: branch_true: following ‘true’ branch...
LVM2.2.03.36/device_mapper/libdm-common.c:1820:22: call_function: calling ‘_mountinfo_parse_line’ from ‘dm_mountinfo_read’
#  320|   	if (!dm_check_version()) {
#  321|   		free(dmt);
#  322|-> 		return_NULL;
#  323|   	}
#  324|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def122]
LVM2.2.03.36/device_mapper/libdm-common.c:358:19: warning[-Wanalyzer-malloc-leak]: leak of ‘dm_task_create(15)’
LVM2.2.03.36/device_mapper/libdm-common.c:2193:5: enter_function: entry to ‘dm_mknodes’
LVM2.2.03.36/device_mapper/libdm-common.c:2198:21: call_function: calling ‘dm_task_create’ from ‘dm_mknodes’
LVM2.2.03.36/device_mapper/libdm-common.c:2198:21: return_function: returning to ‘dm_mknodes’ from ‘dm_task_create’
LVM2.2.03.36/device_mapper/libdm-common.c:2198:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/device_mapper/libdm-common.c:2201:12: branch_false: ...to here
LVM2.2.03.36/device_mapper/libdm-common.c:2201:12: branch_true: following ‘true’ branch (when ‘name’ is non-NULL)...
LVM2.2.03.36/device_mapper/libdm-common.c:2201:22: branch_true: ...to here
LVM2.2.03.36/device_mapper/libdm-common.c:2201:22: call_function: calling ‘dm_task_set_name’ from ‘dm_mknodes’
#  356|   	int r = 0;
#  357|   
#  358|-> 	if (!(d = opendir(_dm_dir))) {
#  359|   		log_sys_error("opendir", _dm_dir);
#  360|   		return 0;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def123]
LVM2.2.03.36/device_mapper/libdm-common.c:358:19: warning[-Wanalyzer-malloc-leak]: leak of ‘dm_task_create(6)’
LVM2.2.03.36/device_mapper/libdm-common.c:1750:12: enter_function: entry to ‘_mountinfo_parse_line’
LVM2.2.03.36/device_mapper/libdm-common.c:1760:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/device_mapper/libdm-common.c:1769:13: branch_false: ...to here
LVM2.2.03.36/device_mapper/libdm-common.c:1769:12: branch_true: following ‘true’ branch...
LVM2.2.03.36/device_mapper/libdm-common.c:1769:39: branch_true: ...to here
LVM2.2.03.36/device_mapper/libdm-common.c:1769:13: branch_true: following ‘true’ branch (when ‘devmapper’ is non-NULL)...
LVM2.2.03.36/device_mapper/libdm-common.c:1770:29: branch_true: ...to here
LVM2.2.03.36/device_mapper/libdm-common.c:1770:29: call_function: calling ‘dm_task_create’ from ‘_mountinfo_parse_line’
LVM2.2.03.36/device_mapper/libdm-common.c:1770:29: return_function: returning to ‘_mountinfo_parse_line’ from ‘dm_task_create’
LVM2.2.03.36/device_mapper/libdm-common.c:1770:20: branch_false: following ‘false’ branch...
 branch_false: ...to here
LVM2.2.03.36/device_mapper/libdm-common.c:1775:29: branch_false: following ‘false’ branch...
LVM2.2.03.36/device_mapper/libdm-common.c:1777:17: branch_false: ...to here
LVM2.2.03.36/device_mapper/libdm-common.c:1778:17: call_function: calling ‘_unmangle_mountinfo_string’ from ‘_mountinfo_parse_line’
LVM2.2.03.36/device_mapper/libdm-common.c:1778:17: return_function: returning to ‘_mountinfo_parse_line’ from ‘_unmangle_mountinfo_string’
LVM2.2.03.36/device_mapper/libdm-common.c:1781:21: call_function: calling ‘dm_task_set_name’ from ‘_mountinfo_parse_line’
#  356|   	int r = 0;
#  357|   
#  358|-> 	if (!(d = opendir(_dm_dir))) {
#  359|   		log_sys_error("opendir", _dm_dir);
#  360|   		return 0;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def124]
LVM2.2.03.36/device_mapper/libdm-common.c:359:17: warning[-Wanalyzer-malloc-leak]: leak of ‘dm_task_create(6)’
LVM2.2.03.36/device_mapper/libdm-common.c:1802:5: enter_function: entry to ‘dm_mountinfo_read’
LVM2.2.03.36/device_mapper/libdm-common.c:1810:12: branch_false: following ‘false’ branch...
 branch_false: ...to here
LVM2.2.03.36/device_mapper/libdm-common.c:1818:16: branch_true: following ‘true’ branch...
LVM2.2.03.36/device_mapper/libdm-common.c:1820:22: call_function: calling ‘_mountinfo_parse_line’ from ‘dm_mountinfo_read’
#  357|   
#  358|   	if (!(d = opendir(_dm_dir))) {
#  359|-> 		log_sys_error("opendir", _dm_dir);
#  360|   		return 0;
#  361|   	}

Error: GCC_ANALYZER_WARNING (CWE-401): [#def125]
LVM2.2.03.36/device_mapper/libdm-common.c:363:26: warning[-Wanalyzer-malloc-leak]: leak of ‘dm_task_create(6)’
LVM2.2.03.36/device_mapper/libdm-common.c:1802:5: enter_function: entry to ‘dm_mountinfo_read’
LVM2.2.03.36/device_mapper/libdm-common.c:1810:12: branch_false: following ‘false’ branch...
 branch_false: ...to here
LVM2.2.03.36/device_mapper/libdm-common.c:1818:16: branch_true: following ‘true’ branch...
LVM2.2.03.36/device_mapper/libdm-common.c:1820:22: call_function: calling ‘_mountinfo_parse_line’ from ‘dm_mountinfo_read’
#  361|   	}
#  362|   
#  363|-> 	while ((dirent = readdir(d))) {
#  364|   		name = dirent->d_name;
#  365|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def126]
LVM2.2.03.36/device_mapper/libdm-common.c:363:26: warning[-Wanalyzer-malloc-leak]: leak of ‘opendir(&_dm_dir)’
LVM2.2.03.36/device_mapper/libdm-common.c:2193:5: enter_function: entry to ‘dm_mknodes’
LVM2.2.03.36/device_mapper/libdm-common.c:2198:21: call_function: calling ‘dm_task_create’ from ‘dm_mknodes’
LVM2.2.03.36/device_mapper/libdm-common.c:2198:21: return_function: returning to ‘dm_mknodes’ from ‘dm_task_create’
LVM2.2.03.36/device_mapper/libdm-common.c:2198:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/device_mapper/libdm-common.c:2201:12: branch_false: ...to here
LVM2.2.03.36/device_mapper/libdm-common.c:2201:12: branch_true: following ‘true’ branch (when ‘name’ is non-NULL)...
LVM2.2.03.36/device_mapper/libdm-common.c:2201:22: branch_true: ...to here
LVM2.2.03.36/device_mapper/libdm-common.c:2201: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): [#def127]
LVM2.2.03.36/device_mapper/libdm-common.c:369:21: warning[-Wanalyzer-malloc-leak]: leak of ‘dm_task_create(6)’
LVM2.2.03.36/device_mapper/libdm-common.c:1802:5: enter_function: entry to ‘dm_mountinfo_read’
LVM2.2.03.36/device_mapper/libdm-common.c:1810:12: branch_false: following ‘false’ branch...
 branch_false: ...to here
LVM2.2.03.36/device_mapper/libdm-common.c:1818:16: branch_true: following ‘true’ branch...
LVM2.2.03.36/device_mapper/libdm-common.c:1820:22: call_function: calling ‘_mountinfo_parse_line’ from ‘dm_mountinfo_read’
#  367|   			continue;
#  368|   
#  369|-> 		if (dm_snprintf(path, sizeof(path), "%s/%s", _dm_dir,
#  370|   				name) == -1) {
#  371|   			log_error("Couldn't create path for %s", name);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def128]
LVM2.2.03.36/device_mapper/libdm-common.c:371:25: warning[-Wanalyzer-malloc-leak]: leak of ‘dm_task_create(6)’
LVM2.2.03.36/device_mapper/libdm-common.c:1802:5: enter_function: entry to ‘dm_mountinfo_read’
LVM2.2.03.36/device_mapper/libdm-common.c:1810:12: branch_false: following ‘false’ branch...
 branch_false: ...to here
LVM2.2.03.36/device_mapper/libdm-common.c:1818:16: branch_true: following ‘true’ branch...
LVM2.2.03.36/device_mapper/libdm-common.c:1820:22: call_function: calling ‘_mountinfo_parse_line’ from ‘dm_mountinfo_read’
#  369|   		if (dm_snprintf(path, sizeof(path), "%s/%s", _dm_dir,
#  370|   				name) == -1) {
#  371|-> 			log_error("Couldn't create path for %s", name);
#  372|   			continue;
#  373|   		}

Error: GCC_ANALYZER_WARNING (CWE-775): [#def129]
LVM2.2.03.36/device_mapper/libdm-common.c:626:21: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(&_mountinfo, "r")’
LVM2.2.03.36/device_mapper/libdm-common.c:1802:5: enter_function: entry to ‘dm_mountinfo_read’
LVM2.2.03.36/device_mapper/libdm-common.c:1810:23: acquire_resource: opened here
LVM2.2.03.36/device_mapper/libdm-common.c:1810:12: branch_false: following ‘false’ branch...
 branch_false: ...to here
LVM2.2.03.36/device_mapper/libdm-common.c:1818:16: branch_true: following ‘true’ branch...
LVM2.2.03.36/device_mapper/libdm-common.c:1820:22: call_function: calling ‘_mountinfo_parse_line’ from ‘dm_mountinfo_read’
#  624|   		 * under /dev/mapper, use that name directly.  
#  625|   		 */
#  626|-> 		if (dm_snprintf(buf, sizeof(buf), "%s/%s", _dm_dir, name) == -1) {
#  627|   			log_error("Couldn't create path for %s", name);
#  628|   			return 0;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def130]
LVM2.2.03.36/device_mapper/libdm-common.c:626:21: warning[-Wanalyzer-malloc-leak]: leak of ‘dm_task_create(15)’
LVM2.2.03.36/device_mapper/libdm-common.c:2193:5: enter_function: entry to ‘dm_mknodes’
LVM2.2.03.36/device_mapper/libdm-common.c:2198:21: call_function: calling ‘dm_task_create’ from ‘dm_mknodes’
LVM2.2.03.36/device_mapper/libdm-common.c:2198:21: return_function: returning to ‘dm_mknodes’ from ‘dm_task_create’
LVM2.2.03.36/device_mapper/libdm-common.c:2198:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/device_mapper/libdm-common.c:2201:12: branch_false: ...to here
LVM2.2.03.36/device_mapper/libdm-common.c:2201:12: branch_true: following ‘true’ branch (when ‘name’ is non-NULL)...
LVM2.2.03.36/device_mapper/libdm-common.c:2201:22: branch_true: ...to here
LVM2.2.03.36/device_mapper/libdm-common.c:2201:22: call_function: calling ‘dm_task_set_name’ from ‘dm_mknodes’
#  624|   		 * under /dev/mapper, use that name directly.  
#  625|   		 */
#  626|-> 		if (dm_snprintf(buf, sizeof(buf), "%s/%s", _dm_dir, name) == -1) {
#  627|   			log_error("Couldn't create path for %s", name);
#  628|   			return 0;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def131]
LVM2.2.03.36/device_mapper/libdm-common.c:626:21: warning[-Wanalyzer-malloc-leak]: leak of ‘dm_task_create(6)’
LVM2.2.03.36/device_mapper/libdm-common.c:1750:12: enter_function: entry to ‘_mountinfo_parse_line’
LVM2.2.03.36/device_mapper/libdm-common.c:1760:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/device_mapper/libdm-common.c:1769:13: branch_false: ...to here
LVM2.2.03.36/device_mapper/libdm-common.c:1769:12: branch_true: following ‘true’ branch...
LVM2.2.03.36/device_mapper/libdm-common.c:1769:39: branch_true: ...to here
LVM2.2.03.36/device_mapper/libdm-common.c:1769:13: branch_true: following ‘true’ branch (when ‘devmapper’ is non-NULL)...
LVM2.2.03.36/device_mapper/libdm-common.c:1770:29: branch_true: ...to here
LVM2.2.03.36/device_mapper/libdm-common.c:1770:29: call_function: calling ‘dm_task_create’ from ‘_mountinfo_parse_line’
LVM2.2.03.36/device_mapper/libdm-common.c:1770:29: return_function: returning to ‘_mountinfo_parse_line’ from ‘dm_task_create’
LVM2.2.03.36/device_mapper/libdm-common.c:1770:20: branch_false: following ‘false’ branch...
 branch_false: ...to here
LVM2.2.03.36/device_mapper/libdm-common.c:1775:29: branch_false: following ‘false’ branch...
LVM2.2.03.36/device_mapper/libdm-common.c:1777:17: branch_false: ...to here
LVM2.2.03.36/device_mapper/libdm-common.c:1778:17: call_function: calling ‘_unmangle_mountinfo_string’ from ‘_mountinfo_parse_line’
LVM2.2.03.36/device_mapper/libdm-common.c:1778:17: return_function: returning to ‘_mountinfo_parse_line’ from ‘_unmangle_mountinfo_string’
LVM2.2.03.36/device_mapper/libdm-common.c:1781:21: call_function: calling ‘dm_task_set_name’ from ‘_mountinfo_parse_line’
#  624|   		 * under /dev/mapper, use that name directly.  
#  625|   		 */
#  626|-> 		if (dm_snprintf(buf, sizeof(buf), "%s/%s", _dm_dir, name) == -1) {
#  627|   			log_error("Couldn't create path for %s", name);
#  628|   			return 0;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def132]
LVM2.2.03.36/device_mapper/libdm-common.c:626:21: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(&_mountinfo, "r")’
LVM2.2.03.36/device_mapper/libdm-common.c:1802:5: enter_function: entry to ‘dm_mountinfo_read’
LVM2.2.03.36/device_mapper/libdm-common.c:1810:23: acquire_memory: allocated here
LVM2.2.03.36/device_mapper/libdm-common.c:1810:12: branch_false: following ‘false’ branch...
 branch_false: ...to here
LVM2.2.03.36/device_mapper/libdm-common.c:1818:16: branch_true: following ‘true’ branch...
LVM2.2.03.36/device_mapper/libdm-common.c:1820:22: call_function: calling ‘_mountinfo_parse_line’ from ‘dm_mountinfo_read’
#  624|   		 * under /dev/mapper, use that name directly.  
#  625|   		 */
#  626|-> 		if (dm_snprintf(buf, sizeof(buf), "%s/%s", _dm_dir, name) == -1) {
#  627|   			log_error("Couldn't create path for %s", name);
#  628|   			return 0;

Error: GCC_ANALYZER_WARNING (CWE-775): [#def133]
LVM2.2.03.36/device_mapper/libdm-common.c:627:25: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(&_mountinfo, "r")’
LVM2.2.03.36/device_mapper/libdm-common.c:1802:5: enter_function: entry to ‘dm_mountinfo_read’
LVM2.2.03.36/device_mapper/libdm-common.c:1810:23: acquire_resource: opened here
LVM2.2.03.36/device_mapper/libdm-common.c:1810:12: branch_false: following ‘false’ branch...
 branch_false: ...to here
LVM2.2.03.36/device_mapper/libdm-common.c:1818:16: branch_true: following ‘true’ branch...
LVM2.2.03.36/device_mapper/libdm-common.c:1820:22: call_function: calling ‘_mountinfo_parse_line’ from ‘dm_mountinfo_read’
#  625|   		 */
#  626|   		if (dm_snprintf(buf, sizeof(buf), "%s/%s", _dm_dir, name) == -1) {
#  627|-> 			log_error("Couldn't create path for %s", name);
#  628|   			return 0;
#  629|   		}

Error: GCC_ANALYZER_WARNING (CWE-401): [#def134]
LVM2.2.03.36/device_mapper/libdm-common.c:627:25: warning[-Wanalyzer-malloc-leak]: leak of ‘dm_task_create(15)’
LVM2.2.03.36/device_mapper/libdm-common.c:2193:5: enter_function: entry to ‘dm_mknodes’
LVM2.2.03.36/device_mapper/libdm-common.c:2198:21: call_function: calling ‘dm_task_create’ from ‘dm_mknodes’
LVM2.2.03.36/device_mapper/libdm-common.c:2198:21: return_function: returning to ‘dm_mknodes’ from ‘dm_task_create’
LVM2.2.03.36/device_mapper/libdm-common.c:2198:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/device_mapper/libdm-common.c:2201:12: branch_false: ...to here
LVM2.2.03.36/device_mapper/libdm-common.c:2201:12: branch_true: following ‘true’ branch (when ‘name’ is non-NULL)...
LVM2.2.03.36/device_mapper/libdm-common.c:2201:22: branch_true: ...to here
LVM2.2.03.36/device_mapper/libdm-common.c:2201:22: call_function: calling ‘dm_task_set_name’ from ‘dm_mknodes’
#  625|   		 */
#  626|   		if (dm_snprintf(buf, sizeof(buf), "%s/%s", _dm_dir, name) == -1) {
#  627|-> 			log_error("Couldn't create path for %s", name);
#  628|   			return 0;
#  629|   		}

Error: GCC_ANALYZER_WARNING (CWE-401): [#def135]
LVM2.2.03.36/device_mapper/libdm-common.c:627:25: warning[-Wanalyzer-malloc-leak]: leak of ‘dm_task_create(6)’
LVM2.2.03.36/device_mapper/libdm-common.c:1750:12: enter_function: entry to ‘_mountinfo_parse_line’
LVM2.2.03.36/device_mapper/libdm-common.c:1760:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/device_mapper/libdm-common.c:1769:13: branch_false: ...to here
LVM2.2.03.36/device_mapper/libdm-common.c:1769:12: branch_true: following ‘true’ branch...
LVM2.2.03.36/device_mapper/libdm-common.c:1769:39: branch_true: ...to here
LVM2.2.03.36/device_mapper/libdm-common.c:1769:13: branch_true: following ‘true’ branch (when ‘devmapper’ is non-NULL)...
LVM2.2.03.36/device_mapper/libdm-common.c:1770:29: branch_true: ...to here
LVM2.2.03.36/device_mapper/libdm-common.c:1770:29: call_function: calling ‘dm_task_create’ from ‘_mountinfo_parse_line’
LVM2.2.03.36/device_mapper/libdm-common.c:1770:29: return_function: returning to ‘_mountinfo_parse_line’ from ‘dm_task_create’
LVM2.2.03.36/device_mapper/libdm-common.c:1770:20: branch_false: following ‘false’ branch...
 branch_false: ...to here
LVM2.2.03.36/device_mapper/libdm-common.c:1775:29: branch_false: following ‘false’ branch...
LVM2.2.03.36/device_mapper/libdm-common.c:1777:17: branch_false: ...to here
LVM2.2.03.36/device_mapper/libdm-common.c:1778:17: call_function: calling ‘_unmangle_mountinfo_string’ from ‘_mountinfo_parse_line’
LVM2.2.03.36/device_mapper/libdm-common.c:1778:17: return_function: returning to ‘_mountinfo_parse_line’ from ‘_unmangle_mountinfo_string’
LVM2.2.03.36/device_mapper/libdm-common.c:1781:21: call_function: calling ‘dm_task_set_name’ from ‘_mountinfo_parse_line’
#  625|   		 */
#  626|   		if (dm_snprintf(buf, sizeof(buf), "%s/%s", _dm_dir, name) == -1) {
#  627|-> 			log_error("Couldn't create path for %s", name);
#  628|   			return 0;
#  629|   		}

Error: GCC_ANALYZER_WARNING (CWE-401): [#def136]
LVM2.2.03.36/device_mapper/libdm-common.c:627:25: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(&_mountinfo, "r")’
LVM2.2.03.36/device_mapper/libdm-common.c:1802:5: enter_function: entry to ‘dm_mountinfo_read’
LVM2.2.03.36/device_mapper/libdm-common.c:1810:23: acquire_memory: allocated here
LVM2.2.03.36/device_mapper/libdm-common.c:1810:12: branch_false: following ‘false’ branch...
 branch_false: ...to here
LVM2.2.03.36/device_mapper/libdm-common.c:1818:16: branch_true: following ‘true’ branch...
LVM2.2.03.36/device_mapper/libdm-common.c:1820:22: call_function: calling ‘_mountinfo_parse_line’ from ‘dm_mountinfo_read’
#  625|   		 */
#  626|   		if (dm_snprintf(buf, sizeof(buf), "%s/%s", _dm_dir, name) == -1) {
#  627|-> 			log_error("Couldn't create path for %s", name);
#  628|   			return 0;
#  629|   		}

Error: GCC_ANALYZER_WARNING (CWE-401): [#def137]
LVM2.2.03.36/device_mapper/libdm-common.c:637:21: warning[-Wanalyzer-malloc-leak]: leak of ‘dm_task_create(15)’
LVM2.2.03.36/device_mapper/libdm-common.c:2193:5: enter_function: entry to ‘dm_mknodes’
LVM2.2.03.36/device_mapper/libdm-common.c:2198:21: call_function: calling ‘dm_task_create’ from ‘dm_mknodes’
LVM2.2.03.36/device_mapper/libdm-common.c:2198:21: return_function: returning to ‘dm_mknodes’ from ‘dm_task_create’
LVM2.2.03.36/device_mapper/libdm-common.c:2198:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/device_mapper/libdm-common.c:2201:12: branch_false: ...to here
LVM2.2.03.36/device_mapper/libdm-common.c:2201:12: branch_true: following ‘true’ branch (when ‘name’ is non-NULL)...
LVM2.2.03.36/device_mapper/libdm-common.c:2201:22: branch_true: ...to here
LVM2.2.03.36/device_mapper/libdm-common.c:2201:22: call_function: calling ‘dm_task_set_name’ from ‘dm_mknodes’
#  635|   		/* If there is exactly one '/' try a prefix of /dev */
#  636|   		if ((len = strlen(path)) < 3 || path[0] == '/' ||
#  637|-> 		    dm_count_chars(path, len, '/') != 1) {
#  638|   			log_error("Device %s not found", path);
#  639|   			return 0;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def138]
LVM2.2.03.36/device_mapper/libdm-common.c:637:21: warning[-Wanalyzer-malloc-leak]: leak of ‘dm_task_create(6)’
LVM2.2.03.36/device_mapper/libdm-common.c:1750:12: enter_function: entry to ‘_mountinfo_parse_line’
LVM2.2.03.36/device_mapper/libdm-common.c:1760:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/device_mapper/libdm-common.c:1769:13: branch_false: ...to here
LVM2.2.03.36/device_mapper/libdm-common.c:1769:12: branch_true: following ‘true’ branch...
LVM2.2.03.36/device_mapper/libdm-common.c:1769:39: branch_true: ...to here
LVM2.2.03.36/device_mapper/libdm-common.c:1769:13: branch_true: following ‘true’ branch (when ‘devmapper’ is non-NULL)...
LVM2.2.03.36/device_mapper/libdm-common.c:1770:29: branch_true: ...to here
LVM2.2.03.36/device_mapper/libdm-common.c:1770:29: call_function: calling ‘dm_task_create’ from ‘_mountinfo_parse_line’
LVM2.2.03.36/device_mapper/libdm-common.c:1770:29: return_function: returning to ‘_mountinfo_parse_line’ from ‘dm_task_create’
LVM2.2.03.36/device_mapper/libdm-common.c:1770:20: branch_false: following ‘false’ branch...
 branch_false: ...to here
LVM2.2.03.36/device_mapper/libdm-common.c:1775:29: branch_false: following ‘false’ branch...
LVM2.2.03.36/device_mapper/libdm-common.c:1777:17: branch_false: ...to here
LVM2.2.03.36/device_mapper/libdm-common.c:1778:17: call_function: calling ‘_unmangle_mountinfo_string’ from ‘_mountinfo_parse_line’
LVM2.2.03.36/device_mapper/libdm-common.c:1778:17: return_function: returning to ‘_mountinfo_parse_line’ from ‘_unmangle_mountinfo_string’
LVM2.2.03.36/device_mapper/libdm-common.c:1781:21: call_function: calling ‘dm_task_set_name’ from ‘_mountinfo_parse_line’
#  635|   		/* If there is exactly one '/' try a prefix of /dev */
#  636|   		if ((len = strlen(path)) < 3 || path[0] == '/' ||
#  637|-> 		    dm_count_chars(path, len, '/') != 1) {
#  638|   			log_error("Device %s not found", path);
#  639|   			return 0;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def139]
LVM2.2.03.36/device_mapper/libdm-common.c:638:25: warning[-Wanalyzer-malloc-leak]: leak of ‘dm_task_create(15)’
LVM2.2.03.36/device_mapper/libdm-common.c:2193:5: enter_function: entry to ‘dm_mknodes’
LVM2.2.03.36/device_mapper/libdm-common.c:2198:21: call_function: calling ‘dm_task_create’ from ‘dm_mknodes’
LVM2.2.03.36/device_mapper/libdm-common.c:2198:21: return_function: returning to ‘dm_mknodes’ from ‘dm_task_create’
LVM2.2.03.36/device_mapper/libdm-common.c:2198:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/device_mapper/libdm-common.c:2201:12: branch_false: ...to here
LVM2.2.03.36/device_mapper/libdm-common.c:2201:12: branch_true: following ‘true’ branch (when ‘name’ is non-NULL)...
LVM2.2.03.36/device_mapper/libdm-common.c:2201:22: branch_true: ...to here
LVM2.2.03.36/device_mapper/libdm-common.c:2201:22: call_function: calling ‘dm_task_set_name’ from ‘dm_mknodes’
#  636|   		if ((len = strlen(path)) < 3 || path[0] == '/' ||
#  637|   		    dm_count_chars(path, len, '/') != 1) {
#  638|-> 			log_error("Device %s not found", path);
#  639|   			return 0;
#  640|   		}

Error: GCC_ANALYZER_WARNING (CWE-401): [#def140]
LVM2.2.03.36/device_mapper/libdm-common.c:638:25: warning[-Wanalyzer-malloc-leak]: leak of ‘dm_task_create(6)’
LVM2.2.03.36/device_mapper/libdm-common.c:1750:12: enter_function: entry to ‘_mountinfo_parse_line’
LVM2.2.03.36/device_mapper/libdm-common.c:1760:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/device_mapper/libdm-common.c:1769:13: branch_false: ...to here
LVM2.2.03.36/device_mapper/libdm-common.c:1769:12: branch_true: following ‘true’ branch...
LVM2.2.03.36/device_mapper/libdm-common.c:1769:39: branch_true: ...to here
LVM2.2.03.36/device_mapper/libdm-common.c:1769:13: branch_true: following ‘true’ branch (when ‘devmapper’ is non-NULL)...
LVM2.2.03.36/device_mapper/libdm-common.c:1770:29: branch_true: ...to here
LVM2.2.03.36/device_mapper/libdm-common.c:1770:29: call_function: calling ‘dm_task_create’ from ‘_mountinfo_parse_line’
LVM2.2.03.36/device_mapper/libdm-common.c:1770:29: return_function: returning to ‘_mountinfo_parse_line’ from ‘dm_task_create’
LVM2.2.03.36/device_mapper/libdm-common.c:1770:20: branch_false: following ‘false’ branch...
 branch_false: ...to here
LVM2.2.03.36/device_mapper/libdm-common.c:1775:29: branch_false: following ‘false’ branch...
LVM2.2.03.36/device_mapper/libdm-common.c:1777:17: branch_false: ...to here
LVM2.2.03.36/device_mapper/libdm-common.c:1778:17: call_function: calling ‘_unmangle_mountinfo_string’ from ‘_mountinfo_parse_line’
LVM2.2.03.36/device_mapper/libdm-common.c:1778:17: return_function: returning to ‘_mountinfo_parse_line’ from ‘_unmangle_mountinfo_string’
LVM2.2.03.36/device_mapper/libdm-common.c:1781:21: call_function: calling ‘dm_task_set_name’ from ‘_mountinfo_parse_line’
#  636|   		if ((len = strlen(path)) < 3 || path[0] == '/' ||
#  637|   		    dm_count_chars(path, len, '/') != 1) {
#  638|-> 			log_error("Device %s not found", path);
#  639|   			return 0;
#  640|   		}

Error: GCC_ANALYZER_WARNING (CWE-401): [#def141]
LVM2.2.03.36/device_mapper/libdm-common.c:641:21: warning[-Wanalyzer-malloc-leak]: leak of ‘dm_task_create(15)’
LVM2.2.03.36/device_mapper/libdm-common.c:2193:5: enter_function: entry to ‘dm_mknodes’
LVM2.2.03.36/device_mapper/libdm-common.c:2198:21: call_function: calling ‘dm_task_create’ from ‘dm_mknodes’
LVM2.2.03.36/device_mapper/libdm-common.c:2198:21: return_function: returning to ‘dm_mknodes’ from ‘dm_task_create’
LVM2.2.03.36/device_mapper/libdm-common.c:2198:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/device_mapper/libdm-common.c:2201:12: branch_false: ...to here
LVM2.2.03.36/device_mapper/libdm-common.c:2201:12: branch_true: following ‘true’ branch (when ‘name’ is non-NULL)...
LVM2.2.03.36/device_mapper/libdm-common.c:2201:22: branch_true: ...to here
LVM2.2.03.36/device_mapper/libdm-common.c:2201:22: call_function: calling ‘dm_task_set_name’ from ‘dm_mknodes’
#  639|   			return 0;
#  640|   		}
#  641|-> 		if (dm_snprintf(buf, sizeof(buf), "%s/../%s", _dm_dir, path) == -1) {
#  642|   			log_error("Couldn't create /dev path for %s", path);
#  643|   			return 0;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def142]
LVM2.2.03.36/device_mapper/libdm-common.c:641:21: warning[-Wanalyzer-malloc-leak]: leak of ‘dm_task_create(6)’
LVM2.2.03.36/device_mapper/libdm-common.c:1750:12: enter_function: entry to ‘_mountinfo_parse_line’
LVM2.2.03.36/device_mapper/libdm-common.c:1760:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/device_mapper/libdm-common.c:1769:13: branch_false: ...to here
LVM2.2.03.36/device_mapper/libdm-common.c:1769:12: branch_true: following ‘true’ branch...
LVM2.2.03.36/device_mapper/libdm-common.c:1769:39: branch_true: ...to here
LVM2.2.03.36/device_mapper/libdm-common.c:1769:13: branch_true: following ‘true’ branch (when ‘devmapper’ is non-NULL)...
LVM2.2.03.36/device_mapper/libdm-common.c:1770:29: branch_true: ...to here
LVM2.2.03.36/device_mapper/libdm-common.c:1770:29: call_function: calling ‘dm_task_create’ from ‘_mountinfo_parse_line’
LVM2.2.03.36/device_mapper/libdm-common.c:1770:29: return_function: returning to ‘_mountinfo_parse_line’ from ‘dm_task_create’
LVM2.2.03.36/device_mapper/libdm-common.c:1770:20: branch_false: following ‘false’ branch...
 branch_false: ...to here
LVM2.2.03.36/device_mapper/libdm-common.c:1775:29: branch_false: following ‘false’ branch...
LVM2.2.03.36/device_mapper/libdm-common.c:1777:17: branch_false: ...to here
LVM2.2.03.36/device_mapper/libdm-common.c:1778:17: call_function: calling ‘_unmangle_mountinfo_string’ from ‘_mountinfo_parse_line’
LVM2.2.03.36/device_mapper/libdm-common.c:1778:17: return_function: returning to ‘_mountinfo_parse_line’ from ‘_unmangle_mountinfo_string’
LVM2.2.03.36/device_mapper/libdm-common.c:1781:21: call_function: calling ‘dm_task_set_name’ from ‘_mountinfo_parse_line’
#  639|   			return 0;
#  640|   		}
#  641|-> 		if (dm_snprintf(buf, sizeof(buf), "%s/../%s", _dm_dir, path) == -1) {
#  642|   			log_error("Couldn't create /dev path for %s", path);
#  643|   			return 0;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def143]
LVM2.2.03.36/device_mapper/libdm-common.c:642:25: warning[-Wanalyzer-malloc-leak]: leak of ‘dm_task_create(15)’
LVM2.2.03.36/device_mapper/libdm-common.c:2193:5: enter_function: entry to ‘dm_mknodes’
LVM2.2.03.36/device_mapper/libdm-common.c:2198:21: call_function: calling ‘dm_task_create’ from ‘dm_mknodes’
LVM2.2.03.36/device_mapper/libdm-common.c:2198:21: return_function: returning to ‘dm_mknodes’ from ‘dm_task_create’
LVM2.2.03.36/device_mapper/libdm-common.c:2198:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/device_mapper/libdm-common.c:2201:12: branch_false: ...to here
LVM2.2.03.36/device_mapper/libdm-common.c:2201:12: branch_true: following ‘true’ branch (when ‘name’ is non-NULL)...
LVM2.2.03.36/device_mapper/libdm-common.c:2201:22: branch_true: ...to here
LVM2.2.03.36/device_mapper/libdm-common.c:2201:22: call_function: calling ‘dm_task_set_name’ from ‘dm_mknodes’
#  640|   		}
#  641|   		if (dm_snprintf(buf, sizeof(buf), "%s/../%s", _dm_dir, path) == -1) {
#  642|-> 			log_error("Couldn't create /dev path for %s", path);
#  643|   			return 0;
#  644|   		}

Error: GCC_ANALYZER_WARNING (CWE-401): [#def144]
LVM2.2.03.36/device_mapper/libdm-common.c:642:25: warning[-Wanalyzer-malloc-leak]: leak of ‘dm_task_create(6)’
LVM2.2.03.36/device_mapper/libdm-common.c:1750:12: enter_function: entry to ‘_mountinfo_parse_line’
LVM2.2.03.36/device_mapper/libdm-common.c:1760:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/device_mapper/libdm-common.c:1769:13: branch_false: ...to here
LVM2.2.03.36/device_mapper/libdm-common.c:1769:12: branch_true: following ‘true’ branch...
LVM2.2.03.36/device_mapper/libdm-common.c:1769:39: branch_true: ...to here
LVM2.2.03.36/device_mapper/libdm-common.c:1769:13: branch_true: following ‘true’ branch (when ‘devmapper’ is non-NULL)...
LVM2.2.03.36/device_mapper/libdm-common.c:1770:29: branch_true: ...to here
LVM2.2.03.36/device_mapper/libdm-common.c:1770:29: call_function: calling ‘dm_task_create’ from ‘_mountinfo_parse_line’
LVM2.2.03.36/device_mapper/libdm-common.c:1770:29: return_function: returning to ‘_mountinfo_parse_line’ from ‘dm_task_create’
LVM2.2.03.36/device_mapper/libdm-common.c:1770:20: branch_false: following ‘false’ branch...
 branch_false: ...to here
LVM2.2.03.36/device_mapper/libdm-common.c:1775:29: branch_false: following ‘false’ branch...
LVM2.2.03.36/device_mapper/libdm-common.c:1777:17: branch_false: ...to here
LVM2.2.03.36/device_mapper/libdm-common.c:1778:17: call_function: calling ‘_unmangle_mountinfo_string’ from ‘_mountinfo_parse_line’
LVM2.2.03.36/device_mapper/libdm-common.c:1778:17: return_function: returning to ‘_mountinfo_parse_line’ from ‘_unmangle_mountinfo_string’
LVM2.2.03.36/device_mapper/libdm-common.c:1781:21: call_function: calling ‘dm_task_set_name’ from ‘_mountinfo_parse_line’
#  640|   		}
#  641|   		if (dm_snprintf(buf, sizeof(buf), "%s/../%s", _dm_dir, path) == -1) {
#  642|-> 			log_error("Couldn't create /dev path for %s", path);
#  643|   			return 0;
#  644|   		}

Error: GCC_ANALYZER_WARNING (CWE-401): [#def145]
LVM2.2.03.36/device_mapper/libdm-common.c:646:25: warning[-Wanalyzer-malloc-leak]: leak of ‘dm_task_create(15)’
LVM2.2.03.36/device_mapper/libdm-common.c:2193:5: enter_function: entry to ‘dm_mknodes’
LVM2.2.03.36/device_mapper/libdm-common.c:2198:21: call_function: calling ‘dm_task_create’ from ‘dm_mknodes’
LVM2.2.03.36/device_mapper/libdm-common.c:2198:21: return_function: returning to ‘dm_mknodes’ from ‘dm_task_create’
LVM2.2.03.36/device_mapper/libdm-common.c:2198:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/device_mapper/libdm-common.c:2201:12: branch_false: ...to here
LVM2.2.03.36/device_mapper/libdm-common.c:2201:12: branch_true: following ‘true’ branch (when ‘name’ is non-NULL)...
LVM2.2.03.36/device_mapper/libdm-common.c:2201:22: branch_true: ...to here
LVM2.2.03.36/device_mapper/libdm-common.c:2201:22: call_function: calling ‘dm_task_set_name’ from ‘dm_mknodes’
#  644|   		}
#  645|   		if (stat(buf, &st1)) {
#  646|-> 			log_error("Device %s not found", path);
#  647|   			return 0;
#  648|   		}

Error: GCC_ANALYZER_WARNING (CWE-401): [#def146]
LVM2.2.03.36/device_mapper/libdm-common.c:646:25: warning[-Wanalyzer-malloc-leak]: leak of ‘dm_task_create(6)’
LVM2.2.03.36/device_mapper/libdm-common.c:1750:12: enter_function: entry to ‘_mountinfo_parse_line’
LVM2.2.03.36/device_mapper/libdm-common.c:1760:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/device_mapper/libdm-common.c:1769:13: branch_false: ...to here
LVM2.2.03.36/device_mapper/libdm-common.c:1769:12: branch_true: following ‘true’ branch...
LVM2.2.03.36/device_mapper/libdm-common.c:1769:39: branch_true: ...to here
LVM2.2.03.36/device_mapper/libdm-common.c:1769:13: branch_true: following ‘true’ branch (when ‘devmapper’ is non-NULL)...
LVM2.2.03.36/device_mapper/libdm-common.c:1770:29: branch_true: ...to here
LVM2.2.03.36/device_mapper/libdm-common.c:1770:29: call_function: calling ‘dm_task_create’ from ‘_mountinfo_parse_line’
LVM2.2.03.36/device_mapper/libdm-common.c:1770:29: return_function: returning to ‘_mountinfo_parse_line’ from ‘dm_task_create’
LVM2.2.03.36/device_mapper/libdm-common.c:1770:20: branch_false: following ‘false’ branch...
 branch_false: ...to here
LVM2.2.03.36/device_mapper/libdm-common.c:1775:29: branch_false: following ‘false’ branch...
LVM2.2.03.36/device_mapper/libdm-common.c:1777:17: branch_false: ...to here
LVM2.2.03.36/device_mapper/libdm-common.c:1778:17: call_function: calling ‘_unmangle_mountinfo_string’ from ‘_mountinfo_parse_line’
LVM2.2.03.36/device_mapper/libdm-common.c:1778:17: return_function: returning to ‘_mountinfo_parse_line’ from ‘_unmangle_mountinfo_string’
LVM2.2.03.36/device_mapper/libdm-common.c:1781:21: call_function: calling ‘dm_task_set_name’ from ‘_mountinfo_parse_line’
#  644|   		}
#  645|   		if (stat(buf, &st1)) {
#  646|-> 			log_error("Device %s not found", path);
#  647|   			return 0;
#  648|   		}

Error: GCC_ANALYZER_WARNING (CWE-401): [#def147]
LVM2.2.03.36/device_mapper/libdm-common.c:1594:9: warning[-Wanalyzer-malloc-leak]: leak of ‘nop’
LVM2.2.03.36/device_mapper/libdm-common.c:1639:5: enter_function: entry to ‘set_dev_node_read_ahead’
LVM2.2.03.36/device_mapper/libdm-common.c:1643:12: branch_false: following ‘false’ branch (when ‘read_ahead != 4294967295’)...
LVM2.2.03.36/device_mapper/libdm-common.c:1646:16: branch_false: ...to here
LVM2.2.03.36/device_mapper/libdm-common.c:1646:16: call_function: calling ‘_stack_node_op’ from ‘set_dev_node_read_ahead’
# 1592|   
# 1593|   	_count_node_ops[type]++;
# 1594|-> 	dm_list_add(&_node_ops, &nop->list);
# 1595|   
# 1596|   	_log_node_op("Stacking", nop);

Error: GCC_ANALYZER_WARNING (CWE-775): [#def148]
LVM2.2.03.36/device_mapper/libdm-common.c:1763:17: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(&_mountinfo, "r")’
LVM2.2.03.36/device_mapper/libdm-common.c:1802:5: enter_function: entry to ‘dm_mountinfo_read’
LVM2.2.03.36/device_mapper/libdm-common.c:1810:23: acquire_resource: opened here
LVM2.2.03.36/device_mapper/libdm-common.c:1810:12: branch_false: following ‘false’ branch...
 branch_false: ...to here
LVM2.2.03.36/device_mapper/libdm-common.c:1818:16: branch_true: following ‘true’ branch...
LVM2.2.03.36/device_mapper/libdm-common.c:1820:22: call_function: calling ‘_mountinfo_parse_line’ from ‘dm_mountinfo_read’
# 1761|   		   "s %" DM_TO_STRING(PATH_MAX) "s",
# 1762|   		   maj, min, root, target) < 4) {
# 1763|-> 		log_error("Failed to parse mountinfo line.");
# 1764|   		return 0;
# 1765|   	}

Error: GCC_ANALYZER_WARNING (CWE-401): [#def149]
LVM2.2.03.36/device_mapper/libdm-common.c:1763:17: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(&_mountinfo, "r")’
LVM2.2.03.36/device_mapper/libdm-common.c:1802:5: enter_function: entry to ‘dm_mountinfo_read’
LVM2.2.03.36/device_mapper/libdm-common.c:1810:23: acquire_memory: allocated here
LVM2.2.03.36/device_mapper/libdm-common.c:1810:12: branch_false: following ‘false’ branch...
 branch_false: ...to here
LVM2.2.03.36/device_mapper/libdm-common.c:1818:16: branch_true: following ‘true’ branch...
LVM2.2.03.36/device_mapper/libdm-common.c:1820:22: call_function: calling ‘_mountinfo_parse_line’ from ‘dm_mountinfo_read’
# 1761|   		   "s %" DM_TO_STRING(PATH_MAX) "s",
# 1762|   		   maj, min, root, target) < 4) {
# 1763|-> 		log_error("Failed to parse mountinfo line.");
# 1764|   		return 0;
# 1765|   	}

Error: GCC_ANALYZER_WARNING (CWE-775): [#def150]
LVM2.2.03.36/device_mapper/libdm-common.c:1771:25: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(&_mountinfo, "r")’
LVM2.2.03.36/device_mapper/libdm-common.c:1802:5: enter_function: entry to ‘dm_mountinfo_read’
LVM2.2.03.36/device_mapper/libdm-common.c:1810:23: acquire_resource: opened here
LVM2.2.03.36/device_mapper/libdm-common.c:1810:12: branch_false: following ‘false’ branch...
 branch_false: ...to here
LVM2.2.03.36/device_mapper/libdm-common.c:1818:16: branch_true: following ‘true’ branch...
LVM2.2.03.36/device_mapper/libdm-common.c:1820:22: call_function: calling ‘_mountinfo_parse_line’ from ‘dm_mountinfo_read’
# 1769|   	if (*maj == 0 && (devmapper = strstr(line, "/dev/mapper/"))) {
# 1770|   		if (!(dmt = dm_task_create(DM_DEVICE_INFO))) {
# 1771|-> 			log_error("Mount info task creation failed.");
# 1772|   			return 0;
# 1773|   		}

Error: GCC_ANALYZER_WARNING (CWE-401): [#def151]
LVM2.2.03.36/device_mapper/libdm-common.c:1771:25: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(&_mountinfo, "r")’
LVM2.2.03.36/device_mapper/libdm-common.c:1802:5: enter_function: entry to ‘dm_mountinfo_read’
LVM2.2.03.36/device_mapper/libdm-common.c:1810:23: acquire_memory: allocated here
LVM2.2.03.36/device_mapper/libdm-common.c:1810:12: branch_false: following ‘false’ branch...
 branch_false: ...to here
LVM2.2.03.36/device_mapper/libdm-common.c:1818:16: branch_true: following ‘true’ branch...
LVM2.2.03.36/device_mapper/libdm-common.c:1820:22: call_function: calling ‘_mountinfo_parse_line’ from ‘dm_mountinfo_read’
# 1769|   	if (*maj == 0 && (devmapper = strstr(line, "/dev/mapper/"))) {
# 1770|   		if (!(dmt = dm_task_create(DM_DEVICE_INFO))) {
# 1771|-> 			log_error("Mount info task creation failed.");
# 1772|   			return 0;
# 1773|   		}

Error: GCC_ANALYZER_WARNING (CWE-775): [#def152]
LVM2.2.03.36/device_mapper/libdm-common.c:1856:17: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(&sysfs_path, "r")’
LVM2.2.03.36/device_mapper/libdm-common.c:1840:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/device_mapper/libdm-common.c:1847:20: branch_false: ...to here
LVM2.2.03.36/device_mapper/libdm-common.c:1847:20: acquire_resource: opened here
LVM2.2.03.36/device_mapper/libdm-common.c:1847:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/device_mapper/libdm-common.c:1855:14: branch_false: ...to here
LVM2.2.03.36/device_mapper/libdm-common.c:1855:12: branch_true: following ‘true’ branch...
LVM2.2.03.36/device_mapper/libdm-common.c:1856:17: branch_true: ...to here
LVM2.2.03.36/device_mapper/libdm-common.c:1856:17: danger: ‘fopen(&sysfs_path, "r")’ leaks here; was opened at [(3)](sarif:/runs/0/results/37/codeFlows/0/threadFlows/0/locations/2)
# 1854|   
# 1855|   	if (!fgets(temp_buf, sizeof(temp_buf), fp)) {
# 1856|-> 		log_sys_error("fgets", sysfs_path);
# 1857|   		goto bad;
# 1858|   	}

Error: GCC_ANALYZER_WARNING (CWE-401): [#def153]
LVM2.2.03.36/device_mapper/libdm-common.c:1856:17: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(&sysfs_path, "r")’
LVM2.2.03.36/device_mapper/libdm-common.c:1840:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/device_mapper/libdm-common.c:1847:20: branch_false: ...to here
LVM2.2.03.36/device_mapper/libdm-common.c:1847:20: acquire_memory: allocated here
LVM2.2.03.36/device_mapper/libdm-common.c:1847:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/device_mapper/libdm-common.c:1855:14: branch_false: ...to here
LVM2.2.03.36/device_mapper/libdm-common.c:1855:12: branch_true: following ‘true’ branch...
LVM2.2.03.36/device_mapper/libdm-common.c:1856:17: branch_true: ...to here
LVM2.2.03.36/device_mapper/libdm-common.c:1856:17: danger: ‘fopen(&sysfs_path, "r")’ leaks here; was allocated at [(3)](sarif:/runs/0/results/38/codeFlows/0/threadFlows/0/locations/2)
# 1854|   
# 1855|   	if (!fgets(temp_buf, sizeof(temp_buf), fp)) {
# 1856|-> 		log_sys_error("fgets", sysfs_path);
# 1857|   		goto bad;
# 1858|   	}

Error: GCC_ANALYZER_WARNING (CWE-775): [#def154]
LVM2.2.03.36/device_mapper/libdm-common.c:1863:17: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(&sysfs_path, "r")’
LVM2.2.03.36/device_mapper/libdm-common.c:1840:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/device_mapper/libdm-common.c:1847:20: branch_false: ...to here
LVM2.2.03.36/device_mapper/libdm-common.c:1847:20: acquire_resource: opened here
LVM2.2.03.36/device_mapper/libdm-common.c:1847:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/device_mapper/libdm-common.c:1855:14: branch_false: ...to here
LVM2.2.03.36/device_mapper/libdm-common.c:1855:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/device_mapper/libdm-common.c:1860:15: branch_false: ...to here
LVM2.2.03.36/device_mapper/libdm-common.c:1862:12: branch_true: following ‘true’ branch (when ‘len > buf_size’)...
LVM2.2.03.36/device_mapper/libdm-common.c:1863:17: branch_true: ...to here
LVM2.2.03.36/device_mapper/libdm-common.c:1863:17: danger: ‘fopen(&sysfs_path, "r")’ leaks here; was opened at [(3)](sarif:/runs/0/results/39/codeFlows/0/threadFlows/0/locations/2)
# 1861|   
# 1862|   	if (len > buf_size) {
# 1863|-> 		log_error("_sysfs_get_dm_name: supplied buffer too small.");
# 1864|   		goto bad;
# 1865|   	}

Error: GCC_ANALYZER_WARNING (CWE-401): [#def155]
LVM2.2.03.36/device_mapper/libdm-common.c:1863:17: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(&sysfs_path, "r")’
LVM2.2.03.36/device_mapper/libdm-common.c:1840:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/device_mapper/libdm-common.c:1847:20: branch_false: ...to here
LVM2.2.03.36/device_mapper/libdm-common.c:1847:20: acquire_memory: allocated here
LVM2.2.03.36/device_mapper/libdm-common.c:1847:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/device_mapper/libdm-common.c:1855:14: branch_false: ...to here
LVM2.2.03.36/device_mapper/libdm-common.c:1855:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/device_mapper/libdm-common.c:1860:15: branch_false: ...to here
LVM2.2.03.36/device_mapper/libdm-common.c:1862:12: branch_true: following ‘true’ branch (when ‘len > buf_size’)...
LVM2.2.03.36/device_mapper/libdm-common.c:1863:17: branch_true: ...to here
LVM2.2.03.36/device_mapper/libdm-common.c:1863:17: danger: ‘fopen(&sysfs_path, "r")’ leaks here; was allocated at [(3)](sarif:/runs/0/results/40/codeFlows/0/threadFlows/0/locations/2)
# 1861|   
# 1862|   	if (len > buf_size) {
# 1863|-> 		log_error("_sysfs_get_dm_name: supplied buffer too small.");
# 1864|   		goto bad;
# 1865|   	}

Error: GCC_ANALYZER_WARNING (CWE-401): [#def156]
LVM2.2.03.36/device_mapper/libdm-common.c:1920:32: warning[-Wanalyzer-malloc-leak]: leak of ‘opendir(&path)’
LVM2.2.03.36/device_mapper/libdm-common.c:1909:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/device_mapper/libdm-common.c:1910:13: branch_false: ...to here
LVM2.2.03.36/device_mapper/libdm-common.c:1909:13: branch_false: following ‘false’ branch...
LVM2.2.03.36/device_mapper/libdm-common.c:1915:19: branch_false: ...to here
LVM2.2.03.36/device_mapper/libdm-common.c:1915:19: acquire_memory: allocated here
LVM2.2.03.36/device_mapper/libdm-common.c:1915:12: branch_false: following ‘false’ branch...
 branch_false: ...to here
LVM2.2.03.36/device_mapper/libdm-common.c:1920:16: branch_true: following ‘true’ branch (when ‘r == 0’)...
LVM2.2.03.36/device_mapper/libdm-common.c:1920:32: branch_true: ...to here
LVM2.2.03.36/device_mapper/libdm-common.c:1920:32: danger: ‘opendir(&path)’ leaks here; was allocated at [(5)](sarif:/runs/0/results/41/codeFlows/0/threadFlows/0/locations/4)
# 1918|   	}
# 1919|   
# 1920|-> 	while (!r && (dirent = readdir(d))) {
# 1921|   		name = dirent->d_name;
# 1922|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def157]
LVM2.2.03.36/device_mapper/libdm-common.c:1949:46: warning[-Wanalyzer-malloc-leak]: leak of ‘opendir(&path)’
LVM2.2.03.36/device_mapper/libdm-common.c:1909:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/device_mapper/libdm-common.c:1910:13: branch_false: ...to here
LVM2.2.03.36/device_mapper/libdm-common.c:1909:13: branch_false: following ‘false’ branch...
LVM2.2.03.36/device_mapper/libdm-common.c:1915:19: branch_false: ...to here
LVM2.2.03.36/device_mapper/libdm-common.c:1915:12: branch_false: following ‘false’ branch...
 branch_false: ...to here
LVM2.2.03.36/device_mapper/libdm-common.c:1920:16: branch_true: following ‘true’ branch...
LVM2.2.03.36/device_mapper/libdm-common.c:1932:20: branch_false: following ‘false’ branch...
LVM2.2.03.36/device_mapper/libdm-common.c:1937:22: branch_false: ...to here
LVM2.2.03.36/device_mapper/libdm-common.c:1944:39: acquire_memory: allocated here
LVM2.2.03.36/device_mapper/libdm-common.c:1949:46: danger: ‘opendir(&path)’ leaks here; was allocated at [(11)](sarif:/runs/0/results/42/codeFlows/0/threadFlows/0/locations/10)
# 1947|   			}
# 1948|   
# 1949|-> 			while ((dirent_dev = readdir(d_dev))) {
# 1950|   				name_dev = dirent_dev->d_name;
# 1951|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def158]
LVM2.2.03.36/device_mapper/libdm-common.c:2004:17: warning[-Wanalyzer-malloc-leak]: leak of ‘sysfs_path’
LVM2.2.03.36/device_mapper/libdm-common.c:2002:28: acquire_memory: allocated here
LVM2.2.03.36/device_mapper/libdm-common.c:2002:12: branch_false: following ‘false’ branch (when ‘sysfs_path’ is non-NULL)...
LVM2.2.03.36/device_mapper/libdm-common.c:2003:26: branch_false: ...to here
LVM2.2.03.36/device_mapper/libdm-common.c:2002:13: branch_true: following ‘true’ branch (when ‘temp_buf’ is NULL)...
LVM2.2.03.36/device_mapper/libdm-common.c:2004:17: branch_true: ...to here
LVM2.2.03.36/device_mapper/libdm-common.c:2004:17: danger: ‘sysfs_path’ leaks here; was allocated at [(1)](sarif:/runs/0/results/43/codeFlows/0/threadFlows/0/locations/0)
# 2002|   	if (!(sysfs_path = malloc(PATH_MAX)) ||
# 2003|   	    !(temp_buf = malloc(PATH_MAX))) {
# 2004|-> 		log_error("_sysfs_get_kernel_name: failed to allocate temporary buffers");
# 2005|   		goto bad;
# 2006|   	}

Error: GCC_ANALYZER_WARNING (CWE-401): [#def159]
LVM2.2.03.36/device_mapper/libdm-common.c:2008:13: warning[-Wanalyzer-malloc-leak]: leak of ‘sysfs_path’
LVM2.2.03.36/device_mapper/libdm-common.c:2002:28: acquire_memory: allocated here
LVM2.2.03.36/device_mapper/libdm-common.c:2002:12: branch_false: following ‘false’ branch (when ‘sysfs_path’ is non-NULL)...
LVM2.2.03.36/device_mapper/libdm-common.c:2003:26: branch_false: ...to here
LVM2.2.03.36/device_mapper/libdm-common.c:2002:13: branch_false: following ‘false’ branch (when ‘temp_buf’ is non-NULL)...
LVM2.2.03.36/device_mapper/libdm-common.c:2008:13: branch_false: ...to here
LVM2.2.03.36/device_mapper/libdm-common.c:2008:13: danger: ‘sysfs_path’ leaks here; was allocated at [(1)](sarif:/runs/0/results/45/codeFlows/0/threadFlows/0/locations/0)
# 2006|   	}
# 2007|   
# 2008|-> 	if (dm_snprintf(sysfs_path, PATH_MAX, "%sdev/block/%" PRIu32 ":%" PRIu32,
# 2009|   			_sysfs_dir, major, minor) < 0) {
# 2010|   		log_error("_sysfs_get_kernel_name: dm_snprintf failed");

Error: GCC_ANALYZER_WARNING (CWE-401): [#def160]
LVM2.2.03.36/device_mapper/libdm-common.c:2008:13: warning[-Wanalyzer-malloc-leak]: leak of ‘temp_buf’
LVM2.2.03.36/device_mapper/libdm-common.c:2002:12: branch_false: following ‘false’ branch (when ‘sysfs_path’ is non-NULL)...
LVM2.2.03.36/device_mapper/libdm-common.c:2003:26: branch_false: ...to here
LVM2.2.03.36/device_mapper/libdm-common.c:2003:26: acquire_memory: allocated here
LVM2.2.03.36/device_mapper/libdm-common.c:2002:13: branch_false: following ‘false’ branch (when ‘temp_buf’ is non-NULL)...
LVM2.2.03.36/device_mapper/libdm-common.c:2008:13: branch_false: ...to here
LVM2.2.03.36/device_mapper/libdm-common.c:2008:13: danger: ‘temp_buf’ leaks here; was allocated at [(3)](sarif:/runs/0/results/44/codeFlows/0/threadFlows/0/locations/2)
# 2006|   	}
# 2007|   
# 2008|-> 	if (dm_snprintf(sysfs_path, PATH_MAX, "%sdev/block/%" PRIu32 ":%" PRIu32,
# 2009|   			_sysfs_dir, major, minor) < 0) {
# 2010|   		log_error("_sysfs_get_kernel_name: dm_snprintf failed");

Error: GCC_ANALYZER_WARNING (CWE-401): [#def161]
LVM2.2.03.36/device_mapper/libdm-common.c:2010:17: warning[-Wanalyzer-malloc-leak]: leak of ‘temp_buf’
LVM2.2.03.36/device_mapper/libdm-common.c:2002:12: branch_false: following ‘false’ branch (when ‘sysfs_path’ is non-NULL)...
LVM2.2.03.36/device_mapper/libdm-common.c:2003:26: branch_false: ...to here
LVM2.2.03.36/device_mapper/libdm-common.c:2003:26: acquire_memory: allocated here
LVM2.2.03.36/device_mapper/libdm-common.c:2002:13: branch_false: following ‘false’ branch (when ‘temp_buf’ is non-NULL)...
LVM2.2.03.36/device_mapper/libdm-common.c:2008:13: branch_false: ...to here
LVM2.2.03.36/device_mapper/libdm-common.c:2008:12: branch_true: following ‘true’ branch...
LVM2.2.03.36/device_mapper/libdm-common.c:2010:17: branch_true: ...to here
LVM2.2.03.36/device_mapper/libdm-common.c:2010:17: danger: ‘temp_buf’ leaks here; was allocated at [(3)](sarif:/runs/0/results/46/codeFlows/0/threadFlows/0/locations/2)
# 2008|   	if (dm_snprintf(sysfs_path, PATH_MAX, "%sdev/block/%" PRIu32 ":%" PRIu32,
# 2009|   			_sysfs_dir, major, minor) < 0) {
# 2010|-> 		log_error("_sysfs_get_kernel_name: dm_snprintf failed");
# 2011|   		goto bad;
# 2012|   	}

Error: GCC_ANALYZER_WARNING (CWE-401): [#def162]
LVM2.2.03.36/device_mapper/libdm-common.c:2115:26: warning[-Wanalyzer-malloc-leak]: leak of ‘opendir(&sysfs_path)’
LVM2.2.03.36/device_mapper/libdm-common.c:2104:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/device_mapper/libdm-common.c:2109:19: branch_false: ...to here
LVM2.2.03.36/device_mapper/libdm-common.c:2109:19: acquire_memory: allocated here
LVM2.2.03.36/device_mapper/libdm-common.c:2109:12: branch_false: following ‘false’ branch...
 branch_false: ...to here
LVM2.2.03.36/device_mapper/libdm-common.c:2115:26: danger: ‘opendir(&sysfs_path)’ leaks here; was allocated at [(3)](sarif:/runs/0/results/47/codeFlows/0/threadFlows/0/locations/2)
# 2113|   	}
# 2114|   
# 2115|-> 	while ((dirent = readdir(d))) {
# 2116|   		if (!strcmp(dirent->d_name, ".") || !strcmp(dirent->d_name, ".."))
# 2117|   			continue;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def163]
LVM2.2.03.36/device_mapper/libdm-common.c:2204:14: warning[-Wanalyzer-malloc-leak]: leak of ‘dm_task_create(15)’
LVM2.2.03.36/device_mapper/libdm-common.c:2193:5: enter_function: entry to ‘dm_mknodes’
LVM2.2.03.36/device_mapper/libdm-common.c:2198:21: call_function: calling ‘dm_task_create’ from ‘dm_mknodes’
LVM2.2.03.36/device_mapper/libdm-common.c:2198:21: return_function: returning to ‘dm_mknodes’ from ‘dm_task_create’
LVM2.2.03.36/device_mapper/libdm-common.c:2198:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/device_mapper/libdm-common.c:2201:12: branch_false: ...to here
LVM2.2.03.36/device_mapper/libdm-common.c:2201:12: branch_false: following ‘false’ branch (when ‘name’ is NULL)...
LVM2.2.03.36/device_mapper/libdm-common.c:2204:14: branch_false: ...to here
LVM2.2.03.36/device_mapper/libdm-common.c:2204:14: danger: ‘dm_task_create(15)’ leaks here; was allocated at [(5)](sarif:/runs/0/results/48/codeFlows/0/threadFlows/0/locations/4)
# 2202|   		goto out;
# 2203|   
# 2204|-> 	if (!dm_task_no_open_count(dmt))
# 2205|   		goto out;
# 2206|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def164]
LVM2.2.03.36/device_mapper/libdm-common.c:2222:14: warning[-Wanalyzer-malloc-leak]: leak of ‘dm_task_create(9)’
LVM2.2.03.36/device_mapper/libdm-common.c:2214:5: enter_function: entry to ‘dm_driver_version’
LVM2.2.03.36/device_mapper/libdm-common.c:2219:21: call_function: calling ‘dm_task_create’ from ‘dm_driver_version’
LVM2.2.03.36/device_mapper/libdm-common.c:2219:21: return_function: returning to ‘dm_driver_version’ from ‘dm_task_create’
LVM2.2.03.36/device_mapper/libdm-common.c:2219:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/device_mapper/libdm-common.c:2222:14: branch_false: ...to here
LVM2.2.03.36/device_mapper/libdm-common.c:2222:14: danger: ‘dm_task_create(9)’ leaks here; was allocated at [(5)](sarif:/runs/0/results/49/codeFlows/0/threadFlows/0/locations/4)
# 2220|   		return_0;
# 2221|   
# 2222|-> 	if (!dm_task_run(dmt))
# 2223|   		log_error("Failed to get driver version");
# 2224|   

Error: GCC_ANALYZER_WARNING (CWE-775): [#def165]
LVM2.2.03.36/device_mapper/libdm-common.c:2493:17: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘open("/dev/urandom", 0)’
LVM2.2.03.36/device_mapper/libdm-common.c:2505:12: enter_function: entry to ‘_udev_notify_sem_create’
LVM2.2.03.36/device_mapper/libdm-common.c:2514:19: acquire_resource: opened here
LVM2.2.03.36/device_mapper/libdm-common.c:2514:12: branch_false: following ‘false’ branch...
 branch_false: ...to here
LVM2.2.03.36/device_mapper/libdm-common.c:2524:20: branch_false: following ‘false’ branch...
LVM2.2.03.36/device_mapper/libdm-common.c:2529:30: branch_false: ...to here
LVM2.2.03.36/device_mapper/libdm-common.c:2562:12: branch_true: following ‘true’ branch...
LVM2.2.03.36/device_mapper/libdm-common.c:2563:17: branch_true: ...to here
LVM2.2.03.36/device_mapper/libdm-common.c:2566:24: call_function: calling ‘_udev_notify_sem_destroy’ from ‘_udev_notify_sem_create’
# 2491|   {
# 2492|   	if (semctl(semid, 0, IPC_RMID, 0) < 0) {
# 2493|-> 		log_error("Could not cleanup notification semaphore "
# 2494|   			  "identified by cookie value %" PRIu32 " (0x%x): %s",
# 2495|   			  cookie, cookie, strerror(errno));

Error: GCC_ANALYZER_WARNING (CWE-775): [#def166]
LVM2.2.03.36/device_mapper/libdm-common.c:2499:9: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘open("/dev/urandom", 0)’
LVM2.2.03.36/device_mapper/libdm-common.c:2505:12: enter_function: entry to ‘_udev_notify_sem_create’
LVM2.2.03.36/device_mapper/libdm-common.c:2514:19: acquire_resource: opened here
LVM2.2.03.36/device_mapper/libdm-common.c:2514:12: branch_false: following ‘false’ branch...
 branch_false: ...to here
LVM2.2.03.36/device_mapper/libdm-common.c:2524:20: branch_false: following ‘false’ branch...
LVM2.2.03.36/device_mapper/libdm-common.c:2529:30: branch_false: ...to here
LVM2.2.03.36/device_mapper/libdm-common.c:2562:12: branch_true: following ‘true’ branch...
LVM2.2.03.36/device_mapper/libdm-common.c:2563:17: branch_true: ...to here
LVM2.2.03.36/device_mapper/libdm-common.c:2566:24: call_function: calling ‘_udev_notify_sem_destroy’ from ‘_udev_notify_sem_create’
# 2497|   	}
# 2498|   
# 2499|-> 	log_debug_activation("Udev cookie 0x%" PRIx32 " (semid %d) destroyed", cookie,
# 2500|   			     semid);
# 2501|   

Error: GCC_ANALYZER_WARNING (CWE-775): [#def167]
LVM2.2.03.36/device_mapper/libdm-common.c:2525:25: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘open("/dev/urandom", 0)’
LVM2.2.03.36/device_mapper/libdm-common.c:2514:19: acquire_resource: opened here
LVM2.2.03.36/device_mapper/libdm-common.c:2514:12: branch_false: following ‘false’ branch...
 branch_false: ...to here
LVM2.2.03.36/device_mapper/libdm-common.c:2525:25: danger: ‘open("/dev/urandom", 0)’ leaks here; was opened at [(1)](sarif:/runs/0/results/52/codeFlows/0/threadFlows/0/locations/0)
# 2523|   		/* FIXME Handle non-error returns from read(). Move _io() into libdm? */
# 2524|   		if (read(fd, &base_cookie, sizeof(base_cookie)) != sizeof(base_cookie)) {
# 2525|-> 			log_error("Failed to initialize notification cookie");
# 2526|   			goto bad;
# 2527|   		}

Error: GCC_ANALYZER_WARNING (CWE-775): [#def168]
LVM2.2.03.36/device_mapper/libdm-common.c:2540:41: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘open("/dev/urandom", 0)’
LVM2.2.03.36/device_mapper/libdm-common.c:2514:19: acquire_resource: opened here
LVM2.2.03.36/device_mapper/libdm-common.c:2514:12: branch_false: following ‘false’ branch...
 branch_false: ...to here
LVM2.2.03.36/device_mapper/libdm-common.c:2524:20: branch_false: following ‘false’ branch...
LVM2.2.03.36/device_mapper/libdm-common.c:2529:30: branch_false: ...to here
LVM2.2.03.36/device_mapper/libdm-common.c:2540:41: danger: ‘open("/dev/urandom", 0)’ leaks here; was opened at [(1)](sarif:/runs/0/results/53/codeFlows/0/threadFlows/0/locations/0)
# 2538|   					break;
# 2539|   				case ENOMEM:
# 2540|-> 					log_error("Not enough memory to create "
# 2541|   						  "notification semaphore");
# 2542|   					goto bad;

Error: GCC_ANALYZER_WARNING (CWE-775): [#def169]
LVM2.2.03.36/device_mapper/libdm-common.c:2544:41: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘open("/dev/urandom", 0)’
LVM2.2.03.36/device_mapper/libdm-common.c:2514:19: acquire_resource: opened here
LVM2.2.03.36/device_mapper/libdm-common.c:2514:12: branch_false: following ‘false’ branch...
 branch_false: ...to here
LVM2.2.03.36/device_mapper/libdm-common.c:2524:20: branch_false: following ‘false’ branch...
LVM2.2.03.36/device_mapper/libdm-common.c:2529:30: branch_false: ...to here
LVM2.2.03.36/device_mapper/libdm-common.c:2544:41: danger: ‘open("/dev/urandom", 0)’ leaks here; was opened at [(1)](sarif:/runs/0/results/54/codeFlows/0/threadFlows/0/locations/0)
# 2542|   					goto bad;
# 2543|   				case ENOSPC:
# 2544|-> 					log_error("Limit for the maximum number "
# 2545|   						  "of semaphores reached. You can "
# 2546|   						  "check and set the limits in "

Error: GCC_ANALYZER_WARNING (CWE-775): [#def170]
LVM2.2.03.36/device_mapper/libdm-common.c:2550:41: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘open("/dev/urandom", 0)’
LVM2.2.03.36/device_mapper/libdm-common.c:2514:19: acquire_resource: opened here
LVM2.2.03.36/device_mapper/libdm-common.c:2514:12: branch_false: following ‘false’ branch...
 branch_false: ...to here
LVM2.2.03.36/device_mapper/libdm-common.c:2524:20: branch_false: following ‘false’ branch...
LVM2.2.03.36/device_mapper/libdm-common.c:2529:30: branch_false: ...to here
LVM2.2.03.36/device_mapper/libdm-common.c:2550:41: danger: ‘open("/dev/urandom", 0)’ leaks here; was opened at [(1)](sarif:/runs/0/results/55/codeFlows/0/threadFlows/0/locations/0)
# 2548|   					goto bad;
# 2549|   				default:
# 2550|-> 					log_error("Failed to create notification "
# 2551|   						  "semaphore: %s", strerror(errno));
# 2552|   					goto bad;

Error: GCC_ANALYZER_WARNING (CWE-775): [#def171]
LVM2.2.03.36/device_mapper/libdm-common.c:2557:9: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘open("/dev/urandom", 0)’
LVM2.2.03.36/device_mapper/libdm-common.c:2514:19: acquire_resource: opened here
LVM2.2.03.36/device_mapper/libdm-common.c:2514:12: branch_false: following ‘false’ branch...
 branch_false: ...to here
LVM2.2.03.36/device_mapper/libdm-common.c:2524:20: branch_false: following ‘false’ branch...
LVM2.2.03.36/device_mapper/libdm-common.c:2529:30: branch_false: ...to here
LVM2.2.03.36/device_mapper/libdm-common.c:2557:9: danger: ‘open("/dev/urandom", 0)’ leaks here; was opened at [(1)](sarif:/runs/0/results/56/codeFlows/0/threadFlows/0/locations/0)
# 2555|   	} while (!base_cookie);
# 2556|   
# 2557|-> 	log_debug_activation("Udev cookie 0x%" PRIx32 " (semid %d) created",
# 2558|   			     gen_cookie, gen_semid);
# 2559|   

Error: GCC_ANALYZER_WARNING (CWE-775): [#def172]
LVM2.2.03.36/device_mapper/libdm-common.c:2563:17: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘open("/dev/urandom", 0)’
LVM2.2.03.36/device_mapper/libdm-common.c:2514:19: acquire_resource: opened here
LVM2.2.03.36/device_mapper/libdm-common.c:2514:12: branch_false: following ‘false’ branch...
 branch_false: ...to here
LVM2.2.03.36/device_mapper/libdm-common.c:2524:20: branch_false: following ‘false’ branch...
LVM2.2.03.36/device_mapper/libdm-common.c:2529:30: branch_false: ...to here
LVM2.2.03.36/device_mapper/libdm-common.c:2562:12: branch_true: following ‘true’ branch...
LVM2.2.03.36/device_mapper/libdm-common.c:2563:17: branch_true: ...to here
LVM2.2.03.36/device_mapper/libdm-common.c:2563:17: danger: ‘open("/dev/urandom", 0)’ leaks here; was opened at [(1)](sarif:/runs/0/results/57/codeFlows/0/threadFlows/0/locations/0)
# 2561|   
# 2562|   	if (semctl(gen_semid, 0, SETVAL, sem_arg) < 0) {
# 2563|-> 		log_error("cookie create: semid %d: semctl failed: %s", gen_semid, strerror(errno));
# 2564|   		/* We have to destroy just created semaphore
# 2565|   		 * so it won't stay in the system. */

Error: GCC_ANALYZER_WARNING (CWE-775): [#def173]
LVM2.2.03.36/device_mapper/libdm-common.c:2571:17: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘open("/dev/urandom", 0)’
LVM2.2.03.36/device_mapper/libdm-common.c:2514:19: acquire_resource: opened here
LVM2.2.03.36/device_mapper/libdm-common.c:2514:12: branch_false: following ‘false’ branch...
 branch_false: ...to here
LVM2.2.03.36/device_mapper/libdm-common.c:2524:20: branch_false: following ‘false’ branch...
LVM2.2.03.36/device_mapper/libdm-common.c:2529:30: branch_false: ...to here
LVM2.2.03.36/device_mapper/libdm-common.c:2562:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/device_mapper/libdm-common.c:2570:20: branch_false: ...to here
LVM2.2.03.36/device_mapper/libdm-common.c:2570:12: branch_true: following ‘true’ branch (when ‘val < 0’)...
LVM2.2.03.36/device_mapper/libdm-common.c:2571:17: branch_true: ...to here
LVM2.2.03.36/device_mapper/libdm-common.c:2571:17: danger: ‘open("/dev/urandom", 0)’ leaks here; was opened at [(1)](sarif:/runs/0/results/58/codeFlows/0/threadFlows/0/locations/0)
# 2569|   
# 2570|    	if ((val = semctl(gen_semid, 0, GETVAL)) < 0) {
# 2571|-> 		log_error("cookie create: semid %d: sem_ctl GETVAL failed for "
# 2572|   			  "cookie 0x%" PRIx32 ": %s",
# 2573|   			  gen_semid, gen_cookie, strerror(errno));

Error: GCC_ANALYZER_WARNING (CWE-775): [#def174]
LVM2.2.03.36/device_mapper/libdm-common.c:2578:9: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘open("/dev/urandom", 0)’
LVM2.2.03.36/device_mapper/libdm-common.c:2514:19: acquire_resource: opened here
LVM2.2.03.36/device_mapper/libdm-common.c:2514:12: branch_false: following ‘false’ branch...
 branch_false: ...to here
LVM2.2.03.36/device_mapper/libdm-common.c:2524:20: branch_false: following ‘false’ branch...
LVM2.2.03.36/device_mapper/libdm-common.c:2529:30: branch_false: ...to here
LVM2.2.03.36/device_mapper/libdm-common.c:2562:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/device_mapper/libdm-common.c:2570:20: branch_false: ...to here
LVM2.2.03.36/device_mapper/libdm-common.c:2570:12: branch_false: following ‘false’ branch (when ‘val >= 0’)...
LVM2.2.03.36/device_mapper/libdm-common.c:2578:9: branch_false: ...to here
LVM2.2.03.36/device_mapper/libdm-common.c:2578:9: danger: ‘open("/dev/urandom", 0)’ leaks here; was opened at [(1)](sarif:/runs/0/results/59/codeFlows/0/threadFlows/0/locations/0)
# 2576|   	}
# 2577|   
# 2578|-> 	log_debug_activation("Udev cookie 0x%" PRIx32 " (semid %d) incremented to %d",
# 2579|   			     gen_cookie, gen_semid, val);
# 2580|   

Error: GCC_ANALYZER_WARNING (CWE-775): [#def175]
LVM2.2.03.36/device_mapper/libdm-common.c:2581:12: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘open("/dev/urandom", 0)’
LVM2.2.03.36/device_mapper/libdm-common.c:2514:19: acquire_resource: opened here
LVM2.2.03.36/device_mapper/libdm-common.c:2514:12: branch_false: following ‘false’ branch...
 branch_false: ...to here
LVM2.2.03.36/device_mapper/libdm-common.c:2524:20: branch_false: following ‘false’ branch...
LVM2.2.03.36/device_mapper/libdm-common.c:2529:30: branch_false: ...to here
LVM2.2.03.36/device_mapper/libdm-common.c:2562:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/device_mapper/libdm-common.c:2570:20: branch_false: ...to here
LVM2.2.03.36/device_mapper/libdm-common.c:2570:12: branch_false: following ‘false’ branch (when ‘val >= 0’)...
LVM2.2.03.36/device_mapper/libdm-common.c:2578:9: branch_false: ...to here
LVM2.2.03.36/device_mapper/libdm-common.c:2581:12: danger: ‘open("/dev/urandom", 0)’ leaks here; was opened at [(1)](sarif:/runs/0/results/60/codeFlows/0/threadFlows/0/locations/0)
# 2579|   			     gen_cookie, gen_semid, val);
# 2580|   
# 2581|-> 	if (close(fd))
# 2582|   		stack;
# 2583|   

Error: GCC_ANALYZER_WARNING (CWE-775): [#def176]
LVM2.2.03.36/device_mapper/libdm-common.c:2590:12: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘open("/dev/urandom", 0)’
LVM2.2.03.36/device_mapper/libdm-common.c:2514:19: acquire_resource: opened here
LVM2.2.03.36/device_mapper/libdm-common.c:2514:12: branch_false: following ‘false’ branch...
 branch_false: ...to here
LVM2.2.03.36/device_mapper/libdm-common.c:2590:12: danger: ‘open("/dev/urandom", 0)’ leaks here; was opened at [(1)](sarif:/runs/0/results/61/codeFlows/0/threadFlows/0/locations/0)
# 2588|   
# 2589|   bad:
# 2590|-> 	if (close(fd))
# 2591|   		stack;
# 2592|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def177]
LVM2.2.03.36/device_mapper/libdm-file.c:28:17: warning[-Wanalyzer-malloc-leak]: leak of ‘s’
LVM2.2.03.36/device_mapper/libdm-file.c:41:12: enter_function: entry to ‘_create_dir_recursive’
LVM2.2.03.36/device_mapper/libdm-file.c:48:20: acquire_memory: allocated here
LVM2.2.03.36/device_mapper/libdm-file.c:49:12: branch_false: following ‘false’ branch (when ‘s’ is non-NULL)...
 branch_false: ...to here
LVM2.2.03.36/device_mapper/libdm-file.c:54:16: branch_false: following ‘false’ branch (when ‘s’ is NULL)...
LVM2.2.03.36/device_mapper/libdm-file.c:73:14: branch_false: ...to here
LVM2.2.03.36/device_mapper/libdm-file.c:74:12: branch_true: following ‘true’ branch (when ‘rc < 0’)...
LVM2.2.03.36/device_mapper/libdm-file.c:75:21: branch_true: ...to here
LVM2.2.03.36/device_mapper/libdm-file.c:75:20: branch_true: following ‘true’ branch...
LVM2.2.03.36/device_mapper/libdm-file.c:76:30: branch_true: ...to here
LVM2.2.03.36/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): [#def178]
LVM2.2.03.36/device_mapper/libdm-file.c:33:17: warning[-Wanalyzer-malloc-leak]: leak of ‘s’
LVM2.2.03.36/device_mapper/libdm-file.c:41:12: enter_function: entry to ‘_create_dir_recursive’
LVM2.2.03.36/device_mapper/libdm-file.c:48:20: acquire_memory: allocated here
LVM2.2.03.36/device_mapper/libdm-file.c:49:12: branch_false: following ‘false’ branch (when ‘s’ is non-NULL)...
 branch_false: ...to here
LVM2.2.03.36/device_mapper/libdm-file.c:54:16: branch_false: following ‘false’ branch (when ‘s’ is NULL)...
LVM2.2.03.36/device_mapper/libdm-file.c:73:14: branch_false: ...to here
LVM2.2.03.36/device_mapper/libdm-file.c:74:12: branch_true: following ‘true’ branch (when ‘rc < 0’)...
LVM2.2.03.36/device_mapper/libdm-file.c:75:21: branch_true: ...to here
LVM2.2.03.36/device_mapper/libdm-file.c:75:20: branch_true: following ‘true’ branch...
LVM2.2.03.36/device_mapper/libdm-file.c:76:30: branch_true: ...to here
LVM2.2.03.36/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): [#def179]
LVM2.2.03.36/device_mapper/libdm-file.c:64:49: warning[-Wanalyzer-malloc-leak]: leak of ‘s’
LVM2.2.03.36/device_mapper/libdm-file.c:48:20: acquire_memory: allocated here
LVM2.2.03.36/device_mapper/libdm-file.c:49:12: branch_false: following ‘false’ branch (when ‘s’ is non-NULL)...
 branch_false: ...to here
LVM2.2.03.36/device_mapper/libdm-file.c:54:16: branch_true: following ‘true’ branch (when ‘s’ is non-NULL)...
LVM2.2.03.36/device_mapper/libdm-file.c:55:17: branch_true: ...to here
LVM2.2.03.36/device_mapper/libdm-file.c:56:20: branch_true: following ‘true’ branch...
LVM2.2.03.36/device_mapper/libdm-file.c:57:30: branch_true: ...to here
LVM2.2.03.36/device_mapper/libdm-file.c:58:28: branch_true: following ‘true’ branch (when ‘rc < 0’)...
LVM2.2.03.36/device_mapper/libdm-file.c:59:37: branch_true: ...to here
LVM2.2.03.36/device_mapper/libdm-file.c:59:36: branch_false: following ‘false’ branch...
LVM2.2.03.36/device_mapper/libdm-file.c:63:44: branch_false: ...to here
LVM2.2.03.36/device_mapper/libdm-file.c:63:44: branch_true: following ‘true’ branch...
LVM2.2.03.36/device_mapper/libdm-file.c:64:49: branch_true: ...to here
LVM2.2.03.36/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): [#def180]
LVM2.2.03.36/device_mapper/libdm-file.c:77:33: warning[-Wanalyzer-malloc-leak]: leak of ‘s’
LVM2.2.03.36/device_mapper/libdm-file.c:48:20: acquire_memory: allocated here
LVM2.2.03.36/device_mapper/libdm-file.c:49:12: branch_false: following ‘false’ branch (when ‘s’ is non-NULL)...
 branch_false: ...to here
LVM2.2.03.36/device_mapper/libdm-file.c:54:16: branch_false: following ‘false’ branch (when ‘s’ is NULL)...
LVM2.2.03.36/device_mapper/libdm-file.c:73:14: branch_false: ...to here
LVM2.2.03.36/device_mapper/libdm-file.c:74:12: branch_true: following ‘true’ branch (when ‘rc < 0’)...
LVM2.2.03.36/device_mapper/libdm-file.c:75:21: branch_true: ...to here
LVM2.2.03.36/device_mapper/libdm-file.c:75:20: branch_true: following ‘true’ branch...
LVM2.2.03.36/device_mapper/libdm-file.c:76:30: branch_true: ...to here
LVM2.2.03.36/device_mapper/libdm-file.c:76:28: branch_true: following ‘true’ branch...
LVM2.2.03.36/device_mapper/libdm-file.c:77:33: branch_true: ...to here
LVM2.2.03.36/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): [#def181]
LVM2.2.03.36/device_mapper/libdm-file.c:80:33: warning[-Wanalyzer-malloc-leak]: leak of ‘s’
LVM2.2.03.36/device_mapper/libdm-file.c:48:20: acquire_memory: allocated here
LVM2.2.03.36/device_mapper/libdm-file.c:49:12: branch_false: following ‘false’ branch (when ‘s’ is non-NULL)...
 branch_false: ...to here
LVM2.2.03.36/device_mapper/libdm-file.c:54:16: branch_false: following ‘false’ branch (when ‘s’ is NULL)...
LVM2.2.03.36/device_mapper/libdm-file.c:73:14: branch_false: ...to here
LVM2.2.03.36/device_mapper/libdm-file.c:74:12: branch_true: following ‘true’ branch (when ‘rc < 0’)...
LVM2.2.03.36/device_mapper/libdm-file.c:75:21: branch_true: ...to here
LVM2.2.03.36/device_mapper/libdm-file.c:75:20: branch_false: following ‘false’ branch...
LVM2.2.03.36/device_mapper/libdm-file.c:79:28: branch_false: ...to here
LVM2.2.03.36/device_mapper/libdm-file.c:79:28: branch_true: following ‘true’ branch...
LVM2.2.03.36/device_mapper/libdm-file.c:80:33: branch_true: ...to here
LVM2.2.03.36/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): [#def182]
LVM2.2.03.36/device_mapper/libdm-file.c:117:26: warning[-Wanalyzer-malloc-leak]: leak of ‘opendir(dir)’
LVM2.2.03.36/device_mapper/libdm-file.c:112:19: acquire_memory: allocated here
LVM2.2.03.36/device_mapper/libdm-file.c:112:12: branch_false: following ‘false’ branch...
 branch_false: ...to here
LVM2.2.03.36/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): [#def183]
LVM2.2.03.36/device_mapper/libdm-file.c:250:12: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘open(lockfile, 0)’
LVM2.2.03.36/device_mapper/libdm-file.c:243:17: acquire_resource: opened here
LVM2.2.03.36/device_mapper/libdm-file.c:243:10: branch_false: following ‘false’ branch...
LVM2.2.03.36/device_mapper/libdm-file.c:246:8: branch_false: ...to here
LVM2.2.03.36/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): [#def184]
LVM2.2.03.36/device_mapper/libdm-report.c:1366:9: warning[-Wanalyzer-malloc-leak]: leak of ‘calloc(1, 160)’
LVM2.2.03.36/device_mapper/libdm-report.c:4432:19: enter_function: entry to ‘dm_report_init_with_selection’
LVM2.2.03.36/device_mapper/libdm-report.c:4447:20: call_function: calling ‘dm_report_init’ from ‘dm_report_init_with_selection’
# 1364|   	rh->flags |= RH_FIELD_CALC_NEEDED;
# 1365|   
# 1366|-> 	dm_list_init(&rh->field_props);
# 1367|   	dm_list_init(&rh->rows);
# 1368|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def185]
LVM2.2.03.36/device_mapper/libdm-report.c:4807:29: warning[-Wanalyzer-malloc-leak]: leak of ‘buf’
LVM2.2.03.36/device_mapper/libdm-report.c:4788:12: branch_true: following ‘true’ branch...
LVM2.2.03.36/device_mapper/libdm-report.c:4789:31: branch_true: ...to here
LVM2.2.03.36/device_mapper/libdm-report.c:4798:20: branch_false: following ‘false’ branch (when ‘buf_size > 8191’)...
LVM2.2.03.36/device_mapper/libdm-report.c:4801:34: branch_false: ...to here
LVM2.2.03.36/device_mapper/libdm-report.c:4801:34: acquire_memory: allocated here
LVM2.2.03.36/device_mapper/libdm-report.c:4801:25: branch_false: following ‘false’ branch (when ‘buf’ is non-NULL)...
LVM2.2.03.36/device_mapper/libdm-report.c:4806:21: branch_false: ...to here
LVM2.2.03.36/device_mapper/libdm-report.c:4806:20: branch_true: following ‘true’ branch...
LVM2.2.03.36/device_mapper/libdm-report.c:4807:29: branch_true: ...to here
LVM2.2.03.36/device_mapper/libdm-report.c:4807:29: danger: ‘buf’ leaks here; was allocated at [(5)](sarif:/runs/0/results/1/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): [#def186]
LVM2.2.03.36/device_mapper/libdm-report.c:4817:29: warning[-Wanalyzer-malloc-leak]: leak of ‘buf’
LVM2.2.03.36/device_mapper/libdm-report.c:4788:12: branch_true: following ‘true’ branch...
LVM2.2.03.36/device_mapper/libdm-report.c:4789:31: branch_true: ...to here
LVM2.2.03.36/device_mapper/libdm-report.c:4798:20: branch_false: following ‘false’ branch (when ‘buf_size > 8191’)...
LVM2.2.03.36/device_mapper/libdm-report.c:4801:34: branch_false: ...to here
LVM2.2.03.36/device_mapper/libdm-report.c:4801:34: acquire_memory: allocated here
LVM2.2.03.36/device_mapper/libdm-report.c:4801:25: branch_false: following ‘false’ branch (when ‘buf’ is non-NULL)...
LVM2.2.03.36/device_mapper/libdm-report.c:4806:21: branch_false: ...to here
LVM2.2.03.36/device_mapper/libdm-report.c:4806:20: branch_false: following ‘false’ branch...
LVM2.2.03.36/device_mapper/libdm-report.c:4816:28: branch_false: ...to here
LVM2.2.03.36/device_mapper/libdm-report.c:4816:27: branch_true: following ‘true’ branch...
LVM2.2.03.36/device_mapper/libdm-report.c:4817:29: branch_true: ...to here
LVM2.2.03.36/device_mapper/libdm-report.c:4817:29: danger: ‘buf’ leaks here; was allocated at [(5)](sarif:/runs/0/results/2/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): [#def187]
LVM2.2.03.36/device_mapper/libdm-report.c:4836:30: warning[-Wanalyzer-malloc-leak]: leak of ‘buf’
LVM2.2.03.36/device_mapper/libdm-report.c:4757:20: branch_false: following ‘false’ branch (when ‘buf_size <= 8191’)...
LVM2.2.03.36/device_mapper/libdm-report.c:4764:17: branch_false: ...to here
LVM2.2.03.36/device_mapper/libdm-report.c:4766:20: branch_false: following ‘false’ branch...
LVM2.2.03.36/device_mapper/libdm-report.c:4771:51: branch_false: ...to here
LVM2.2.03.36/device_mapper/libdm-report.c:4771:20: branch_false: following ‘false’ branch...
LVM2.2.03.36/device_mapper/libdm-report.c:4776:22: branch_false: ...to here
LVM2.2.03.36/device_mapper/libdm-report.c:4776:20: branch_false: following ‘false’ branch...
LVM2.2.03.36/device_mapper/libdm-report.c:4781:23: branch_false: ...to here
LVM2.2.03.36/device_mapper/libdm-report.c:4788:12: branch_true: following ‘true’ branch...
LVM2.2.03.36/device_mapper/libdm-report.c:4789:31: branch_true: ...to here
LVM2.2.03.36/device_mapper/libdm-report.c:4798:20: branch_false: following ‘false’ branch (when ‘buf_size > 8191’)...
LVM2.2.03.36/device_mapper/libdm-report.c:4801:34: branch_false: ...to here
LVM2.2.03.36/device_mapper/libdm-report.c:4801:34: acquire_memory: allocated here
LVM2.2.03.36/device_mapper/libdm-report.c:4801:25: branch_false: following ‘false’ branch (when ‘buf’ is non-NULL)...
LVM2.2.03.36/device_mapper/libdm-report.c:4806:21: branch_false: ...to here
LVM2.2.03.36/device_mapper/libdm-report.c:4806:20: branch_false: following ‘false’ branch...
LVM2.2.03.36/device_mapper/libdm-report.c:4816:28: branch_false: ...to here
LVM2.2.03.36/device_mapper/libdm-report.c:4816:27: branch_false: following ‘false’ branch...
 branch_false: ...to here
LVM2.2.03.36/device_mapper/libdm-report.c:4834:12: branch_true: following ‘true’ branch...
LVM2.2.03.36/device_mapper/libdm-report.c:4835:22: branch_true: ...to here
LVM2.2.03.36/device_mapper/libdm-report.c:4835:20: branch_true: following ‘true’ branch...
LVM2.2.03.36/device_mapper/libdm-report.c:4836:30: branch_true: ...to here
LVM2.2.03.36/device_mapper/libdm-report.c:4836:30: danger: ‘buf’ leaks here; was allocated at [(13)](sarif:/runs/0/results/3/codeFlows/0/threadFlows/0/locations/12)
# 4834|   	if (rh->flags & DM_REPORT_OUTPUT_FIELD_NAME_PREFIX) {
# 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;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def188]
LVM2.2.03.36/device_mapper/libdm-report.c:4837:33: warning[-Wanalyzer-malloc-leak]: leak of ‘buf’
LVM2.2.03.36/device_mapper/libdm-report.c:4757:20: branch_false: following ‘false’ branch (when ‘buf_size <= 8191’)...
LVM2.2.03.36/device_mapper/libdm-report.c:4764:17: branch_false: ...to here
LVM2.2.03.36/device_mapper/libdm-report.c:4766:20: branch_false: following ‘false’ branch...
LVM2.2.03.36/device_mapper/libdm-report.c:4771:51: branch_false: ...to here
LVM2.2.03.36/device_mapper/libdm-report.c:4771:20: branch_false: following ‘false’ branch...
LVM2.2.03.36/device_mapper/libdm-report.c:4776:22: branch_false: ...to here
LVM2.2.03.36/device_mapper/libdm-report.c:4776:20: branch_false: following ‘false’ branch...
LVM2.2.03.36/device_mapper/libdm-report.c:4781:23: branch_false: ...to here
LVM2.2.03.36/device_mapper/libdm-report.c:4788:12: branch_true: following ‘true’ branch...
LVM2.2.03.36/device_mapper/libdm-report.c:4789:31: branch_true: ...to here
LVM2.2.03.36/device_mapper/libdm-report.c:4798:20: branch_false: following ‘false’ branch (when ‘buf_size > 8191’)...
LVM2.2.03.36/device_mapper/libdm-report.c:4801:34: branch_false: ...to here
LVM2.2.03.36/device_mapper/libdm-report.c:4801:34: acquire_memory: allocated here
LVM2.2.03.36/device_mapper/libdm-report.c:4801:25: branch_false: following ‘false’ branch (when ‘buf’ is non-NULL)...
LVM2.2.03.36/device_mapper/libdm-report.c:4806:21: branch_false: ...to here
LVM2.2.03.36/device_mapper/libdm-report.c:4806:20: branch_false: following ‘false’ branch...
LVM2.2.03.36/device_mapper/libdm-report.c:4816:28: branch_false: ...to here
LVM2.2.03.36/device_mapper/libdm-report.c:4816:27: branch_false: following ‘false’ branch...
 branch_false: ...to here
LVM2.2.03.36/device_mapper/libdm-report.c:4834:12: branch_true: following ‘true’ branch...
LVM2.2.03.36/device_mapper/libdm-report.c:4835:22: branch_true: ...to here
LVM2.2.03.36/device_mapper/libdm-report.c:4835:20: branch_true: following ‘true’ branch...
LVM2.2.03.36/device_mapper/libdm-report.c:4836:30: branch_true: ...to here
LVM2.2.03.36/device_mapper/libdm-report.c:4836:28: branch_true: following ‘true’ branch...
LVM2.2.03.36/device_mapper/libdm-report.c:4837:33: branch_true: ...to here
LVM2.2.03.36/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): [#def189]
LVM2.2.03.36/device_mapper/mm/pool-fast.c:67:9: warning[-Wanalyzer-malloc-leak]: leak of ‘calloc(1, 72)’
LVM2.2.03.36/device_mapper/mm/pool-fast.c:49:17: enter_function: entry to ‘dm_pool_create’
LVM2.2.03.36/device_mapper/mm/pool-fast.c:52:29: call_function: inlined call to ‘zalloc’ from ‘dm_pool_create’
LVM2.2.03.36/device_mapper/mm/pool-fast.c:54:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/device_mapper/mm/pool-fast.c:60:9: branch_false: ...to here
LVM2.2.03.36/device_mapper/mm/pool-fast.c:67:9: danger: ‘calloc(1, 72)’ leaks here; was allocated at [(3)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/2)
#   65|   	p->chunk_size = new_size;
#   66|   	pthread_mutex_lock(&_dm_pools_mutex);
#   67|-> 	dm_list_add(&_dm_pools, &p->list);
#   68|   	pthread_mutex_unlock(&_dm_pools_mutex);
#   69|   	return p;

Error: GCC_ANALYZER_WARNING (CWE-775): [#def190]
LVM2.2.03.36/device_mapper/raid/raid_parser.c:118:17: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘open(dev_path,  <unknown>)’
 branch_true: following ‘true’ branch...
LVM2.2.03.36/device_mapper/raid/raid_parser.c:111:14: branch_true: ...to here
LVM2.2.03.36/device_mapper/raid/raid_parser.c:111:14: acquire_resource: opened here
LVM2.2.03.36/device_mapper/raid/raid_parser.c:112:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/device_mapper/raid/raid_parser.c:117:13: branch_false: ...to here
LVM2.2.03.36/device_mapper/raid/raid_parser.c:117:12: branch_true: following ‘true’ branch...
LVM2.2.03.36/device_mapper/raid/raid_parser.c:118:17: branch_true: ...to here
LVM2.2.03.36/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): [#def191]
LVM2.2.03.36/device_mapper/raid/raid_parser.c:124:17: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘open(dev_path,  <unknown>)’
 branch_true: following ‘true’ branch...
LVM2.2.03.36/device_mapper/raid/raid_parser.c:111:14: branch_true: ...to here
LVM2.2.03.36/device_mapper/raid/raid_parser.c:111:14: acquire_resource: opened here
LVM2.2.03.36/device_mapper/raid/raid_parser.c:112:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/device_mapper/raid/raid_parser.c:117:13: branch_false: ...to here
LVM2.2.03.36/device_mapper/raid/raid_parser.c:117:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/device_mapper/raid/raid_parser.c:123:13: branch_false: ...to here
LVM2.2.03.36/device_mapper/raid/raid_parser.c:123:12: branch_true: following ‘true’ branch...
LVM2.2.03.36/device_mapper/raid/raid_parser.c:124:17: branch_true: ...to here
LVM2.2.03.36/device_mapper/raid/raid_parser.c:124:17: danger: ‘open(dev_path,  <unknown>)’ leaks here; was opened at [(3)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/2)
#  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;
#  126|   	}

Error: GCC_ANALYZER_WARNING (CWE-775): [#def192]
LVM2.2.03.36/device_mapper/raid/raid_parser.c:149:13: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘open(dev_path,  <unknown>)’
 branch_true: following ‘true’ branch...
LVM2.2.03.36/device_mapper/raid/raid_parser.c:111:14: branch_true: ...to here
LVM2.2.03.36/device_mapper/raid/raid_parser.c:111:14: acquire_resource: opened here
LVM2.2.03.36/device_mapper/raid/raid_parser.c:112:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/device_mapper/raid/raid_parser.c:117:13: branch_false: ...to here
LVM2.2.03.36/device_mapper/raid/raid_parser.c:149:12: branch_true: following ‘true’ branch...
LVM2.2.03.36/device_mapper/raid/raid_parser.c:149:26: branch_true: ...to here
LVM2.2.03.36/device_mapper/raid/raid_parser.c:149:13: danger: ‘open(dev_path,  <unknown>)’ leaks here; was opened at [(3)](sarif:/runs/0/results/2/codeFlows/0/threadFlows/0/locations/2)
#  147|   
#  148|   out:
#  149|-> 	if ((fd >= 0) && close(fd))
#  150|   		log_sys_debug("close", dev_path);
#  151|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def193]
LVM2.2.03.36/lib/activate/dev_manager.c:2454:26: warning[-Wanalyzer-malloc-leak]: leak of ‘opendir(&sysfs_path)’
LVM2.2.03.36/lib/activate/dev_manager.c:4063:12: enter_function: entry to ‘_tree_action’
LVM2.2.03.36/lib/activate/dev_manager.c:4096:17: call_function: calling ‘_create_partial_dtree’ from ‘_tree_action’
# 2452|   	}
# 2453|   
# 2454|-> 	while ((dirent = readdir(d)))
# 2455|   		/* Expects minor is added to 'dm-' prefix */
# 2456|   		if (!strncmp(dirent->d_name, "dm-", 3) &&

Error: GCC_ANALYZER_WARNING (CWE-401): [#def194]
LVM2.2.03.36/lib/activate/fs.c:100:26: warning[-Wanalyzer-malloc-leak]: leak of ‘opendir(dir)’
LVM2.2.03.36/lib/activate/fs.c:474:5: enter_function: entry to ‘fs_rename_lv’
LVM2.2.03.36/lib/activate/fs.c:477:12: branch_false: following ‘false’ branch (when the strings are equal)...
LVM2.2.03.36/lib/activate/fs.c:486:40: branch_false: ...to here
LVM2.2.03.36/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): [#def195]
LVM2.2.03.36/lib/cache/lvmcache.c:233:25: warning[-Wanalyzer-malloc-leak]: leak of ‘calloc(1, 24)’
LVM2.2.03.36/lib/cache/lvmcache.c:214:6: enter_function: entry to ‘lvmcache_get_bad_mdas’
LVM2.2.03.36/lib/cache/lvmcache.c:223:24: call_function: calling ‘lvmcache_vginfo_from_vgname’ from ‘lvmcache_get_bad_mdas’
LVM2.2.03.36/lib/cache/lvmcache.c:223:24: return_function: returning to ‘lvmcache_get_bad_mdas’ from ‘lvmcache_vginfo_from_vgname’
LVM2.2.03.36/lib/cache/lvmcache.c:223:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/cache/lvmcache.c:228:9: branch_false: ...to here
LVM2.2.03.36/lib/cache/lvmcache.c:228:9: branch_true: following ‘true’ branch...
LVM2.2.03.36/lib/cache/lvmcache.c:229:17: branch_true: ...to here
LVM2.2.03.36/lib/cache/lvmcache.c:230:38: call_function: inlined call to ‘zalloc’ from ‘lvmcache_get_bad_mdas’
LVM2.2.03.36/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): [#def196]
LVM2.2.03.36/lib/cache/lvmcache.c:257:25: warning[-Wanalyzer-malloc-leak]: leak of ‘calloc(1, 24)’
LVM2.2.03.36/lib/cache/lvmcache.c:238:6: enter_function: entry to ‘lvmcache_get_mdas’
LVM2.2.03.36/lib/cache/lvmcache.c:247:24: call_function: calling ‘lvmcache_vginfo_from_vgname’ from ‘lvmcache_get_mdas’
LVM2.2.03.36/lib/cache/lvmcache.c:247:24: return_function: returning to ‘lvmcache_get_mdas’ from ‘lvmcache_vginfo_from_vgname’
LVM2.2.03.36/lib/cache/lvmcache.c:247:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/cache/lvmcache.c:252:9: branch_false: ...to here
LVM2.2.03.36/lib/cache/lvmcache.c:252:9: branch_true: following ‘true’ branch...
LVM2.2.03.36/lib/cache/lvmcache.c:253:17: branch_true: ...to here
LVM2.2.03.36/lib/cache/lvmcache.c:254:38: call_function: inlined call to ‘zalloc’ from ‘lvmcache_get_mdas’
LVM2.2.03.36/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: GCC_ANALYZER_WARNING (CWE-401): [#def197]
LVM2.2.03.36/lib/cache/lvmcache.c:1340:17: warning[-Wanalyzer-malloc-leak]: leak of ‘devl’
LVM2.2.03.36/lib/cache/lvmcache.c:1322:12: enter_function: entry to ‘_label_rescan_vg’
LVM2.2.03.36/lib/cache/lvmcache.c:1331:24: call_function: calling ‘lvmcache_vginfo_from_vgname’ from ‘_label_rescan_vg’
LVM2.2.03.36/lib/cache/lvmcache.c:1331:24: return_function: returning to ‘_label_rescan_vg’ from ‘lvmcache_vginfo_from_vgname’
LVM2.2.03.36/lib/cache/lvmcache.c:1331:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/cache/lvmcache.c:1334:9: branch_false: ...to here
LVM2.2.03.36/lib/cache/lvmcache.c:1334:9: branch_true: following ‘true’ branch...
LVM2.2.03.36/lib/cache/lvmcache.c:1335:30: branch_true: ...to here
LVM2.2.03.36/lib/cache/lvmcache.c:1335:30: acquire_memory: allocated here
LVM2.2.03.36/lib/cache/lvmcache.c:1335:20: branch_false: following ‘false’ branch (when ‘devl’ is non-NULL)...
LVM2.2.03.36/lib/cache/lvmcache.c:1339:29: branch_false: ...to here
LVM2.2.03.36/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): [#def198]
LVM2.2.03.36/lib/cache/lvmcache.c:1867:17: warning[-Wanalyzer-malloc-leak]: leak of ‘<unknown>’
LVM2.2.03.36/lib/cache/lvmcache.c:1835:12: enter_function: entry to ‘_lvmcache_update_vgname’
LVM2.2.03.36/lib/cache/lvmcache.c:1848:12: branch_false: following ‘false’ branch (when ‘vgname’ is non-NULL)...
LVM2.2.03.36/lib/cache/lvmcache.c:1848:13: branch_false: ...to here
LVM2.2.03.36/lib/cache/lvmcache.c:1857:12: branch_true: following ‘true’ branch (when ‘info’ is NULL)...
LVM2.2.03.36/lib/cache/lvmcache.c:1858:32: call_function: inlined call to ‘zalloc’ from ‘_lvmcache_update_vgname’
LVM2.2.03.36/lib/cache/lvmcache.c:1858:20: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/cache/lvmcache.c:1862:40: branch_false: ...to here
LVM2.2.03.36/lib/cache/lvmcache.c:1862:40: acquire_memory: allocated here
LVM2.2.03.36/lib/cache/lvmcache.c:1862:20: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/cache/lvmcache.c:1867:17: branch_false: ...to here
LVM2.2.03.36/lib/cache/lvmcache.c:1867:17: danger: ‘<unknown>’ leaks here; was allocated at [(9)](sarif:/runs/0/results/3/codeFlows/0/threadFlows/0/locations/8)
# 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): [#def199]
LVM2.2.03.36/lib/cache/lvmcache.c:1867:17: warning[-Wanalyzer-malloc-leak]: leak of ‘calloc(1, 176)’
LVM2.2.03.36/lib/cache/lvmcache.c:1835:12: enter_function: entry to ‘_lvmcache_update_vgname’
LVM2.2.03.36/lib/cache/lvmcache.c:1848:12: branch_false: following ‘false’ branch (when ‘vgname’ is non-NULL)...
LVM2.2.03.36/lib/cache/lvmcache.c:1848:13: branch_false: ...to here
LVM2.2.03.36/lib/cache/lvmcache.c:1857:12: branch_true: following ‘true’ branch (when ‘info’ is NULL)...
LVM2.2.03.36/lib/cache/lvmcache.c:1858:32: call_function: inlined call to ‘zalloc’ from ‘_lvmcache_update_vgname’
LVM2.2.03.36/lib/cache/lvmcache.c:1858:20: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/cache/lvmcache.c:1862:40: branch_false: ...to here
LVM2.2.03.36/lib/cache/lvmcache.c:1862:20: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/cache/lvmcache.c:1867:17: branch_false: ...to here
LVM2.2.03.36/lib/cache/lvmcache.c:1867:17: danger: ‘calloc(1, 176)’ 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): [#def200]
LVM2.2.03.36/lib/cache/lvmcache.c:2544:33: warning[-Wanalyzer-malloc-leak]: leak of ‘calloc(1, 24)’
LVM2.2.03.36/lib/cache/lvmcache.c:2475:23: enter_function: entry to ‘lvmcache_add’
LVM2.2.03.36/lib/cache/lvmcache.c:2503:16: call_function: calling ‘lvmcache_info_from_pvid’ from ‘lvmcache_add’
LVM2.2.03.36/lib/cache/lvmcache.c:2503:16: return_function: returning to ‘lvmcache_add’ from ‘lvmcache_info_from_pvid’
LVM2.2.03.36/lib/cache/lvmcache.c:2505:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/cache/lvmcache.c:2513:12: branch_false: ...to here
LVM2.2.03.36/lib/cache/lvmcache.c:2513:12: branch_false: following ‘false’ branch (when ‘info’ is non-NULL)...
LVM2.2.03.36/lib/cache/lvmcache.c:2519:12: branch_false: ...to here
LVM2.2.03.36/lib/cache/lvmcache.c:2519:12: branch_true: following ‘true’ branch (when ‘created == 0’)...
LVM2.2.03.36/lib/cache/lvmcache.c:2520:21: branch_true: ...to here
LVM2.2.03.36/lib/cache/lvmcache.c:2520:20: branch_true: following ‘true’ branch...
LVM2.2.03.36/lib/cache/lvmcache.c:2521:25: branch_true: ...to here
LVM2.2.03.36/lib/cache/lvmcache.c:2528:28: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/cache/lvmcache.c:2540:46: call_function: inlined call to ‘zalloc’ from ‘lvmcache_add’
LVM2.2.03.36/lib/cache/lvmcache.c:2540:36: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/cache/lvmcache.c:2542:33: branch_false: ...to here
LVM2.2.03.36/lib/cache/lvmcache.c:2544:33: danger: ‘calloc(1, 24)’ leaks here; was allocated at [(18)](sarif:/runs/0/results/5/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): [#def201]
LVM2.2.03.36/lib/cache_segtype/cache.c:799:14: warning[-Wanalyzer-malloc-leak]: leak of ‘calloc(1, 72)’
LVM2.2.03.36/lib/cache_segtype/cache.c:779:5: enter_function: entry to ‘init_cache_segtypes’
LVM2.2.03.36/lib/cache_segtype/cache.c:788:40: call_function: inlined call to ‘zalloc’ from ‘init_cache_segtypes’
LVM2.2.03.36/lib/cache_segtype/cache.c:790:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/cache_segtype/cache.c:795:9: branch_false: ...to here
LVM2.2.03.36/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): [#def202]
LVM2.2.03.36/lib/cache_segtype/cache.c:813:14: warning[-Wanalyzer-malloc-leak]: leak of ‘calloc(1, 72)’
LVM2.2.03.36/lib/cache_segtype/cache.c:779:5: enter_function: entry to ‘init_cache_segtypes’
LVM2.2.03.36/lib/cache_segtype/cache.c:790:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/cache_segtype/cache.c:795:9: branch_false: ...to here
LVM2.2.03.36/lib/cache_segtype/cache.c:799:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/cache_segtype/cache.c:801:9: branch_false: ...to here
LVM2.2.03.36/lib/cache_segtype/cache.c:803:19: call_function: inlined call to ‘zalloc’ from ‘init_cache_segtypes’
LVM2.2.03.36/lib/cache_segtype/cache.c:804:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/cache_segtype/cache.c:809:9: branch_false: ...to here
LVM2.2.03.36/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): [#def203]
LVM2.2.03.36/lib/commands/toolcontext.c:246:21: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(&proc_mounts, "r")’
LVM2.2.03.36/lib/commands/toolcontext.c:229:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/commands/toolcontext.c:235:39: branch_false: ...to here
LVM2.2.03.36/lib/commands/toolcontext.c:234:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/commands/toolcontext.c:240:20: branch_false: ...to here
LVM2.2.03.36/lib/commands/toolcontext.c:240:20: acquire_resource: opened here
LVM2.2.03.36/lib/commands/toolcontext.c:240:12: branch_false: following ‘false’ branch...
 branch_false: ...to here
LVM2.2.03.36/lib/commands/toolcontext.c:245:16: branch_true: following ‘true’ branch...
LVM2.2.03.36/lib/commands/toolcontext.c:246:21: branch_true: ...to here
LVM2.2.03.36/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): [#def204]
LVM2.2.03.36/lib/commands/toolcontext.c:246:21: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(&proc_mounts, "r")’
LVM2.2.03.36/lib/commands/toolcontext.c:229:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/commands/toolcontext.c:235:39: branch_false: ...to here
LVM2.2.03.36/lib/commands/toolcontext.c:234:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/commands/toolcontext.c:240:20: branch_false: ...to here
LVM2.2.03.36/lib/commands/toolcontext.c:240:20: acquire_memory: allocated here
LVM2.2.03.36/lib/commands/toolcontext.c:240:12: branch_false: following ‘false’ branch...
 branch_false: ...to here
LVM2.2.03.36/lib/commands/toolcontext.c:245:16: branch_true: following ‘true’ branch...
LVM2.2.03.36/lib/commands/toolcontext.c:246:21: branch_true: ...to here
LVM2.2.03.36/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): [#def205]
LVM2.2.03.36/lib/commands/toolcontext.c:1662:9: warning[-Wanalyzer-malloc-leak]: leak of ‘calloc(1, 18440)’
LVM2.2.03.36/lib/commands/toolcontext.c:1629:21: enter_function: entry to ‘create_toolcontext’
LVM2.2.03.36/lib/commands/toolcontext.c:1649:21: call_function: inlined call to ‘zalloc’ from ‘create_toolcontext’
LVM2.2.03.36/lib/commands/toolcontext.c:1649:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/commands/toolcontext.c:1653:9: branch_false: ...to here
LVM2.2.03.36/lib/commands/toolcontext.c:1662:9: danger: ‘calloc(1, 18440)’ leaks here; was allocated at [(3)](sarif:/runs/0/results/2/codeFlows/0/threadFlows/0/locations/2)
# 1660|   	cmd->running_on_valgrind = RUNNING_ON_VALGRIND;
# 1661|   
# 1662|-> 	dm_list_init(&cmd->arg_value_groups);
# 1663|   	dm_list_init(&cmd->formats);
# 1664|   	dm_list_init(&cmd->segtypes);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def206]
LVM2.2.03.36/lib/config/config.c:754:17: warning[-Wanalyzer-malloc-leak]: leak of ‘enc_value’
LVM2.2.03.36/lib/config/config.c:1458:31: enter_function: entry to ‘_get_array_def_node’
LVM2.2.03.36/lib/config/config.c:1464:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/config/config.c:1467:52: branch_false: ...to here
LVM2.2.03.36/lib/config/config.c:1467:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/config/config.c:1472:23: branch_false: ...to here
LVM2.2.03.36/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): [#def207]
LVM2.2.03.36/lib/config/config.c:760:25: warning[-Wanalyzer-malloc-leak]: leak of ‘token’
LVM2.2.03.36/lib/config/config.c:1458:31: enter_function: entry to ‘_get_array_def_node’
LVM2.2.03.36/lib/config/config.c:1464:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/config/config.c:1467:52: branch_false: ...to here
LVM2.2.03.36/lib/config/config.c:1467:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/config/config.c:1472:23: branch_false: ...to here
LVM2.2.03.36/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): [#def208]
LVM2.2.03.36/lib/config/config.c:772:27: warning[-Wanalyzer-malloc-leak]: leak of ‘token’
LVM2.2.03.36/lib/config/config.c:1458:31: enter_function: entry to ‘_get_array_def_node’
LVM2.2.03.36/lib/config/config.c:1464:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/config/config.c:1467:52: branch_false: ...to here
LVM2.2.03.36/lib/config/config.c:1467:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/config/config.c:1472:23: branch_false: ...to here
LVM2.2.03.36/lib/config/config.c:1472:23: call_function: calling ‘_get_def_array_values’ from ‘_get_array_def_node’
#  770|   			p[0] = '\0';
#  771|   
#  772|-> 		if (!(v = dm_config_create_value(cft))) {
#  773|   			log_error("Failed to create default config array value for %s.", def->name);
#  774|   			free(enc_value);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def209]
LVM2.2.03.36/lib/config/config.c:773:25: warning[-Wanalyzer-malloc-leak]: leak of ‘token’
LVM2.2.03.36/lib/config/config.c:1458:31: enter_function: entry to ‘_get_array_def_node’
LVM2.2.03.36/lib/config/config.c:1464:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/config/config.c:1467:52: branch_false: ...to here
LVM2.2.03.36/lib/config/config.c:1467:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/config/config.c:1472:23: branch_false: ...to here
LVM2.2.03.36/lib/config/config.c:1472:23: call_function: calling ‘_get_def_array_values’ from ‘_get_array_def_node’
#  771|   
#  772|   		if (!(v = dm_config_create_value(cft))) {
#  773|-> 			log_error("Failed to create default config array value for %s.", def->name);
#  774|   			free(enc_value);
#  775|   			return NULL;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def210]
LVM2.2.03.36/lib/config/config.c:778:17: warning[-Wanalyzer-malloc-leak]: leak of ‘token’
LVM2.2.03.36/lib/config/config.c:1458:31: enter_function: entry to ‘_get_array_def_node’
LVM2.2.03.36/lib/config/config.c:1464:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/config/config.c:1467:52: branch_false: ...to here
LVM2.2.03.36/lib/config/config.c:1467:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/config/config.c:1472:23: branch_false: ...to here
LVM2.2.03.36/lib/config/config.c:1472:23: call_function: calling ‘_get_def_array_values’ from ‘_get_array_def_node’
#  776|   		}
#  777|   
#  778|-> 		dm_config_value_set_format_flags(v, format_flags);
#  779|   
#  780|   		if (oldv)

Error: GCC_ANALYZER_WARNING (CWE-401): [#def211]
LVM2.2.03.36/lib/config/config.c:802:43: warning[-Wanalyzer-malloc-leak]: leak of ‘token’
LVM2.2.03.36/lib/config/config.c:1458:31: enter_function: entry to ‘_get_array_def_node’
LVM2.2.03.36/lib/config/config.c:1464:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/config/config.c:1467:52: branch_false: ...to here
LVM2.2.03.36/lib/config/config.c:1467:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/config/config.c:1472:23: branch_false: ...to here
LVM2.2.03.36/lib/config/config.c:1472:23: call_function: calling ‘_get_def_array_values’ from ‘_get_array_def_node’
#  800|   				break;
#  801|   			case 'S':
#  802|-> 				if (!(r = dm_pool_strdup(cft->mem, token + 1))) {
#  803|   					free(enc_value);
#  804|   					log_error("Failed to duplicate token for default "

Error: GCC_ANALYZER_WARNING (CWE-401): [#def212]
LVM2.2.03.36/lib/config/config.c:822:9: warning[-Wanalyzer-malloc-leak]: leak of ‘token’
LVM2.2.03.36/lib/config/config.c:1458:31: enter_function: entry to ‘_get_array_def_node’
LVM2.2.03.36/lib/config/config.c:1464:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/config/config.c:1467:52: branch_false: ...to here
LVM2.2.03.36/lib/config/config.c:1467:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/config/config.c:1472:23: branch_false: ...to here
LVM2.2.03.36/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): [#def213]
LVM2.2.03.36/lib/config/config.c:1957:9: warning[-Wanalyzer-file-leak]: leak of FILE ‘baton.fp’
LVM2.2.03.36/lib/config/config.c:1948:12: branch_false: following ‘false’ branch (when ‘file’ is non-NULL)...
LVM2.2.03.36/lib/config/config.c:1952:33: branch_false: ...to here
LVM2.2.03.36/lib/config/config.c:1952:33: acquire_resource: opened here
LVM2.2.03.36/lib/config/config.c:1952:19: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/config/config.c:1957:9: branch_false: ...to here
LVM2.2.03.36/lib/config/config.c:1957:9: danger: ‘baton.fp’ leaks here; was opened at [(3)](sarif:/runs/0/results/8/codeFlows/0/threadFlows/0/locations/2)
# 1955|   	}
# 1956|   
# 1957|-> 	log_verbose("Dumping configuration to %s", file);
# 1958|   
# 1959|   	if (tree_spec->withgeneralpreamble)

Error: GCC_ANALYZER_WARNING (CWE-401): [#def214]
LVM2.2.03.36/lib/config/config.c:1957:9: warning[-Wanalyzer-malloc-leak]: leak of ‘baton.fp’
LVM2.2.03.36/lib/config/config.c:1948:12: branch_false: following ‘false’ branch (when ‘file’ is non-NULL)...
LVM2.2.03.36/lib/config/config.c:1952:33: branch_false: ...to here
LVM2.2.03.36/lib/config/config.c:1952:33: acquire_memory: allocated here
LVM2.2.03.36/lib/config/config.c:1952:19: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/config/config.c:1957:9: branch_false: ...to here
LVM2.2.03.36/lib/config/config.c:1957:9: danger: ‘baton.fp’ leaks here; was allocated at [(3)](sarif:/runs/0/results/9/codeFlows/0/threadFlows/0/locations/2)
# 1955|   	}
# 1956|   
# 1957|-> 	log_verbose("Dumping configuration to %s", file);
# 1958|   
# 1959|   	if (tree_spec->withgeneralpreamble)

Error: GCC_ANALYZER_WARNING (CWE-775): [#def215]
LVM2.2.03.36/lib/config/config.c:1965:22: warning[-Wanalyzer-file-leak]: leak of FILE ‘baton.fp’
LVM2.2.03.36/lib/config/config.c:1948:12: branch_false: following ‘false’ branch (when ‘file’ is non-NULL)...
LVM2.2.03.36/lib/config/config.c:1952:33: branch_false: ...to here
LVM2.2.03.36/lib/config/config.c:1952:33: acquire_resource: opened here
LVM2.2.03.36/lib/config/config.c:1952:19: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/config/config.c:1957:9: branch_false: ...to here
LVM2.2.03.36/lib/config/config.c:1964:12: branch_true: following ‘true’ branch (when ‘argc == 0’)...
LVM2.2.03.36/lib/config/config.c:1965:47: branch_true: ...to here
LVM2.2.03.36/lib/config/config.c:1965:22: danger: ‘baton.fp’ leaks here; was opened at [(3)](sarif:/runs/0/results/10/codeFlows/0/threadFlows/0/locations/2)
# 1963|   
# 1964|   	if (!argc) {
# 1965|-> 		if (!dm_config_write_node_out(cft->root, &_out_spec, &baton)) {
# 1966|   			log_error("Failure while writing to %s", file);
# 1967|   			r = 0;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def216]
LVM2.2.03.36/lib/config/config.c:1965:22: warning[-Wanalyzer-malloc-leak]: leak of ‘baton.fp’
LVM2.2.03.36/lib/config/config.c:1948:12: branch_false: following ‘false’ branch (when ‘file’ is non-NULL)...
LVM2.2.03.36/lib/config/config.c:1952:33: branch_false: ...to here
LVM2.2.03.36/lib/config/config.c:1952:33: acquire_memory: allocated here
LVM2.2.03.36/lib/config/config.c:1952:19: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/config/config.c:1957:9: branch_false: ...to here
LVM2.2.03.36/lib/config/config.c:1964:12: branch_true: following ‘true’ branch (when ‘argc == 0’)...
LVM2.2.03.36/lib/config/config.c:1965:47: branch_true: ...to here
LVM2.2.03.36/lib/config/config.c:1965:22: danger: ‘baton.fp’ leaks here; was allocated at [(3)](sarif:/runs/0/results/11/codeFlows/0/threadFlows/0/locations/2)
# 1963|   
# 1964|   	if (!argc) {
# 1965|-> 		if (!dm_config_write_node_out(cft->root, &_out_spec, &baton)) {
# 1966|   			log_error("Failure while writing to %s", file);
# 1967|   			r = 0;

Error: GCC_ANALYZER_WARNING (CWE-775): [#def217]
LVM2.2.03.36/lib/config/config.c:1970:27: warning[-Wanalyzer-file-leak]: leak of FILE ‘baton.fp’
LVM2.2.03.36/lib/config/config.c:1948:12: branch_false: following ‘false’ branch (when ‘file’ is non-NULL)...
LVM2.2.03.36/lib/config/config.c:1952:33: branch_false: ...to here
LVM2.2.03.36/lib/config/config.c:1952:33: acquire_resource: opened here
LVM2.2.03.36/lib/config/config.c:1952:19: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/config/config.c:1957:9: branch_false: ...to here
LVM2.2.03.36/lib/config/config.c:1964:12: branch_false: following ‘false’ branch (when ‘argc != 0’)...
 branch_false: ...to here
LVM2.2.03.36/lib/config/config.c:1969:23: branch_true: following ‘true’ branch (when ‘argc != 0’)...
LVM2.2.03.36/lib/config/config.c:1970:27: branch_true: ...to here
LVM2.2.03.36/lib/config/config.c:1970:27: danger: ‘baton.fp’ leaks here; was opened at [(3)](sarif:/runs/0/results/12/codeFlows/0/threadFlows/0/locations/2)
# 1968|   		}
# 1969|   	} else while (argc--) {
# 1970|-> 		if ((cn = dm_config_find_node(cft->root, *argv))) {
# 1971|   			if (!dm_config_write_one_node_out(cn, &_out_spec, &baton)) {
# 1972|   				log_error("Failure while writing to %s", file);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def218]
LVM2.2.03.36/lib/config/config.c:1970:27: warning[-Wanalyzer-malloc-leak]: leak of ‘baton.fp’
LVM2.2.03.36/lib/config/config.c:1948:12: branch_false: following ‘false’ branch (when ‘file’ is non-NULL)...
LVM2.2.03.36/lib/config/config.c:1952:33: branch_false: ...to here
LVM2.2.03.36/lib/config/config.c:1952:33: acquire_memory: allocated here
LVM2.2.03.36/lib/config/config.c:1952:19: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/config/config.c:1957:9: branch_false: ...to here
LVM2.2.03.36/lib/config/config.c:1964:12: branch_false: following ‘false’ branch (when ‘argc != 0’)...
 branch_false: ...to here
LVM2.2.03.36/lib/config/config.c:1969:23: branch_true: following ‘true’ branch (when ‘argc != 0’)...
LVM2.2.03.36/lib/config/config.c:1970:27: branch_true: ...to here
LVM2.2.03.36/lib/config/config.c:1970:27: danger: ‘baton.fp’ leaks here; was allocated at [(3)](sarif:/runs/0/results/13/codeFlows/0/threadFlows/0/locations/2)
# 1968|   		}
# 1969|   	} else while (argc--) {
# 1970|-> 		if ((cn = dm_config_find_node(cft->root, *argv))) {
# 1971|   			if (!dm_config_write_one_node_out(cn, &_out_spec, &baton)) {
# 1972|   				log_error("Failure while writing to %s", file);

Error: GCC_ANALYZER_WARNING (CWE-775): [#def219]
LVM2.2.03.36/lib/config/config.c:1971:30: warning[-Wanalyzer-file-leak]: leak of FILE ‘baton.fp’
LVM2.2.03.36/lib/config/config.c:1948:12: branch_false: following ‘false’ branch (when ‘file’ is non-NULL)...
LVM2.2.03.36/lib/config/config.c:1952:33: branch_false: ...to here
LVM2.2.03.36/lib/config/config.c:1952:33: acquire_resource: opened here
LVM2.2.03.36/lib/config/config.c:1952:19: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/config/config.c:1957:9: branch_false: ...to here
LVM2.2.03.36/lib/config/config.c:1964:12: branch_false: following ‘false’ branch (when ‘argc != 0’)...
 branch_false: ...to here
LVM2.2.03.36/lib/config/config.c:1969:23: branch_true: following ‘true’ branch (when ‘argc != 0’)...
LVM2.2.03.36/lib/config/config.c:1970:27: branch_true: ...to here
LVM2.2.03.36/lib/config/config.c:1970:20: branch_true: following ‘true’ branch...
LVM2.2.03.36/lib/config/config.c:1971:30: branch_true: ...to here
LVM2.2.03.36/lib/config/config.c:1971:30: danger: ‘baton.fp’ leaks here; was opened at [(3)](sarif:/runs/0/results/14/codeFlows/0/threadFlows/0/locations/2)
# 1969|   	} else while (argc--) {
# 1970|   		if ((cn = dm_config_find_node(cft->root, *argv))) {
# 1971|-> 			if (!dm_config_write_one_node_out(cn, &_out_spec, &baton)) {
# 1972|   				log_error("Failure while writing to %s", file);
# 1973|   				r = 0;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def220]
LVM2.2.03.36/lib/config/config.c:1971:30: warning[-Wanalyzer-malloc-leak]: leak of ‘baton.fp’
LVM2.2.03.36/lib/config/config.c:1948:12: branch_false: following ‘false’ branch (when ‘file’ is non-NULL)...
LVM2.2.03.36/lib/config/config.c:1952:33: branch_false: ...to here
LVM2.2.03.36/lib/config/config.c:1952:33: acquire_memory: allocated here
LVM2.2.03.36/lib/config/config.c:1952:19: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/config/config.c:1957:9: branch_false: ...to here
LVM2.2.03.36/lib/config/config.c:1964:12: branch_false: following ‘false’ branch (when ‘argc != 0’)...
 branch_false: ...to here
LVM2.2.03.36/lib/config/config.c:1969:23: branch_true: following ‘true’ branch (when ‘argc != 0’)...
LVM2.2.03.36/lib/config/config.c:1970:27: branch_true: ...to here
LVM2.2.03.36/lib/config/config.c:1970:20: branch_true: following ‘true’ branch...
LVM2.2.03.36/lib/config/config.c:1971:30: branch_true: ...to here
LVM2.2.03.36/lib/config/config.c:1971:30: danger: ‘baton.fp’ leaks here; was allocated at [(3)](sarif:/runs/0/results/15/codeFlows/0/threadFlows/0/locations/2)
# 1969|   	} else while (argc--) {
# 1970|   		if ((cn = dm_config_find_node(cft->root, *argv))) {
# 1971|-> 			if (!dm_config_write_one_node_out(cn, &_out_spec, &baton)) {
# 1972|   				log_error("Failure while writing to %s", file);
# 1973|   				r = 0;

Error: GCC_ANALYZER_WARNING (CWE-775): [#def221]
LVM2.2.03.36/lib/config/config.c:1976:25: warning[-Wanalyzer-file-leak]: leak of FILE ‘baton.fp’
LVM2.2.03.36/lib/config/config.c:1948:12: branch_false: following ‘false’ branch (when ‘file’ is non-NULL)...
LVM2.2.03.36/lib/config/config.c:1952:33: branch_false: ...to here
LVM2.2.03.36/lib/config/config.c:1952:33: acquire_resource: opened here
LVM2.2.03.36/lib/config/config.c:1952:19: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/config/config.c:1957:9: branch_false: ...to here
LVM2.2.03.36/lib/config/config.c:1964:12: branch_false: following ‘false’ branch (when ‘argc != 0’)...
 branch_false: ...to here
LVM2.2.03.36/lib/config/config.c:1969:23: branch_true: following ‘true’ branch (when ‘argc != 0’)...
LVM2.2.03.36/lib/config/config.c:1970:27: branch_true: ...to here
LVM2.2.03.36/lib/config/config.c:1970:20: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/config/config.c:1976:25: branch_false: ...to here
LVM2.2.03.36/lib/config/config.c:1976:25: danger: ‘baton.fp’ leaks here; was opened at [(3)](sarif:/runs/0/results/16/codeFlows/0/threadFlows/0/locations/2)
# 1974|   			}
# 1975|   		} else {
# 1976|-> 			log_error("Configuration node %s not found", *argv);
# 1977|   			r = 0;
# 1978|   		}

Error: GCC_ANALYZER_WARNING (CWE-401): [#def222]
LVM2.2.03.36/lib/config/config.c:1976:25: warning[-Wanalyzer-malloc-leak]: leak of ‘baton.fp’
LVM2.2.03.36/lib/config/config.c:1948:12: branch_false: following ‘false’ branch (when ‘file’ is non-NULL)...
LVM2.2.03.36/lib/config/config.c:1952:33: branch_false: ...to here
LVM2.2.03.36/lib/config/config.c:1952:33: acquire_memory: allocated here
LVM2.2.03.36/lib/config/config.c:1952:19: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/config/config.c:1957:9: branch_false: ...to here
LVM2.2.03.36/lib/config/config.c:1964:12: branch_false: following ‘false’ branch (when ‘argc != 0’)...
 branch_false: ...to here
LVM2.2.03.36/lib/config/config.c:1969:23: branch_true: following ‘true’ branch (when ‘argc != 0’)...
LVM2.2.03.36/lib/config/config.c:1970:27: branch_true: ...to here
LVM2.2.03.36/lib/config/config.c:1970:20: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/config/config.c:1976:25: branch_false: ...to here
LVM2.2.03.36/lib/config/config.c:1976:25: danger: ‘baton.fp’ leaks here; was allocated at [(3)](sarif:/runs/0/results/17/codeFlows/0/threadFlows/0/locations/2)
# 1974|   			}
# 1975|   		} else {
# 1976|-> 			log_error("Configuration node %s not found", *argv);
# 1977|   			r = 0;
# 1978|   		}

Error: GCC_ANALYZER_WARNING (CWE-775): [#def223]
LVM2.2.03.36/lib/config/config.c:1982:36: warning[-Wanalyzer-file-leak]: leak of FILE ‘baton.fp’
LVM2.2.03.36/lib/config/config.c:1948:12: branch_false: following ‘false’ branch (when ‘file’ is non-NULL)...
LVM2.2.03.36/lib/config/config.c:1952:33: branch_false: ...to here
LVM2.2.03.36/lib/config/config.c:1952:33: acquire_resource: opened here
LVM2.2.03.36/lib/config/config.c:1952:19: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/config/config.c:1957:9: branch_false: ...to here
LVM2.2.03.36/lib/config/config.c:1964:12: branch_false: following ‘false’ branch (when ‘argc != 0’)...
 branch_false: ...to here
LVM2.2.03.36/lib/config/config.c:1969:23: branch_true: following ‘true’ branch (when ‘argc != 0’)...
LVM2.2.03.36/lib/config/config.c:1970:27: branch_true: ...to here
LVM2.2.03.36/lib/config/config.c:1970:20: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/config/config.c:1976:25: branch_false: ...to here
LVM2.2.03.36/lib/config/config.c:1969:23: branch_false: following ‘false’ branch (when ‘argc == 0’)...
LVM2.2.03.36/lib/config/config.c:1982:12: branch_false: ...to here
LVM2.2.03.36/lib/config/config.c:1982:12: branch_true: following ‘true’ branch...
LVM2.2.03.36/lib/config/config.c:1982:36: danger: ‘baton.fp’ leaks here; was opened at [(3)](sarif:/runs/0/results/18/codeFlows/0/threadFlows/0/locations/2)
# 1980|   	}
# 1981|   
# 1982|-> 	if (free_fp && baton.fp && dm_fclose(baton.fp)) {
# 1983|   		stack;
# 1984|   		r = 0;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def224]
LVM2.2.03.36/lib/config/config.c:1982:36: warning[-Wanalyzer-malloc-leak]: leak of ‘baton.fp’
LVM2.2.03.36/lib/config/config.c:1948:12: branch_false: following ‘false’ branch (when ‘file’ is non-NULL)...
LVM2.2.03.36/lib/config/config.c:1952:33: branch_false: ...to here
LVM2.2.03.36/lib/config/config.c:1952:33: acquire_memory: allocated here
LVM2.2.03.36/lib/config/config.c:1952:19: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/config/config.c:1957:9: branch_false: ...to here
LVM2.2.03.36/lib/config/config.c:1964:12: branch_false: following ‘false’ branch (when ‘argc != 0’)...
 branch_false: ...to here
LVM2.2.03.36/lib/config/config.c:1969:23: branch_true: following ‘true’ branch (when ‘argc != 0’)...
LVM2.2.03.36/lib/config/config.c:1970:27: branch_true: ...to here
LVM2.2.03.36/lib/config/config.c:1970:20: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/config/config.c:1976:25: branch_false: ...to here
LVM2.2.03.36/lib/config/config.c:1969:23: branch_false: following ‘false’ branch (when ‘argc == 0’)...
LVM2.2.03.36/lib/config/config.c:1982:12: branch_false: ...to here
LVM2.2.03.36/lib/config/config.c:1982:12: branch_true: following ‘true’ branch...
LVM2.2.03.36/lib/config/config.c:1982:36: danger: ‘baton.fp’ leaks here; was allocated at [(3)](sarif:/runs/0/results/19/codeFlows/0/threadFlows/0/locations/2)
# 1980|   	}
# 1981|   
# 1982|-> 	if (free_fp && baton.fp && dm_fclose(baton.fp)) {
# 1983|   		stack;
# 1984|   		r = 0;

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

Error: GCC_ANALYZER_WARNING (CWE-401): [#def226]
LVM2.2.03.36/lib/device/bcache.c:453:17: warning[-Wanalyzer-malloc-leak]: leak of ‘io’
LVM2.2.03.36/lib/device/bcache.c:439:30: acquire_memory: allocated here
LVM2.2.03.36/lib/device/bcache.c:440:12: branch_false: following ‘false’ branch (when ‘io’ is non-NULL)...
LVM2.2.03.36/lib/device/bcache.c:445:9: branch_false: ...to here
LVM2.2.03.36/lib/device/bcache.c:447:12: branch_false: following ‘false’ branch (when ‘off != -1’)...
LVM2.2.03.36/lib/device/bcache.c:452:12: branch_false: ...to here
LVM2.2.03.36/lib/device/bcache.c:452:12: branch_true: following ‘true’ branch...
LVM2.2.03.36/lib/device/bcache.c:453:17: branch_true: ...to here
LVM2.2.03.36/lib/device/bcache.c:453:17: danger: ‘io’ leaks here; was allocated at [(1)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/0)
#  451|   	}
#  452|   	if (off != (off_t) where) {
#  453|-> 		log_warn("Device seek failed for offset %llu", (unsigned long long)where);
#  454|   		free(io);
#  455|   		return false;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def227]
LVM2.2.03.36/lib/device/bcache.c:469:25: warning[-Wanalyzer-malloc-leak]: leak of ‘io’
LVM2.2.03.36/lib/device/bcache.c:439:30: acquire_memory: allocated here
LVM2.2.03.36/lib/device/bcache.c:440:12: branch_false: following ‘false’ branch (when ‘io’ is non-NULL)...
LVM2.2.03.36/lib/device/bcache.c:445:9: branch_false: ...to here
LVM2.2.03.36/lib/device/bcache.c:447:12: branch_false: following ‘false’ branch (when ‘off != -1’)...
LVM2.2.03.36/lib/device/bcache.c:452:12: branch_false: ...to here
LVM2.2.03.36/lib/device/bcache.c:452:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/device/bcache.c:461:12: branch_false: ...to here
LVM2.2.03.36/lib/device/bcache.c:461:12: branch_true: following ‘true’ branch...
LVM2.2.03.36/lib/device/bcache.c:468:20: branch_true: following ‘true’ branch...
LVM2.2.03.36/lib/device/bcache.c:469:25: branch_true: ...to here
LVM2.2.03.36/lib/device/bcache.c:469:25: danger: ‘io’ leaks here; was allocated at [(1)](sarif:/runs/0/results/2/codeFlows/0/threadFlows/0/locations/0)
#  467|   
#  468|   		if (offset > _last_byte_offset) {
#  469|-> 			log_error("Limit write at %llu len %llu beyond last byte %llu",
#  470|   				  (unsigned long long)offset,
#  471|   				  (unsigned long long)nbytes,

Error: GCC_ANALYZER_WARNING (CWE-401): [#def228]
LVM2.2.03.36/lib/device/bcache.c:491:41: warning[-Wanalyzer-malloc-leak]: leak of ‘io’
LVM2.2.03.36/lib/device/bcache.c:439:30: acquire_memory: allocated here
LVM2.2.03.36/lib/device/bcache.c:440:12: branch_false: following ‘false’ branch (when ‘io’ is non-NULL)...
LVM2.2.03.36/lib/device/bcache.c:445:9: branch_false: ...to here
LVM2.2.03.36/lib/device/bcache.c:447:12: branch_false: following ‘false’ branch (when ‘off != -1’)...
LVM2.2.03.36/lib/device/bcache.c:452:12: branch_false: ...to here
LVM2.2.03.36/lib/device/bcache.c:452:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/device/bcache.c:461:12: branch_false: ...to here
LVM2.2.03.36/lib/device/bcache.c:461:12: branch_true: following ‘true’ branch...
LVM2.2.03.36/lib/device/bcache.c:468:20: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/device/bcache.c:477:21: branch_false: ...to here
LVM2.2.03.36/lib/device/bcache.c:477:20: branch_true: following ‘true’ branch...
LVM2.2.03.36/lib/device/bcache.c:478:25: branch_true: ...to here
LVM2.2.03.36/lib/device/bcache.c:480:28: branch_true: following ‘true’ branch...
LVM2.2.03.36/lib/device/bcache.c:481:33: branch_true: ...to here
LVM2.2.03.36/lib/device/bcache.c:490:36: branch_true: following ‘true’ branch...
LVM2.2.03.36/lib/device/bcache.c:491:41: branch_true: ...to here
LVM2.2.03.36/lib/device/bcache.c:491:41: danger: ‘io’ leaks here; was allocated at [(1)](sarif:/runs/0/results/3/codeFlows/0/threadFlows/0/locations/0)
#  489|   				 */
#  490|   				if (limit_nbytes + extra_nbytes > nbytes) {
#  491|-> 					log_warn("Skip extending write at %llu len %llu limit %llu extra %llu sector_size %llu",
#  492|   						 (unsigned long long)offset,
#  493|   						 (unsigned long long)nbytes,

Error: GCC_ANALYZER_WARNING (CWE-401): [#def229]
LVM2.2.03.36/lib/device/bcache.c:618:9: warning[-Wanalyzer-malloc-leak]: leak of ‘e’
LVM2.2.03.36/lib/device/bcache.c:608:33: acquire_memory: allocated here
LVM2.2.03.36/lib/device/bcache.c:610:12: branch_false: following ‘false’ branch (when ‘e’ is non-NULL)...
LVM2.2.03.36/lib/device/bcache.c:613:9: branch_false: ...to here
LVM2.2.03.36/lib/device/bcache.c:618:9: danger: ‘e’ leaks here; was allocated at [(1)](sarif:/runs/0/results/4/codeFlows/0/threadFlows/0/locations/0)
#  616|           e->e.max_io = _sync_max_io;
#  617|   
#  618|-> 	dm_list_init(&e->complete);
#  619|   	/* coverity[leaked_storage] 'e' is not leaking */
#  620|           return &e->e;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def230]
LVM2.2.03.36/lib/device/bcache.c:1143:9: warning[-Wanalyzer-malloc-leak]: leak of ‘cache’
LVM2.2.03.36/lib/device/bcache.c:1116:12: branch_false: following ‘false’ branch (when ‘nr_cache_blocks != 0’)...
LVM2.2.03.36/lib/device/bcache.c:1121:12: branch_false: ...to here
LVM2.2.03.36/lib/device/bcache.c:1121:12: branch_false: following ‘false’ branch (when ‘block_sectors != 0’)...
LVM2.2.03.36/lib/device/bcache.c:1126:30: branch_false: ...to here
LVM2.2.03.36/lib/device/bcache.c:1126:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/device/bcache.c:1131:17: branch_false: ...to here
LVM2.2.03.36/lib/device/bcache.c:1131:17: acquire_memory: allocated here
LVM2.2.03.36/lib/device/bcache.c:1132:12: branch_false: following ‘false’ branch (when ‘cache’ is non-NULL)...
LVM2.2.03.36/lib/device/bcache.c:1135:9: branch_false: ...to here
LVM2.2.03.36/lib/device/bcache.c:1143:9: danger: ‘cache’ leaks here; was allocated at [(7)](sarif:/runs/0/results/5/codeFlows/0/threadFlows/0/locations/6)
# 1141|   	cache->nr_io_pending = 0;
# 1142|   
# 1143|-> 	dm_list_init(&cache->free);
# 1144|   	dm_list_init(&cache->errored);
# 1145|   	dm_list_init(&cache->dirty);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def231]
LVM2.2.03.36/lib/device/dev-cache.c:2414:34: warning[-Wanalyzer-malloc-leak]: leak of ‘opendir(&path)’
LVM2.2.03.36/lib/device/dev-cache.c:2398:12: branch_false: following ‘false’ branch (when ‘devno != 0’)...
LVM2.2.03.36/lib/device/dev-cache.c:2405:13: branch_false: ...to here
LVM2.2.03.36/lib/device/dev-cache.c:2405:12: branch_true: following ‘true’ branch...
LVM2.2.03.36/lib/device/dev-cache.c:2406:21: branch_true: ...to here
LVM2.2.03.36/lib/device/dev-cache.c:2406:20: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/device/dev-cache.c:2411:29: branch_false: ...to here
LVM2.2.03.36/lib/device/dev-cache.c:2411:29: acquire_memory: allocated here
LVM2.2.03.36/lib/device/dev-cache.c:2411:20: branch_false: following ‘false’ branch...
 branch_false: ...to here
LVM2.2.03.36/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): [#def232]
LVM2.2.03.36/lib/device/dev-cache.c:2475:21: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(&_partitions, "r")’
LVM2.2.03.36/lib/device/dev-cache.c:2398:12: branch_false: following ‘false’ branch (when ‘devno != 0’)...
LVM2.2.03.36/lib/device/dev-cache.c:2405:13: branch_false: ...to here
LVM2.2.03.36/lib/device/dev-cache.c:2437:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/device/dev-cache.c:2462:1: branch_false: ...to here
LVM2.2.03.36/lib/device/dev-cache.c:2463:20: acquire_resource: opened here
LVM2.2.03.36/lib/device/dev-cache.c:2463:12: branch_false: following ‘false’ branch...
 branch_false: ...to here
LVM2.2.03.36/lib/device/dev-cache.c:2466:16: branch_true: following ‘true’ branch...
LVM2.2.03.36/lib/device/dev-cache.c:2467:21: branch_true: ...to here
LVM2.2.03.36/lib/device/dev-cache.c:2475:21: danger: ‘fopen(&_partitions, "r")’ leaks here; was opened at [(5)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/4)
# 2473|   			continue;
# 2474|   
# 2475|-> 		if (dm_snprintf(devname, sizeof(devname), "/dev/%s", namebuf) < 0) {
# 2476|   			devname[0] = '\0';
# 2477|   			stack;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def233]
LVM2.2.03.36/lib/device/dev-cache.c:2475:21: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(&_partitions, "r")’
LVM2.2.03.36/lib/device/dev-cache.c:2398:12: branch_false: following ‘false’ branch (when ‘devno != 0’)...
LVM2.2.03.36/lib/device/dev-cache.c:2405:13: branch_false: ...to here
LVM2.2.03.36/lib/device/dev-cache.c:2437:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/device/dev-cache.c:2462:1: branch_false: ...to here
LVM2.2.03.36/lib/device/dev-cache.c:2463:20: acquire_memory: allocated here
LVM2.2.03.36/lib/device/dev-cache.c:2463:12: branch_false: following ‘false’ branch...
 branch_false: ...to here
LVM2.2.03.36/lib/device/dev-cache.c:2466:16: branch_true: following ‘true’ branch...
LVM2.2.03.36/lib/device/dev-cache.c:2467:21: branch_true: ...to here
LVM2.2.03.36/lib/device/dev-cache.c:2475:21: danger: ‘fopen(&_partitions, "r")’ leaks here; was allocated at [(5)](sarif:/runs/0/results/2/codeFlows/0/threadFlows/0/locations/4)
# 2473|   			continue;
# 2474|   
# 2475|-> 		if (dm_snprintf(devname, sizeof(devname), "/dev/%s", namebuf) < 0) {
# 2476|   			devname[0] = '\0';
# 2477|   			stack;

Error: GCC_ANALYZER_WARNING (CWE-775): [#def234]
LVM2.2.03.36/lib/device/dev-cache.c:2477:25: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(&_partitions, "r")’
LVM2.2.03.36/lib/device/dev-cache.c:2398:12: branch_false: following ‘false’ branch (when ‘devno != 0’)...
LVM2.2.03.36/lib/device/dev-cache.c:2405:13: branch_false: ...to here
LVM2.2.03.36/lib/device/dev-cache.c:2437:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/device/dev-cache.c:2462:1: branch_false: ...to here
LVM2.2.03.36/lib/device/dev-cache.c:2463:20: acquire_resource: opened here
LVM2.2.03.36/lib/device/dev-cache.c:2463:12: branch_false: following ‘false’ branch...
 branch_false: ...to here
LVM2.2.03.36/lib/device/dev-cache.c:2466:16: branch_true: following ‘true’ branch...
LVM2.2.03.36/lib/device/dev-cache.c:2467:21: branch_true: ...to here
LVM2.2.03.36/lib/device/dev-cache.c:2475:20: branch_true: following ‘true’ branch...
LVM2.2.03.36/lib/device/dev-cache.c:2476:25: branch_true: ...to here
LVM2.2.03.36/lib/device/dev-cache.c:2477:25: danger: ‘fopen(&_partitions, "r")’ leaks here; was opened at [(5)](sarif:/runs/0/results/3/codeFlows/0/threadFlows/0/locations/4)
# 2475|   		if (dm_snprintf(devname, sizeof(devname), "/dev/%s", namebuf) < 0) {
# 2476|   			devname[0] = '\0';
# 2477|-> 			stack;
# 2478|   		}
# 2479|   		break;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def235]
LVM2.2.03.36/lib/device/dev-cache.c:2477:25: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(&_partitions, "r")’
LVM2.2.03.36/lib/device/dev-cache.c:2398:12: branch_false: following ‘false’ branch (when ‘devno != 0’)...
LVM2.2.03.36/lib/device/dev-cache.c:2405:13: branch_false: ...to here
LVM2.2.03.36/lib/device/dev-cache.c:2437:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/device/dev-cache.c:2462:1: branch_false: ...to here
LVM2.2.03.36/lib/device/dev-cache.c:2463:20: acquire_memory: allocated here
LVM2.2.03.36/lib/device/dev-cache.c:2463:12: branch_false: following ‘false’ branch...
 branch_false: ...to here
LVM2.2.03.36/lib/device/dev-cache.c:2466:16: branch_true: following ‘true’ branch...
LVM2.2.03.36/lib/device/dev-cache.c:2467:21: branch_true: ...to here
LVM2.2.03.36/lib/device/dev-cache.c:2475:20: branch_true: following ‘true’ branch...
LVM2.2.03.36/lib/device/dev-cache.c:2476:25: branch_true: ...to here
LVM2.2.03.36/lib/device/dev-cache.c:2477:25: danger: ‘fopen(&_partitions, "r")’ leaks here; was allocated at [(5)](sarif:/runs/0/results/4/codeFlows/0/threadFlows/0/locations/4)
# 2475|   		if (dm_snprintf(devname, sizeof(devname), "/dev/%s", namebuf) < 0) {
# 2476|   			devname[0] = '\0';
# 2477|-> 			stack;
# 2478|   		}
# 2479|   		break;

Error: GCC_ANALYZER_WARNING (CWE-775): [#def236]
LVM2.2.03.36/lib/device/dev-md.c:371:17: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(&path, "r")’
LVM2.2.03.36/lib/device/dev-md.c:361:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/device/dev-md.c:365:20: branch_false: ...to here
LVM2.2.03.36/lib/device/dev-md.c:365:20: acquire_resource: opened here
LVM2.2.03.36/lib/device/dev-md.c:365:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/device/dev-md.c:370:14: branch_false: ...to here
LVM2.2.03.36/lib/device/dev-md.c:370:12: branch_true: following ‘true’ branch...
LVM2.2.03.36/lib/device/dev-md.c:371:17: branch_true: ...to here
LVM2.2.03.36/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): [#def237]
LVM2.2.03.36/lib/device/dev-md.c:371:17: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(&path, "r")’
LVM2.2.03.36/lib/device/dev-md.c:361:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/device/dev-md.c:365:20: branch_false: ...to here
LVM2.2.03.36/lib/device/dev-md.c:365:20: acquire_memory: allocated here
LVM2.2.03.36/lib/device/dev-md.c:365:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/device/dev-md.c:370:14: branch_false: ...to here
LVM2.2.03.36/lib/device/dev-md.c:370:12: branch_true: following ‘true’ branch...
LVM2.2.03.36/lib/device/dev-md.c:371:17: branch_true: ...to here
LVM2.2.03.36/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): [#def238]
LVM2.2.03.36/lib/device/dev-md.c:376:17: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(&path, "r")’
LVM2.2.03.36/lib/device/dev-md.c:361:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/device/dev-md.c:365:20: branch_false: ...to here
LVM2.2.03.36/lib/device/dev-md.c:365:20: acquire_resource: opened here
LVM2.2.03.36/lib/device/dev-md.c:365:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/device/dev-md.c:370:14: branch_false: ...to here
LVM2.2.03.36/lib/device/dev-md.c:370:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/device/dev-md.c:375:20: branch_false: ...to here
LVM2.2.03.36/lib/device/dev-md.c:375:12: branch_true: following ‘true’ branch (when ‘ret != 1’)...
LVM2.2.03.36/lib/device/dev-md.c:376:17: branch_true: ...to here
LVM2.2.03.36/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): [#def239]
LVM2.2.03.36/lib/device/dev-md.c:376:17: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(&path, "r")’
LVM2.2.03.36/lib/device/dev-md.c:361:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/device/dev-md.c:365:20: branch_false: ...to here
LVM2.2.03.36/lib/device/dev-md.c:365:20: acquire_memory: allocated here
LVM2.2.03.36/lib/device/dev-md.c:365:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/device/dev-md.c:370:14: branch_false: ...to here
LVM2.2.03.36/lib/device/dev-md.c:370:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/device/dev-md.c:375:20: branch_false: ...to here
LVM2.2.03.36/lib/device/dev-md.c:375:12: branch_true: following ‘true’ branch (when ‘ret != 1’)...
LVM2.2.03.36/lib/device/dev-md.c:376:17: branch_true: ...to here
LVM2.2.03.36/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-775): [#def240]
LVM2.2.03.36/lib/device/dev-mpath.c:248:24: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(config_wwids_file, "r")’
LVM2.2.03.36/lib/device/dev-mpath.c:214:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/device/dev-mpath.c:219:20: branch_false: ...to here
LVM2.2.03.36/lib/device/dev-mpath.c:219:20: acquire_resource: opened here
LVM2.2.03.36/lib/device/dev-mpath.c:219:12: branch_false: following ‘false’ branch...
 branch_false: ...to here
LVM2.2.03.36/lib/device/dev-mpath.c:224:16: branch_true: following ‘true’ branch...
LVM2.2.03.36/lib/device/dev-mpath.c:225:21: branch_true: ...to here
LVM2.2.03.36/lib/device/dev-mpath.c:225:20: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/device/dev-mpath.c:230:20: branch_false: ...to here
LVM2.2.03.36/lib/device/dev-mpath.c:245:20: branch_false: following ‘false’ branch (when ‘p’ is NULL)...
LVM2.2.03.36/lib/device/dev-mpath.c:248:68: branch_false: ...to here
LVM2.2.03.36/lib/device/dev-mpath.c:248:24: danger: ‘fopen(config_wwids_file, "r")’ leaks here; was opened at [(3)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/2)
#  246|   			*p = '\0';
#  247|   
#  248|-> 		(void) dm_hash_insert_binary(_wwid_hash_tab, wwid, strlen(wwid), (void*)1);
#  249|   		count++;
#  250|   	}

Error: GCC_ANALYZER_WARNING (CWE-401): [#def241]
LVM2.2.03.36/lib/device/dev-mpath.c:248:24: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(config_wwids_file, "r")’
LVM2.2.03.36/lib/device/dev-mpath.c:214:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/device/dev-mpath.c:219:20: branch_false: ...to here
LVM2.2.03.36/lib/device/dev-mpath.c:219:20: acquire_memory: allocated here
LVM2.2.03.36/lib/device/dev-mpath.c:219:12: branch_false: following ‘false’ branch...
 branch_false: ...to here
LVM2.2.03.36/lib/device/dev-mpath.c:224:16: branch_true: following ‘true’ branch...
LVM2.2.03.36/lib/device/dev-mpath.c:225:21: branch_true: ...to here
LVM2.2.03.36/lib/device/dev-mpath.c:225:20: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/device/dev-mpath.c:230:20: branch_false: ...to here
LVM2.2.03.36/lib/device/dev-mpath.c:245:20: branch_false: following ‘false’ branch (when ‘p’ is NULL)...
LVM2.2.03.36/lib/device/dev-mpath.c:248:68: branch_false: ...to here
LVM2.2.03.36/lib/device/dev-mpath.c:248:24: danger: ‘fopen(config_wwids_file, "r")’ leaks here; was allocated at [(3)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/2)
#  246|   			*p = '\0';
#  247|   
#  248|-> 		(void) dm_hash_insert_binary(_wwid_hash_tab, wwid, strlen(wwid), (void*)1);
#  249|   		count++;
#  250|   	}

Error: GCC_ANALYZER_WARNING (CWE-401): [#def242]
LVM2.2.03.36/lib/device/dev-mpath.c:480:22: warning[-Wanalyzer-malloc-leak]: leak of ‘opendir(&holders_path)’
LVM2.2.03.36/lib/device/dev-mpath.c:416:12: enter_function: entry to ‘_dev_is_mpath_component_sysfs’
LVM2.2.03.36/lib/device/dev-mpath.c:448:30: call_function: calling ‘_get_sysfs_name’ from ‘_dev_is_mpath_component_sysfs’
LVM2.2.03.36/lib/device/dev-mpath.c:448:30: return_function: returning to ‘_dev_is_mpath_component_sysfs’ from ‘_get_sysfs_name’
LVM2.2.03.36/lib/device/dev-mpath.c:448:20: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/device/dev-mpath.c:457:13: branch_false: ...to here
LVM2.2.03.36/lib/device/dev-mpath.c:457:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/device/dev-mpath.c:463:13: branch_false: ...to here
LVM2.2.03.36/lib/device/dev-mpath.c:463:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/device/dev-mpath.c:466:14: branch_false: ...to here
LVM2.2.03.36/lib/device/dev-mpath.c:466:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/device/dev-mpath.c:475:20: branch_false: ...to here
LVM2.2.03.36/lib/device/dev-mpath.c:475:20: acquire_memory: allocated here
LVM2.2.03.36/lib/device/dev-mpath.c:475:12: branch_false: following ‘false’ branch...
 branch_false: ...to here
LVM2.2.03.36/lib/device/dev-mpath.c:480:22: danger: ‘opendir(&holders_path)’ leaks here; was allocated at [(17)](sarif:/runs/0/results/2/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): [#def243]
LVM2.2.03.36/lib/device/dev-mpath.c:705:22: warning[-Wanalyzer-malloc-leak]: leak of ‘opendir(&slaves_path)’
LVM2.2.03.36/lib/device/dev-mpath.c:689:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/device/dev-mpath.c:697:20: branch_false: ...to here
LVM2.2.03.36/lib/device/dev-mpath.c:697:20: acquire_memory: allocated here
LVM2.2.03.36/lib/device/dev-mpath.c:697:12: branch_false: following ‘false’ branch...
 branch_false: ...to here
LVM2.2.03.36/lib/device/dev-mpath.c:705:22: danger: ‘opendir(&slaves_path)’ leaks here; was allocated at [(3)](sarif:/runs/0/results/3/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): [#def244]
LVM2.2.03.36/lib/device/dev-type.c:138:26: warning[-Wanalyzer-malloc-leak]: leak of ‘opendir(&holders_path)’
LVM2.2.03.36/lib/device/dev-type.c:129:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/device/dev-type.c:135:19: branch_false: ...to here
LVM2.2.03.36/lib/device/dev-type.c:135:19: acquire_memory: allocated here
LVM2.2.03.36/lib/device/dev-type.c:135:12: branch_false: following ‘false’ branch...
 branch_false: ...to here
LVM2.2.03.36/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): [#def245]
LVM2.2.03.36/lib/device/dev-type.c:241:17: warning[-Wanalyzer-malloc-leak]: leak of ‘calloc(1, 32804)’
LVM2.2.03.36/lib/device/dev-type.c:220:19: enter_function: entry to ‘create_dev_types’
LVM2.2.03.36/lib/device/dev-type.c:235:20: call_function: inlined call to ‘zalloc’ from ‘create_dev_types’
LVM2.2.03.36/lib/device/dev-type.c:235:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/device/dev-type.c:240:14: branch_false: ...to here
LVM2.2.03.36/lib/device/dev-type.c:240:12: branch_true: following ‘true’ branch...
LVM2.2.03.36/lib/device/dev-type.c:241:17: branch_true: ...to here
LVM2.2.03.36/lib/device/dev-type.c:241:17: danger: ‘calloc(1, 32804)’ leaks here; was allocated at [(3)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/2)
#  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++)
#  243|   			dt->dev_type_array[i].max_partitions = 1;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def246]
LVM2.2.03.36/lib/device/dev-type.c:247:13: warning[-Wanalyzer-malloc-leak]: leak of ‘calloc(1, 32804)’
LVM2.2.03.36/lib/device/dev-type.c:220:19: enter_function: entry to ‘create_dev_types’
LVM2.2.03.36/lib/device/dev-type.c:235:20: call_function: inlined call to ‘zalloc’ from ‘create_dev_types’
LVM2.2.03.36/lib/device/dev-type.c:235:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/device/dev-type.c:240:14: branch_false: ...to here
LVM2.2.03.36/lib/device/dev-type.c:240:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/device/dev-type.c:247:13: branch_false: ...to here
LVM2.2.03.36/lib/device/dev-type.c:247:13: danger: ‘calloc(1, 32804)’ leaks here; was allocated at [(3)](sarif:/runs/0/results/2/codeFlows/0/threadFlows/0/locations/2)
#  245|   	}
#  246|   
#  247|-> 	if (dm_snprintf(proc_devices, sizeof(proc_devices),
#  248|   			 "%s/devices", proc_dir) < 0) {
#  249|   		log_error("Failed to create /proc/devices string");

Error: GCC_ANALYZER_WARNING (CWE-401): [#def247]
LVM2.2.03.36/lib/device/dev-type.c:249:17: warning[-Wanalyzer-malloc-leak]: leak of ‘calloc(1, 32804)’
LVM2.2.03.36/lib/device/dev-type.c:220:19: enter_function: entry to ‘create_dev_types’
LVM2.2.03.36/lib/device/dev-type.c:235:20: call_function: inlined call to ‘zalloc’ from ‘create_dev_types’
LVM2.2.03.36/lib/device/dev-type.c:235:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/device/dev-type.c:240:14: branch_false: ...to here
LVM2.2.03.36/lib/device/dev-type.c:240:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/device/dev-type.c:247:13: branch_false: ...to here
LVM2.2.03.36/lib/device/dev-type.c:247:12: branch_true: following ‘true’ branch...
LVM2.2.03.36/lib/device/dev-type.c:249:17: branch_true: ...to here
LVM2.2.03.36/lib/device/dev-type.c:249:17: danger: ‘calloc(1, 32804)’ leaks here; was allocated at [(3)](sarif:/runs/0/results/3/codeFlows/0/threadFlows/0/locations/2)
#  247|   	if (dm_snprintf(proc_devices, sizeof(proc_devices),
#  248|   			 "%s/devices", proc_dir) < 0) {
#  249|-> 		log_error("Failed to create /proc/devices string");
#  250|   		goto bad;
#  251|   	}

Error: GCC_ANALYZER_WARNING (CWE-401): [#def248]
LVM2.2.03.36/lib/device/dev-type.c:254:17: warning[-Wanalyzer-malloc-leak]: leak of ‘calloc(1, 32804)’
LVM2.2.03.36/lib/device/dev-type.c:220:19: enter_function: entry to ‘create_dev_types’
LVM2.2.03.36/lib/device/dev-type.c:235:20: call_function: inlined call to ‘zalloc’ from ‘create_dev_types’
LVM2.2.03.36/lib/device/dev-type.c:235:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/device/dev-type.c:240:14: branch_false: ...to here
LVM2.2.03.36/lib/device/dev-type.c:240:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/device/dev-type.c:247:13: branch_false: ...to here
LVM2.2.03.36/lib/device/dev-type.c:247:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/device/dev-type.c:253:20: branch_false: ...to here
LVM2.2.03.36/lib/device/dev-type.c:253:12: branch_true: following ‘true’ branch...
LVM2.2.03.36/lib/device/dev-type.c:254:17: branch_true: ...to here
LVM2.2.03.36/lib/device/dev-type.c:254:17: danger: ‘calloc(1, 32804)’ leaks here; was allocated at [(3)](sarif:/runs/0/results/4/codeFlows/0/threadFlows/0/locations/2)
#  252|   
#  253|   	if (!(pd = fopen(proc_devices, "r"))) {
#  254|-> 		log_sys_error("fopen", proc_devices);
#  255|   		goto bad;
#  256|   	}

Error: GCC_ANALYZER_WARNING (CWE-775): [#def249]
LVM2.2.03.36/lib/device/dev-type.c:273:25: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(&proc_devices, "r")’
LVM2.2.03.36/lib/device/dev-type.c:235:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/device/dev-type.c:240:14: branch_false: ...to here
LVM2.2.03.36/lib/device/dev-type.c:240:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/device/dev-type.c:247:13: branch_false: ...to here
LVM2.2.03.36/lib/device/dev-type.c:247:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/device/dev-type.c:253:20: branch_false: ...to here
LVM2.2.03.36/lib/device/dev-type.c:253:20: acquire_resource: opened here
LVM2.2.03.36/lib/device/dev-type.c:253:12: branch_false: following ‘false’ branch...
 branch_false: ...to here
LVM2.2.03.36/lib/device/dev-type.c:258:16: branch_true: following ‘true’ branch...
 branch_true: ...to here
LVM2.2.03.36/lib/device/dev-type.c:266:20: branch_true: following ‘true’ branch...
LVM2.2.03.36/lib/device/dev-type.c:272:35: branch_true: ...to here
LVM2.2.03.36/lib/device/dev-type.c:272:28: branch_false: following ‘false’ branch (when ‘nl’ is NULL)...
LVM2.2.03.36/lib/device/dev-type.c:273:25: branch_false: ...to here
LVM2.2.03.36/lib/device/dev-type.c:273:25: danger: ‘fopen(&proc_devices, "r")’ leaks here; was opened at [(7)](sarif:/runs/0/results/5/codeFlows/0/threadFlows/0/locations/6)
#  271|   			 */
#  272|   			if ((nl = strchr(line, '\n'))) *nl = '\0';
#  273|-> 			log_warn("WARNING: /proc/devices line: %s, replacing major with %d.",
#  274|   				 line, line_maj & (NUMBER_OF_MAJORS - 1));
#  275|   			line_maj &= (NUMBER_OF_MAJORS - 1);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def250]
LVM2.2.03.36/lib/device/dev-type.c:273:25: warning[-Wanalyzer-malloc-leak]: leak of ‘calloc(1, 32804)’
LVM2.2.03.36/lib/device/dev-type.c:220:19: enter_function: entry to ‘create_dev_types’
LVM2.2.03.36/lib/device/dev-type.c:235:20: call_function: inlined call to ‘zalloc’ from ‘create_dev_types’
LVM2.2.03.36/lib/device/dev-type.c:235:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/device/dev-type.c:240:14: branch_false: ...to here
LVM2.2.03.36/lib/device/dev-type.c:240:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/device/dev-type.c:247:13: branch_false: ...to here
LVM2.2.03.36/lib/device/dev-type.c:247:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/device/dev-type.c:253:20: branch_false: ...to here
LVM2.2.03.36/lib/device/dev-type.c:253:12: branch_false: following ‘false’ branch...
 branch_false: ...to here
LVM2.2.03.36/lib/device/dev-type.c:258:16: branch_true: following ‘true’ branch...
 branch_true: ...to here
LVM2.2.03.36/lib/device/dev-type.c:266:20: branch_true: following ‘true’ branch...
LVM2.2.03.36/lib/device/dev-type.c:272:35: branch_true: ...to here
LVM2.2.03.36/lib/device/dev-type.c:272:28: branch_false: following ‘false’ branch (when ‘nl’ is NULL)...
LVM2.2.03.36/lib/device/dev-type.c:273:25: branch_false: ...to here
LVM2.2.03.36/lib/device/dev-type.c:273:25: danger: ‘calloc(1, 32804)’ leaks here; was allocated at [(3)](sarif:/runs/0/results/6/codeFlows/0/threadFlows/0/locations/2)
#  271|   			 */
#  272|   			if ((nl = strchr(line, '\n'))) *nl = '\0';
#  273|-> 			log_warn("WARNING: /proc/devices line: %s, replacing major with %d.",
#  274|   				 line, line_maj & (NUMBER_OF_MAJORS - 1));
#  275|   			line_maj &= (NUMBER_OF_MAJORS - 1);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def251]
LVM2.2.03.36/lib/device/dev-type.c:273:25: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(&proc_devices, "r")’
LVM2.2.03.36/lib/device/dev-type.c:235:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/device/dev-type.c:240:14: branch_false: ...to here
LVM2.2.03.36/lib/device/dev-type.c:240:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/device/dev-type.c:247:13: branch_false: ...to here
LVM2.2.03.36/lib/device/dev-type.c:247:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/device/dev-type.c:253:20: branch_false: ...to here
LVM2.2.03.36/lib/device/dev-type.c:253:20: acquire_memory: allocated here
LVM2.2.03.36/lib/device/dev-type.c:253:12: branch_false: following ‘false’ branch...
 branch_false: ...to here
LVM2.2.03.36/lib/device/dev-type.c:258:16: branch_true: following ‘true’ branch...
 branch_true: ...to here
LVM2.2.03.36/lib/device/dev-type.c:266:20: branch_true: following ‘true’ branch...
LVM2.2.03.36/lib/device/dev-type.c:272:35: branch_true: ...to here
LVM2.2.03.36/lib/device/dev-type.c:272:28: branch_false: following ‘false’ branch (when ‘nl’ is NULL)...
LVM2.2.03.36/lib/device/dev-type.c:273:25: branch_false: ...to here
LVM2.2.03.36/lib/device/dev-type.c:273:25: danger: ‘fopen(&proc_devices, "r")’ leaks here; was allocated at [(7)](sarif:/runs/0/results/7/codeFlows/0/threadFlows/0/locations/6)
#  271|   			 */
#  272|   			if ((nl = strchr(line, '\n'))) *nl = '\0';
#  273|-> 			log_warn("WARNING: /proc/devices line: %s, replacing major with %d.",
#  274|   				 line, line_maj & (NUMBER_OF_MAJORS - 1));
#  275|   			line_maj &= (NUMBER_OF_MAJORS - 1);

Error: GCC_ANALYZER_WARNING (CWE-835): [#def252]
LVM2.2.03.36/lib/device/dev-type.c:288:24: warning[-Wanalyzer-infinite-loop]: infinite loop
LVM2.2.03.36/lib/device/dev-type.c:288:24: danger: infinite loop here
LVM2.2.03.36/lib/device/dev-type.c:288:24: branch_true: if it ever follows ‘true’ branch, it will always do so...
LVM2.2.03.36/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-835): [#def253]
LVM2.2.03.36/lib/device/dev-type.c:290:24: warning[-Wanalyzer-infinite-loop]: infinite loop
LVM2.2.03.36/lib/device/dev-type.c:290:24: danger: infinite loop here
LVM2.2.03.36/lib/device/dev-type.c:290:24: branch_true: if it ever follows ‘true’ branch, it will always do so...
LVM2.2.03.36/lib/device/dev-type.c:291:25: branch_true: ...to here
#  288|   		while (line[i] != ' ' && line[i] != '\0')
#  289|   			i++;
#  290|-> 		while (line[i] == ' ')
#  291|   			i++;
#  292|   

Error: GCC_ANALYZER_WARNING (CWE-775): [#def254]
LVM2.2.03.36/lib/device/dev-type.c:352:33: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(&proc_devices, "r")’
LVM2.2.03.36/lib/device/dev-type.c:235:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/device/dev-type.c:240:14: branch_false: ...to here
LVM2.2.03.36/lib/device/dev-type.c:240:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/device/dev-type.c:247:13: branch_false: ...to here
LVM2.2.03.36/lib/device/dev-type.c:247:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/device/dev-type.c:253:20: branch_false: ...to here
LVM2.2.03.36/lib/device/dev-type.c:253:20: acquire_resource: opened here
LVM2.2.03.36/lib/device/dev-type.c:253:12: branch_false: following ‘false’ branch...
 branch_false: ...to here
LVM2.2.03.36/lib/device/dev-type.c:258:16: branch_true: following ‘true’ branch...
 branch_true: ...to here
LVM2.2.03.36/lib/device/dev-type.c:258:16: branch_true: following ‘true’ branch...
 branch_true: ...to here
LVM2.2.03.36/lib/device/dev-type.c:335:29: branch_true: following ‘true’ branch...
LVM2.2.03.36/lib/device/dev-type.c:336:42: branch_true: ...to here
LVM2.2.03.36/lib/device/dev-type.c:337:28: branch_true: following ‘true’ branch...
LVM2.2.03.36/lib/device/dev-type.c:338:30: branch_true: ...to here
LVM2.2.03.36/lib/device/dev-type.c:337:29: branch_true: following ‘true’ branch...
LVM2.2.03.36/lib/device/dev-type.c:337:29: branch_true: ...to here
LVM2.2.03.36/lib/device/dev-type.c:337:29: branch_true: following ‘true’ branch (when ‘line_maj <= 4095’)...
LVM2.2.03.36/lib/device/dev-type.c:341:41: branch_true: ...to here
LVM2.2.03.36/lib/device/dev-type.c:346:20: branch_false: following ‘false’ branch (when ‘cn’ is non-NULL)...
LVM2.2.03.36/lib/device/dev-type.c:350:22: branch_false: ...to here
LVM2.2.03.36/lib/device/dev-type.c:350:34: branch_true: following ‘true’ branch (when ‘cv’ is non-NULL)...
LVM2.2.03.36/lib/device/dev-type.c:351:29: branch_true: ...to here
LVM2.2.03.36/lib/device/dev-type.c:352:33: danger: ‘fopen(&proc_devices, "r")’ leaks here; was opened at [(7)](sarif:/runs/0/results/10/codeFlows/0/threadFlows/0/locations/6)
#  350|   		for (cv = cn->v; cv; cv = cv->next) {
#  351|   			if (cv->type != DM_CFG_STRING) {
#  352|-> 				log_error("Expecting string in devices/types "
#  353|   					  "in config file");
#  354|   				if (fclose(pd))

Error: GCC_ANALYZER_WARNING (CWE-401): [#def255]
LVM2.2.03.36/lib/device/dev-type.c:352:33: warning[-Wanalyzer-malloc-leak]: leak of ‘calloc(1, 32804)’
LVM2.2.03.36/lib/device/dev-type.c:220:19: enter_function: entry to ‘create_dev_types’
LVM2.2.03.36/lib/device/dev-type.c:235:20: call_function: inlined call to ‘zalloc’ from ‘create_dev_types’
LVM2.2.03.36/lib/device/dev-type.c:235:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/device/dev-type.c:240:14: branch_false: ...to here
LVM2.2.03.36/lib/device/dev-type.c:240:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/device/dev-type.c:247:13: branch_false: ...to here
LVM2.2.03.36/lib/device/dev-type.c:247:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/device/dev-type.c:253:20: branch_false: ...to here
LVM2.2.03.36/lib/device/dev-type.c:253:12: branch_false: following ‘false’ branch...
 branch_false: ...to here
LVM2.2.03.36/lib/device/dev-type.c:258:16: branch_true: following ‘true’ branch...
 branch_true: ...to here
LVM2.2.03.36/lib/device/dev-type.c:258:16: branch_true: following ‘true’ branch...
 branch_true: ...to here
LVM2.2.03.36/lib/device/dev-type.c:335:29: branch_true: following ‘true’ branch...
LVM2.2.03.36/lib/device/dev-type.c:336:42: branch_true: ...to here
LVM2.2.03.36/lib/device/dev-type.c:337:28: branch_true: following ‘true’ branch...
LVM2.2.03.36/lib/device/dev-type.c:338:30: branch_true: ...to here
LVM2.2.03.36/lib/device/dev-type.c:337:29: branch_true: following ‘true’ branch...
LVM2.2.03.36/lib/device/dev-type.c:337:29: branch_true: ...to here
LVM2.2.03.36/lib/device/dev-type.c:337:29: branch_true: following ‘true’ branch (when ‘line_maj <= 4095’)...
LVM2.2.03.36/lib/device/dev-type.c:341:41: branch_true: ...to here
LVM2.2.03.36/lib/device/dev-type.c:346:20: branch_false: following ‘false’ branch (when ‘cn’ is non-NULL)...
LVM2.2.03.36/lib/device/dev-type.c:350:22: branch_false: ...to here
LVM2.2.03.36/lib/device/dev-type.c:350:34: branch_true: following ‘true’ branch (when ‘cv’ is non-NULL)...
LVM2.2.03.36/lib/device/dev-type.c:351:29: branch_true: ...to here
LVM2.2.03.36/lib/device/dev-type.c:352:33: danger: ‘calloc(1, 32804)’ leaks here; was allocated at [(3)](sarif:/runs/0/results/11/codeFlows/0/threadFlows/0/locations/2)
#  350|   		for (cv = cn->v; cv; cv = cv->next) {
#  351|   			if (cv->type != DM_CFG_STRING) {
#  352|-> 				log_error("Expecting string in devices/types "
#  353|   					  "in config file");
#  354|   				if (fclose(pd))

Error: GCC_ANALYZER_WARNING (CWE-401): [#def256]
LVM2.2.03.36/lib/device/dev-type.c:352:33: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(&proc_devices, "r")’
LVM2.2.03.36/lib/device/dev-type.c:235:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/device/dev-type.c:240:14: branch_false: ...to here
LVM2.2.03.36/lib/device/dev-type.c:240:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/device/dev-type.c:247:13: branch_false: ...to here
LVM2.2.03.36/lib/device/dev-type.c:247:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/device/dev-type.c:253:20: branch_false: ...to here
LVM2.2.03.36/lib/device/dev-type.c:253:20: acquire_memory: allocated here
LVM2.2.03.36/lib/device/dev-type.c:253:12: branch_false: following ‘false’ branch...
 branch_false: ...to here
LVM2.2.03.36/lib/device/dev-type.c:258:16: branch_true: following ‘true’ branch...
 branch_true: ...to here
LVM2.2.03.36/lib/device/dev-type.c:258:16: branch_true: following ‘true’ branch...
 branch_true: ...to here
LVM2.2.03.36/lib/device/dev-type.c:335:29: branch_true: following ‘true’ branch...
LVM2.2.03.36/lib/device/dev-type.c:336:42: branch_true: ...to here
LVM2.2.03.36/lib/device/dev-type.c:337:28: branch_true: following ‘true’ branch...
LVM2.2.03.36/lib/device/dev-type.c:338:30: branch_true: ...to here
LVM2.2.03.36/lib/device/dev-type.c:337:29: branch_true: following ‘true’ branch...
LVM2.2.03.36/lib/device/dev-type.c:337:29: branch_true: ...to here
LVM2.2.03.36/lib/device/dev-type.c:337:29: branch_true: following ‘true’ branch (when ‘line_maj <= 4095’)...
LVM2.2.03.36/lib/device/dev-type.c:341:41: branch_true: ...to here
LVM2.2.03.36/lib/device/dev-type.c:346:20: branch_false: following ‘false’ branch (when ‘cn’ is non-NULL)...
LVM2.2.03.36/lib/device/dev-type.c:350:22: branch_false: ...to here
LVM2.2.03.36/lib/device/dev-type.c:350:34: branch_true: following ‘true’ branch (when ‘cv’ is non-NULL)...
LVM2.2.03.36/lib/device/dev-type.c:351:29: branch_true: ...to here
LVM2.2.03.36/lib/device/dev-type.c:352:33: danger: ‘fopen(&proc_devices, "r")’ leaks here; was allocated at [(7)](sarif:/runs/0/results/12/codeFlows/0/threadFlows/0/locations/6)
#  350|   		for (cv = cn->v; cv; cv = cv->next) {
#  351|   			if (cv->type != DM_CFG_STRING) {
#  352|-> 				log_error("Expecting string in devices/types "
#  353|   					  "in config file");
#  354|   				if (fclose(pd))

Error: GCC_ANALYZER_WARNING (CWE-401): [#def257]
LVM2.2.03.36/lib/device/dev-type.c:355:41: warning[-Wanalyzer-malloc-leak]: leak of ‘calloc(1, 32804)’
LVM2.2.03.36/lib/device/dev-type.c:220:19: enter_function: entry to ‘create_dev_types’
LVM2.2.03.36/lib/device/dev-type.c:235:20: call_function: inlined call to ‘zalloc’ from ‘create_dev_types’
LVM2.2.03.36/lib/device/dev-type.c:235:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/device/dev-type.c:240:14: branch_false: ...to here
LVM2.2.03.36/lib/device/dev-type.c:240:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/device/dev-type.c:247:13: branch_false: ...to here
LVM2.2.03.36/lib/device/dev-type.c:247:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/device/dev-type.c:253:20: branch_false: ...to here
LVM2.2.03.36/lib/device/dev-type.c:253:12: branch_false: following ‘false’ branch...
 branch_false: ...to here
LVM2.2.03.36/lib/device/dev-type.c:258:16: branch_true: following ‘true’ branch...
 branch_true: ...to here
LVM2.2.03.36/lib/device/dev-type.c:258:16: branch_true: following ‘true’ branch...
 branch_true: ...to here
LVM2.2.03.36/lib/device/dev-type.c:335:29: branch_true: following ‘true’ branch...
LVM2.2.03.36/lib/device/dev-type.c:336:42: branch_true: ...to here
LVM2.2.03.36/lib/device/dev-type.c:337:28: branch_true: following ‘true’ branch...
LVM2.2.03.36/lib/device/dev-type.c:338:30: branch_true: ...to here
LVM2.2.03.36/lib/device/dev-type.c:337:29: branch_true: following ‘true’ branch...
LVM2.2.03.36/lib/device/dev-type.c:337:29: branch_true: ...to here
LVM2.2.03.36/lib/device/dev-type.c:337:29: branch_true: following ‘true’ branch (when ‘line_maj <= 4095’)...
LVM2.2.03.36/lib/device/dev-type.c:341:41: branch_true: ...to here
LVM2.2.03.36/lib/device/dev-type.c:346:20: branch_false: following ‘false’ branch (when ‘cn’ is non-NULL)...
LVM2.2.03.36/lib/device/dev-type.c:350:22: branch_false: ...to here
LVM2.2.03.36/lib/device/dev-type.c:350:34: branch_true: following ‘true’ branch (when ‘cv’ is non-NULL)...
LVM2.2.03.36/lib/device/dev-type.c:351:29: branch_true: ...to here
LVM2.2.03.36/lib/device/dev-type.c:354:36: branch_true: following ‘true’ branch...
LVM2.2.03.36/lib/device/dev-type.c:355:41: branch_true: ...to here
LVM2.2.03.36/lib/device/dev-type.c:355:41: danger: ‘calloc(1, 32804)’ leaks here; was allocated at [(3)](sarif:/runs/0/results/13/codeFlows/0/threadFlows/0/locations/2)
#  353|   					  "in config file");
#  354|   				if (fclose(pd))
#  355|-> 					log_sys_debug("fclose", proc_devices);
#  356|   				goto bad;
#  357|   			}

Error: GCC_ANALYZER_WARNING (CWE-775): [#def258]
LVM2.2.03.36/lib/device/dev-type.c:362:33: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(&proc_devices, "r")’
LVM2.2.03.36/lib/device/dev-type.c:235:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/device/dev-type.c:240:14: branch_false: ...to here
LVM2.2.03.36/lib/device/dev-type.c:240:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/device/dev-type.c:247:13: branch_false: ...to here
LVM2.2.03.36/lib/device/dev-type.c:247:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/device/dev-type.c:253:20: branch_false: ...to here
LVM2.2.03.36/lib/device/dev-type.c:253:20: acquire_resource: opened here
LVM2.2.03.36/lib/device/dev-type.c:253:12: branch_false: following ‘false’ branch...
 branch_false: ...to here
LVM2.2.03.36/lib/device/dev-type.c:258:16: branch_true: following ‘true’ branch...
 branch_true: ...to here
LVM2.2.03.36/lib/device/dev-type.c:258:16: branch_true: following ‘true’ branch...
 branch_true: ...to here
LVM2.2.03.36/lib/device/dev-type.c:335:29: branch_true: following ‘true’ branch...
LVM2.2.03.36/lib/device/dev-type.c:336:42: branch_true: ...to here
LVM2.2.03.36/lib/device/dev-type.c:337:28: branch_true: following ‘true’ branch...
LVM2.2.03.36/lib/device/dev-type.c:338:30: branch_true: ...to here
LVM2.2.03.36/lib/device/dev-type.c:337:29: branch_true: following ‘true’ branch...
LVM2.2.03.36/lib/device/dev-type.c:337:29: branch_true: ...to here
LVM2.2.03.36/lib/device/dev-type.c:337:29: branch_true: following ‘true’ branch (when ‘line_maj <= 4095’)...
LVM2.2.03.36/lib/device/dev-type.c:341:41: branch_true: ...to here
LVM2.2.03.36/lib/device/dev-type.c:346:20: branch_false: following ‘false’ branch (when ‘cn’ is non-NULL)...
LVM2.2.03.36/lib/device/dev-type.c:350:22: branch_false: ...to here
LVM2.2.03.36/lib/device/dev-type.c:350:34: branch_true: following ‘true’ branch (when ‘cv’ is non-NULL)...
LVM2.2.03.36/lib/device/dev-type.c:351:29: branch_true: ...to here
LVM2.2.03.36/lib/device/dev-type.c:351:28: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/device/dev-type.c:358:42: branch_false: ...to here
LVM2.2.03.36/lib/device/dev-type.c:362:33: danger: ‘fopen(&proc_devices, "r")’ leaks here; was opened at [(7)](sarif:/runs/0/results/14/codeFlows/0/threadFlows/0/locations/6)
#  360|   			cv = cv->next;
#  361|   			if (!cv || cv->type != DM_CFG_INT) {
#  362|-> 				log_error("Max partition count missing for %s "
#  363|   					  "in devices/types in config file",
#  364|   					  name);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def259]
LVM2.2.03.36/lib/device/dev-type.c:362:33: warning[-Wanalyzer-malloc-leak]: leak of ‘calloc(1, 32804)’
LVM2.2.03.36/lib/device/dev-type.c:220:19: enter_function: entry to ‘create_dev_types’
LVM2.2.03.36/lib/device/dev-type.c:235:20: call_function: inlined call to ‘zalloc’ from ‘create_dev_types’
LVM2.2.03.36/lib/device/dev-type.c:235:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/device/dev-type.c:240:14: branch_false: ...to here
LVM2.2.03.36/lib/device/dev-type.c:240:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/device/dev-type.c:247:13: branch_false: ...to here
LVM2.2.03.36/lib/device/dev-type.c:247:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/device/dev-type.c:253:20: branch_false: ...to here
LVM2.2.03.36/lib/device/dev-type.c:253:12: branch_false: following ‘false’ branch...
 branch_false: ...to here
LVM2.2.03.36/lib/device/dev-type.c:258:16: branch_true: following ‘true’ branch...
 branch_true: ...to here
LVM2.2.03.36/lib/device/dev-type.c:258:16: branch_true: following ‘true’ branch...
 branch_true: ...to here
LVM2.2.03.36/lib/device/dev-type.c:335:29: branch_true: following ‘true’ branch...
LVM2.2.03.36/lib/device/dev-type.c:336:42: branch_true: ...to here
LVM2.2.03.36/lib/device/dev-type.c:337:28: branch_true: following ‘true’ branch...
LVM2.2.03.36/lib/device/dev-type.c:338:30: branch_true: ...to here
LVM2.2.03.36/lib/device/dev-type.c:337:29: branch_true: following ‘true’ branch...
LVM2.2.03.36/lib/device/dev-type.c:337:29: branch_true: ...to here
LVM2.2.03.36/lib/device/dev-type.c:337:29: branch_true: following ‘true’ branch (when ‘line_maj <= 4095’)...
LVM2.2.03.36/lib/device/dev-type.c:341:41: branch_true: ...to here
LVM2.2.03.36/lib/device/dev-type.c:346:20: branch_false: following ‘false’ branch (when ‘cn’ is non-NULL)...
LVM2.2.03.36/lib/device/dev-type.c:350:22: branch_false: ...to here
LVM2.2.03.36/lib/device/dev-type.c:350:34: branch_true: following ‘true’ branch (when ‘cv’ is non-NULL)...
LVM2.2.03.36/lib/device/dev-type.c:351:29: branch_true: ...to here
LVM2.2.03.36/lib/device/dev-type.c:351:28: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/device/dev-type.c:358:42: branch_false: ...to here
LVM2.2.03.36/lib/device/dev-type.c:362:33: danger: ‘calloc(1, 32804)’ leaks here; was allocated at [(3)](sarif:/runs/0/results/15/codeFlows/0/threadFlows/0/locations/2)
#  360|   			cv = cv->next;
#  361|   			if (!cv || cv->type != DM_CFG_INT) {
#  362|-> 				log_error("Max partition count missing for %s "
#  363|   					  "in devices/types in config file",
#  364|   					  name);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def260]
LVM2.2.03.36/lib/device/dev-type.c:362:33: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(&proc_devices, "r")’
LVM2.2.03.36/lib/device/dev-type.c:235:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/device/dev-type.c:240:14: branch_false: ...to here
LVM2.2.03.36/lib/device/dev-type.c:240:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/device/dev-type.c:247:13: branch_false: ...to here
LVM2.2.03.36/lib/device/dev-type.c:247:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/device/dev-type.c:253:20: branch_false: ...to here
LVM2.2.03.36/lib/device/dev-type.c:253:20: acquire_memory: allocated here
LVM2.2.03.36/lib/device/dev-type.c:253:12: branch_false: following ‘false’ branch...
 branch_false: ...to here
LVM2.2.03.36/lib/device/dev-type.c:258:16: branch_true: following ‘true’ branch...
 branch_true: ...to here
LVM2.2.03.36/lib/device/dev-type.c:258:16: branch_true: following ‘true’ branch...
 branch_true: ...to here
LVM2.2.03.36/lib/device/dev-type.c:335:29: branch_true: following ‘true’ branch...
LVM2.2.03.36/lib/device/dev-type.c:336:42: branch_true: ...to here
LVM2.2.03.36/lib/device/dev-type.c:337:28: branch_true: following ‘true’ branch...
LVM2.2.03.36/lib/device/dev-type.c:338:30: branch_true: ...to here
LVM2.2.03.36/lib/device/dev-type.c:337:29: branch_true: following ‘true’ branch...
LVM2.2.03.36/lib/device/dev-type.c:337:29: branch_true: ...to here
LVM2.2.03.36/lib/device/dev-type.c:337:29: branch_true: following ‘true’ branch (when ‘line_maj <= 4095’)...
LVM2.2.03.36/lib/device/dev-type.c:341:41: branch_true: ...to here
LVM2.2.03.36/lib/device/dev-type.c:346:20: branch_false: following ‘false’ branch (when ‘cn’ is non-NULL)...
LVM2.2.03.36/lib/device/dev-type.c:350:22: branch_false: ...to here
LVM2.2.03.36/lib/device/dev-type.c:350:34: branch_true: following ‘true’ branch (when ‘cv’ is non-NULL)...
LVM2.2.03.36/lib/device/dev-type.c:351:29: branch_true: ...to here
LVM2.2.03.36/lib/device/dev-type.c:351:28: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/device/dev-type.c:358:42: branch_false: ...to here
LVM2.2.03.36/lib/device/dev-type.c:362:33: danger: ‘fopen(&proc_devices, "r")’ leaks here; was allocated at [(7)](sarif:/runs/0/results/16/codeFlows/0/threadFlows/0/locations/6)
#  360|   			cv = cv->next;
#  361|   			if (!cv || cv->type != DM_CFG_INT) {
#  362|-> 				log_error("Max partition count missing for %s "
#  363|   					  "in devices/types in config file",
#  364|   					  name);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def261]
LVM2.2.03.36/lib/device/dev-type.c:366:41: warning[-Wanalyzer-malloc-leak]: leak of ‘calloc(1, 32804)’
LVM2.2.03.36/lib/device/dev-type.c:220:19: enter_function: entry to ‘create_dev_types’
LVM2.2.03.36/lib/device/dev-type.c:235:20: call_function: inlined call to ‘zalloc’ from ‘create_dev_types’
LVM2.2.03.36/lib/device/dev-type.c:235:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/device/dev-type.c:240:14: branch_false: ...to here
LVM2.2.03.36/lib/device/dev-type.c:240:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/device/dev-type.c:247:13: branch_false: ...to here
LVM2.2.03.36/lib/device/dev-type.c:247:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/device/dev-type.c:253:20: branch_false: ...to here
LVM2.2.03.36/lib/device/dev-type.c:253:12: branch_false: following ‘false’ branch...
 branch_false: ...to here
LVM2.2.03.36/lib/device/dev-type.c:258:16: branch_true: following ‘true’ branch...
 branch_true: ...to here
LVM2.2.03.36/lib/device/dev-type.c:258:16: branch_true: following ‘true’ branch...
 branch_true: ...to here
LVM2.2.03.36/lib/device/dev-type.c:335:29: branch_true: following ‘true’ branch...
LVM2.2.03.36/lib/device/dev-type.c:336:42: branch_true: ...to here
LVM2.2.03.36/lib/device/dev-type.c:337:28: branch_true: following ‘true’ branch...
LVM2.2.03.36/lib/device/dev-type.c:338:30: branch_true: ...to here
LVM2.2.03.36/lib/device/dev-type.c:337:29: branch_true: following ‘true’ branch...
LVM2.2.03.36/lib/device/dev-type.c:337:29: branch_true: ...to here
LVM2.2.03.36/lib/device/dev-type.c:337:29: branch_true: following ‘true’ branch (when ‘line_maj <= 4095’)...
LVM2.2.03.36/lib/device/dev-type.c:341:41: branch_true: ...to here
LVM2.2.03.36/lib/device/dev-type.c:346:20: branch_false: following ‘false’ branch (when ‘cn’ is non-NULL)...
LVM2.2.03.36/lib/device/dev-type.c:350:22: branch_false: ...to here
LVM2.2.03.36/lib/device/dev-type.c:350:34: branch_true: following ‘true’ branch (when ‘cv’ is non-NULL)...
LVM2.2.03.36/lib/device/dev-type.c:351:29: branch_true: ...to here
LVM2.2.03.36/lib/device/dev-type.c:351:28: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/device/dev-type.c:358:42: branch_false: ...to here
LVM2.2.03.36/lib/device/dev-type.c:365:36: branch_true: following ‘true’ branch...
LVM2.2.03.36/lib/device/dev-type.c:366:41: branch_true: ...to here
LVM2.2.03.36/lib/device/dev-type.c:366:41: danger: ‘calloc(1, 32804)’ leaks here; was allocated at [(3)](sarif:/runs/0/results/17/codeFlows/0/threadFlows/0/locations/2)
#  364|   					  name);
#  365|   				if (fclose(pd))
#  366|-> 					log_sys_debug("fclose", proc_devices);
#  367|   				goto bad;
#  368|   			}

Error: GCC_ANALYZER_WARNING (CWE-775): [#def262]
LVM2.2.03.36/lib/device/dev-type.c:370:33: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(&proc_devices, "r")’
LVM2.2.03.36/lib/device/dev-type.c:235:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/device/dev-type.c:240:14: branch_false: ...to here
LVM2.2.03.36/lib/device/dev-type.c:240:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/device/dev-type.c:247:13: branch_false: ...to here
LVM2.2.03.36/lib/device/dev-type.c:247:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/device/dev-type.c:253:20: branch_false: ...to here
LVM2.2.03.36/lib/device/dev-type.c:253:20: acquire_resource: opened here
LVM2.2.03.36/lib/device/dev-type.c:253:12: branch_false: following ‘false’ branch...
 branch_false: ...to here
LVM2.2.03.36/lib/device/dev-type.c:258:16: branch_true: following ‘true’ branch...
 branch_true: ...to here
LVM2.2.03.36/lib/device/dev-type.c:258:16: branch_true: following ‘true’ branch...
 branch_true: ...to here
LVM2.2.03.36/lib/device/dev-type.c:335:29: branch_true: following ‘true’ branch...
LVM2.2.03.36/lib/device/dev-type.c:336:42: branch_true: ...to here
LVM2.2.03.36/lib/device/dev-type.c:337:28: branch_true: following ‘true’ branch...
LVM2.2.03.36/lib/device/dev-type.c:338:30: branch_true: ...to here
LVM2.2.03.36/lib/device/dev-type.c:337:29: branch_true: following ‘true’ branch...
LVM2.2.03.36/lib/device/dev-type.c:337:29: branch_true: ...to here
LVM2.2.03.36/lib/device/dev-type.c:337:29: branch_true: following ‘true’ branch (when ‘line_maj <= 4095’)...
LVM2.2.03.36/lib/device/dev-type.c:341:41: branch_true: ...to here
LVM2.2.03.36/lib/device/dev-type.c:346:20: branch_false: following ‘false’ branch (when ‘cn’ is non-NULL)...
LVM2.2.03.36/lib/device/dev-type.c:350:22: branch_false: ...to here
LVM2.2.03.36/lib/device/dev-type.c:350:34: branch_true: following ‘true’ branch (when ‘cv’ is non-NULL)...
LVM2.2.03.36/lib/device/dev-type.c:351:29: branch_true: ...to here
LVM2.2.03.36/lib/device/dev-type.c:351:28: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/device/dev-type.c:358:42: branch_false: ...to here
LVM2.2.03.36/lib/device/dev-type.c:361:28: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/device/dev-type.c:370:33: danger: ‘fopen(&proc_devices, "r")’ leaks here; was opened at [(7)](sarif:/runs/0/results/18/codeFlows/0/threadFlows/0/locations/6)
#  368|   			}
#  369|   			if (!cv->v.i) {
#  370|-> 				log_error("Zero partition count invalid for "
#  371|   					  "%s in devices/types in config file",
#  372|   					  name);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def263]
LVM2.2.03.36/lib/device/dev-type.c:370:33: warning[-Wanalyzer-malloc-leak]: leak of ‘calloc(1, 32804)’
LVM2.2.03.36/lib/device/dev-type.c:220:19: enter_function: entry to ‘create_dev_types’
LVM2.2.03.36/lib/device/dev-type.c:235:20: call_function: inlined call to ‘zalloc’ from ‘create_dev_types’
LVM2.2.03.36/lib/device/dev-type.c:235:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/device/dev-type.c:240:14: branch_false: ...to here
LVM2.2.03.36/lib/device/dev-type.c:240:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/device/dev-type.c:247:13: branch_false: ...to here
LVM2.2.03.36/lib/device/dev-type.c:247:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/device/dev-type.c:253:20: branch_false: ...to here
LVM2.2.03.36/lib/device/dev-type.c:253:12: branch_false: following ‘false’ branch...
 branch_false: ...to here
LVM2.2.03.36/lib/device/dev-type.c:258:16: branch_true: following ‘true’ branch...
 branch_true: ...to here
LVM2.2.03.36/lib/device/dev-type.c:258:16: branch_true: following ‘true’ branch...
 branch_true: ...to here
LVM2.2.03.36/lib/device/dev-type.c:335:29: branch_true: following ‘true’ branch...
LVM2.2.03.36/lib/device/dev-type.c:336:42: branch_true: ...to here
LVM2.2.03.36/lib/device/dev-type.c:337:28: branch_true: following ‘true’ branch...
LVM2.2.03.36/lib/device/dev-type.c:338:30: branch_true: ...to here
LVM2.2.03.36/lib/device/dev-type.c:337:29: branch_true: following ‘true’ branch...
LVM2.2.03.36/lib/device/dev-type.c:337:29: branch_true: ...to here
LVM2.2.03.36/lib/device/dev-type.c:337:29: branch_true: following ‘true’ branch (when ‘line_maj <= 4095’)...
LVM2.2.03.36/lib/device/dev-type.c:341:41: branch_true: ...to here
LVM2.2.03.36/lib/device/dev-type.c:346:20: branch_false: following ‘false’ branch (when ‘cn’ is non-NULL)...
LVM2.2.03.36/lib/device/dev-type.c:350:22: branch_false: ...to here
LVM2.2.03.36/lib/device/dev-type.c:350:34: branch_true: following ‘true’ branch (when ‘cv’ is non-NULL)...
LVM2.2.03.36/lib/device/dev-type.c:351:29: branch_true: ...to here
LVM2.2.03.36/lib/device/dev-type.c:351:28: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/device/dev-type.c:358:42: branch_false: ...to here
LVM2.2.03.36/lib/device/dev-type.c:361:28: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/device/dev-type.c:370:33: danger: ‘calloc(1, 32804)’ leaks here; was allocated at [(3)](sarif:/runs/0/results/19/codeFlows/0/threadFlows/0/locations/2)
#  368|   			}
#  369|   			if (!cv->v.i) {
#  370|-> 				log_error("Zero partition count invalid for "
#  371|   					  "%s in devices/types in config file",
#  372|   					  name);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def264]
LVM2.2.03.36/lib/device/dev-type.c:370:33: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(&proc_devices, "r")’
LVM2.2.03.36/lib/device/dev-type.c:235:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/device/dev-type.c:240:14: branch_false: ...to here
LVM2.2.03.36/lib/device/dev-type.c:240:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/device/dev-type.c:247:13: branch_false: ...to here
LVM2.2.03.36/lib/device/dev-type.c:247:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/device/dev-type.c:253:20: branch_false: ...to here
LVM2.2.03.36/lib/device/dev-type.c:253:20: acquire_memory: allocated here
LVM2.2.03.36/lib/device/dev-type.c:253:12: branch_false: following ‘false’ branch...
 branch_false: ...to here
LVM2.2.03.36/lib/device/dev-type.c:258:16: branch_true: following ‘true’ branch...
 branch_true: ...to here
LVM2.2.03.36/lib/device/dev-type.c:258:16: branch_true: following ‘true’ branch...
 branch_true: ...to here
LVM2.2.03.36/lib/device/dev-type.c:335:29: branch_true: following ‘true’ branch...
LVM2.2.03.36/lib/device/dev-type.c:336:42: branch_true: ...to here
LVM2.2.03.36/lib/device/dev-type.c:337:28: branch_true: following ‘true’ branch...
LVM2.2.03.36/lib/device/dev-type.c:338:30: branch_true: ...to here
LVM2.2.03.36/lib/device/dev-type.c:337:29: branch_true: following ‘true’ branch...
LVM2.2.03.36/lib/device/dev-type.c:337:29: branch_true: ...to here
LVM2.2.03.36/lib/device/dev-type.c:337:29: branch_true: following ‘true’ branch (when ‘line_maj <= 4095’)...
LVM2.2.03.36/lib/device/dev-type.c:341:41: branch_true: ...to here
LVM2.2.03.36/lib/device/dev-type.c:346:20: branch_false: following ‘false’ branch (when ‘cn’ is non-NULL)...
LVM2.2.03.36/lib/device/dev-type.c:350:22: branch_false: ...to here
LVM2.2.03.36/lib/device/dev-type.c:350:34: branch_true: following ‘true’ branch (when ‘cv’ is non-NULL)...
LVM2.2.03.36/lib/device/dev-type.c:351:29: branch_true: ...to here
LVM2.2.03.36/lib/device/dev-type.c:351:28: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/device/dev-type.c:358:42: branch_false: ...to here
LVM2.2.03.36/lib/device/dev-type.c:361:28: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/device/dev-type.c:370:33: danger: ‘fopen(&proc_devices, "r")’ leaks here; was allocated at [(7)](sarif:/runs/0/results/20/codeFlows/0/threadFlows/0/locations/6)
#  368|   			}
#  369|   			if (!cv->v.i) {
#  370|-> 				log_error("Zero partition count invalid for "
#  371|   					  "%s in devices/types in config file",
#  372|   					  name);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def265]
LVM2.2.03.36/lib/device/dev-type.c:374:41: warning[-Wanalyzer-malloc-leak]: leak of ‘calloc(1, 32804)’
LVM2.2.03.36/lib/device/dev-type.c:220:19: enter_function: entry to ‘create_dev_types’
LVM2.2.03.36/lib/device/dev-type.c:235:20: call_function: inlined call to ‘zalloc’ from ‘create_dev_types’
LVM2.2.03.36/lib/device/dev-type.c:235:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/device/dev-type.c:240:14: branch_false: ...to here
LVM2.2.03.36/lib/device/dev-type.c:240:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/device/dev-type.c:247:13: branch_false: ...to here
LVM2.2.03.36/lib/device/dev-type.c:247:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/device/dev-type.c:253:20: branch_false: ...to here
LVM2.2.03.36/lib/device/dev-type.c:253:12: branch_false: following ‘false’ branch...
 branch_false: ...to here
LVM2.2.03.36/lib/device/dev-type.c:258:16: branch_true: following ‘true’ branch...
 branch_true: ...to here
LVM2.2.03.36/lib/device/dev-type.c:258:16: branch_true: following ‘true’ branch...
 branch_true: ...to here
LVM2.2.03.36/lib/device/dev-type.c:335:29: branch_true: following ‘true’ branch...
LVM2.2.03.36/lib/device/dev-type.c:336:42: branch_true: ...to here
LVM2.2.03.36/lib/device/dev-type.c:337:28: branch_true: following ‘true’ branch...
LVM2.2.03.36/lib/device/dev-type.c:338:30: branch_true: ...to here
LVM2.2.03.36/lib/device/dev-type.c:337:29: branch_true: following ‘true’ branch...
LVM2.2.03.36/lib/device/dev-type.c:337:29: branch_true: ...to here
LVM2.2.03.36/lib/device/dev-type.c:337:29: branch_true: following ‘true’ branch (when ‘line_maj <= 4095’)...
LVM2.2.03.36/lib/device/dev-type.c:341:41: branch_true: ...to here
LVM2.2.03.36/lib/device/dev-type.c:346:20: branch_false: following ‘false’ branch (when ‘cn’ is non-NULL)...
LVM2.2.03.36/lib/device/dev-type.c:350:22: branch_false: ...to here
LVM2.2.03.36/lib/device/dev-type.c:350:34: branch_true: following ‘true’ branch (when ‘cv’ is non-NULL)...
LVM2.2.03.36/lib/device/dev-type.c:351:29: branch_true: ...to here
LVM2.2.03.36/lib/device/dev-type.c:351:28: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/device/dev-type.c:358:42: branch_false: ...to here
LVM2.2.03.36/lib/device/dev-type.c:361:28: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/device/dev-type.c:373:36: branch_true: following ‘true’ branch...
LVM2.2.03.36/lib/device/dev-type.c:374:41: branch_true: ...to here
LVM2.2.03.36/lib/device/dev-type.c:374:41: danger: ‘calloc(1, 32804)’ leaks here; was allocated at [(3)](sarif:/runs/0/results/21/codeFlows/0/threadFlows/0/locations/2)
#  372|   					  name);
#  373|   				if (fclose(pd))
#  374|-> 					log_sys_debug("fclose", proc_devices);
#  375|   				goto bad;
#  376|   			}

Error: GCC_ANALYZER_WARNING (CWE-401): [#def266]
LVM2.2.03.36/lib/device/dev-type.c:387:17: warning[-Wanalyzer-malloc-leak]: leak of ‘calloc(1, 32804)’
LVM2.2.03.36/lib/device/dev-type.c:220:19: enter_function: entry to ‘create_dev_types’
LVM2.2.03.36/lib/device/dev-type.c:235:20: call_function: inlined call to ‘zalloc’ from ‘create_dev_types’
LVM2.2.03.36/lib/device/dev-type.c:235:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/device/dev-type.c:240:14: branch_false: ...to here
LVM2.2.03.36/lib/device/dev-type.c:240:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/device/dev-type.c:247:13: branch_false: ...to here
LVM2.2.03.36/lib/device/dev-type.c:247:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/device/dev-type.c:253:20: branch_false: ...to here
LVM2.2.03.36/lib/device/dev-type.c:253:12: branch_false: following ‘false’ branch...
 branch_false: ...to here
LVM2.2.03.36/lib/device/dev-type.c:386:12: branch_true: following ‘true’ branch...
LVM2.2.03.36/lib/device/dev-type.c:387:17: branch_true: ...to here
LVM2.2.03.36/lib/device/dev-type.c:387:17: danger: ‘calloc(1, 32804)’ leaks here; was allocated at [(3)](sarif:/runs/0/results/22/codeFlows/0/threadFlows/0/locations/2)
#  385|   
#  386|   	if (fclose(pd))
#  387|-> 		log_sys_debug("fclose", proc_devices);
#  388|   
#  389|   	return dt;

Error: GCC_ANALYZER_WARNING (CWE-775): [#def267]
LVM2.2.03.36/lib/device/dev-type.c:493:17: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(&path, "r")’
LVM2.2.03.36/lib/device/dev-type.c:483:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/device/dev-type.c:489:20: branch_false: ...to here
LVM2.2.03.36/lib/device/dev-type.c:489:20: acquire_resource: opened here
LVM2.2.03.36/lib/device/dev-type.c:489:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/device/dev-type.c:492:14: branch_false: ...to here
LVM2.2.03.36/lib/device/dev-type.c:492:12: branch_true: following ‘true’ branch...
LVM2.2.03.36/lib/device/dev-type.c:493:17: branch_true: ...to here
LVM2.2.03.36/lib/device/dev-type.c:493:17: danger: ‘fopen(&path, "r")’ leaks here; was opened 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-401): [#def268]
LVM2.2.03.36/lib/device/dev-type.c:493:17: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(&path, "r")’
LVM2.2.03.36/lib/device/dev-type.c:483:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/device/dev-type.c:489:20: branch_false: ...to here
LVM2.2.03.36/lib/device/dev-type.c:489:20: acquire_memory: allocated here
LVM2.2.03.36/lib/device/dev-type.c:489:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/device/dev-type.c:492:14: branch_false: ...to here
LVM2.2.03.36/lib/device/dev-type.c:492:12: branch_true: following ‘true’ branch...
LVM2.2.03.36/lib/device/dev-type.c:493:17: branch_true: ...to here
LVM2.2.03.36/lib/device/dev-type.c:493:17: danger: ‘fopen(&path, "r")’ leaks here; was allocated at [(3)](sarif:/runs/0/results/24/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): [#def269]
LVM2.2.03.36/lib/device/dev-type.c:495:17: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(&path, "r")’
LVM2.2.03.36/lib/device/dev-type.c:483:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/device/dev-type.c:489:20: branch_false: ...to here
LVM2.2.03.36/lib/device/dev-type.c:489:20: acquire_resource: opened here
LVM2.2.03.36/lib/device/dev-type.c:489:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/device/dev-type.c:492:14: branch_false: ...to here
LVM2.2.03.36/lib/device/dev-type.c:492:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/device/dev-type.c:494:20: branch_false: ...to here
LVM2.2.03.36/lib/device/dev-type.c:494:19: branch_true: following ‘true’ branch...
LVM2.2.03.36/lib/device/dev-type.c:495:17: branch_true: ...to here
LVM2.2.03.36/lib/device/dev-type.c:495:17: danger: ‘fopen(&path, "r")’ leaks here; was opened 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-401): [#def270]
LVM2.2.03.36/lib/device/dev-type.c:495:17: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(&path, "r")’
LVM2.2.03.36/lib/device/dev-type.c:483:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/device/dev-type.c:489:20: branch_false: ...to here
LVM2.2.03.36/lib/device/dev-type.c:489:20: acquire_memory: allocated here
LVM2.2.03.36/lib/device/dev-type.c:489:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/device/dev-type.c:492:14: branch_false: ...to here
LVM2.2.03.36/lib/device/dev-type.c:492:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/device/dev-type.c:494:20: branch_false: ...to here
LVM2.2.03.36/lib/device/dev-type.c:494:19: branch_true: following ‘true’ branch...
LVM2.2.03.36/lib/device/dev-type.c:495:17: branch_true: ...to here
LVM2.2.03.36/lib/device/dev-type.c:495:17: danger: ‘fopen(&path, "r")’ leaks here; was allocated at [(3)](sarif:/runs/0/results/26/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): [#def271]
LVM2.2.03.36/lib/device/dev-type.c:900:17: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(&path, "r")’
LVM2.2.03.36/lib/device/dev-type.c:858:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/device/dev-type.c:871:13: branch_false: ...to here
LVM2.2.03.36/lib/device/dev-type.c:871:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/device/dev-type.c:876:21: branch_false: ...to here
LVM2.2.03.36/lib/device/dev-type.c:876:12: branch_false: following ‘false’ branch (when ‘size >= 0’)...
LVM2.2.03.36/lib/device/dev-type.c:881:9: branch_false: ...to here
LVM2.2.03.36/lib/device/dev-type.c:883:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/device/dev-type.c:891:20: branch_false: ...to here
LVM2.2.03.36/lib/device/dev-type.c:891:20: acquire_resource: opened here
LVM2.2.03.36/lib/device/dev-type.c:891:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/device/dev-type.c:899:14: branch_false: ...to here
LVM2.2.03.36/lib/device/dev-type.c:899:12: branch_true: following ‘true’ branch...
LVM2.2.03.36/lib/device/dev-type.c:900:17: branch_true: ...to here
LVM2.2.03.36/lib/device/dev-type.c:900:17: danger: ‘fopen(&path, "r")’ leaks here; was opened 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-401): [#def272]
LVM2.2.03.36/lib/device/dev-type.c:900:17: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(&path, "r")’
LVM2.2.03.36/lib/device/dev-type.c:858:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/device/dev-type.c:871:13: branch_false: ...to here
LVM2.2.03.36/lib/device/dev-type.c:871:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/device/dev-type.c:876:21: branch_false: ...to here
LVM2.2.03.36/lib/device/dev-type.c:876:12: branch_false: following ‘false’ branch (when ‘size >= 0’)...
LVM2.2.03.36/lib/device/dev-type.c:881:9: branch_false: ...to here
LVM2.2.03.36/lib/device/dev-type.c:883:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/device/dev-type.c:891:20: branch_false: ...to here
LVM2.2.03.36/lib/device/dev-type.c:891:20: acquire_memory: allocated here
LVM2.2.03.36/lib/device/dev-type.c:891:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/device/dev-type.c:899:14: branch_false: ...to here
LVM2.2.03.36/lib/device/dev-type.c:899:12: branch_true: following ‘true’ branch...
LVM2.2.03.36/lib/device/dev-type.c:900:17: branch_true: ...to here
LVM2.2.03.36/lib/device/dev-type.c:900:17: danger: ‘fopen(&path, "r")’ leaks here; was allocated at [(9)](sarif:/runs/0/results/28/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): [#def273]
LVM2.2.03.36/lib/device/dev-type.c:905:17: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(&path, "r")’
LVM2.2.03.36/lib/device/dev-type.c:858:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/device/dev-type.c:871:13: branch_false: ...to here
LVM2.2.03.36/lib/device/dev-type.c:871:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/device/dev-type.c:876:21: branch_false: ...to here
LVM2.2.03.36/lib/device/dev-type.c:876:12: branch_false: following ‘false’ branch (when ‘size >= 0’)...
LVM2.2.03.36/lib/device/dev-type.c:881:9: branch_false: ...to here
LVM2.2.03.36/lib/device/dev-type.c:883:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/device/dev-type.c:891:20: branch_false: ...to here
LVM2.2.03.36/lib/device/dev-type.c:891:20: acquire_resource: opened here
LVM2.2.03.36/lib/device/dev-type.c:891:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/device/dev-type.c:899:14: branch_false: ...to here
LVM2.2.03.36/lib/device/dev-type.c:899:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/device/dev-type.c:904:13: branch_false: ...to here
LVM2.2.03.36/lib/device/dev-type.c:904:12: branch_true: following ‘true’ branch...
LVM2.2.03.36/lib/device/dev-type.c:905:17: branch_true: ...to here
LVM2.2.03.36/lib/device/dev-type.c:905:17: danger: ‘fopen(&path, "r")’ leaks here; was opened 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-401): [#def274]
LVM2.2.03.36/lib/device/dev-type.c:905:17: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(&path, "r")’
LVM2.2.03.36/lib/device/dev-type.c:858:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/device/dev-type.c:871:13: branch_false: ...to here
LVM2.2.03.36/lib/device/dev-type.c:871:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/device/dev-type.c:876:21: branch_false: ...to here
LVM2.2.03.36/lib/device/dev-type.c:876:12: branch_false: following ‘false’ branch (when ‘size >= 0’)...
LVM2.2.03.36/lib/device/dev-type.c:881:9: branch_false: ...to here
LVM2.2.03.36/lib/device/dev-type.c:883:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/device/dev-type.c:891:20: branch_false: ...to here
LVM2.2.03.36/lib/device/dev-type.c:891:20: acquire_memory: allocated here
LVM2.2.03.36/lib/device/dev-type.c:891:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/device/dev-type.c:899:14: branch_false: ...to here
LVM2.2.03.36/lib/device/dev-type.c:899:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/device/dev-type.c:904:13: branch_false: ...to here
LVM2.2.03.36/lib/device/dev-type.c:904:12: branch_true: following ‘true’ branch...
LVM2.2.03.36/lib/device/dev-type.c:905:17: branch_true: ...to here
LVM2.2.03.36/lib/device/dev-type.c:905:17: danger: ‘fopen(&path, "r")’ leaks here; was allocated at [(9)](sarif:/runs/0/results/30/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): [#def275]
LVM2.2.03.36/lib/device/dev-type.c:1388:17: warning[-Wanalyzer-file-leak]: leak of FILE ‘fp’
LVM2.2.03.36/lib/device/dev-type.c:1354:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/device/dev-type.c:1357:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/device/dev-type.c:1360:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/device/dev-type.c:1368:20: branch_false: ...to here
LVM2.2.03.36/lib/device/dev-type.c:1368:20: acquire_resource: opened here
LVM2.2.03.36/lib/device/dev-type.c:1368:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/device/dev-type.c:1387:14: branch_false: ...to here
LVM2.2.03.36/lib/device/dev-type.c:1387:12: branch_true: following ‘true’ branch...
LVM2.2.03.36/lib/device/dev-type.c:1388:17: branch_true: ...to here
LVM2.2.03.36/lib/device/dev-type.c:1388:17: danger: ‘fp’ leaks here; was opened 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-401): [#def276]
LVM2.2.03.36/lib/device/dev-type.c:1388:17: warning[-Wanalyzer-malloc-leak]: leak of ‘fp’
LVM2.2.03.36/lib/device/dev-type.c:1354:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/device/dev-type.c:1357:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/device/dev-type.c:1360:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/device/dev-type.c:1368:20: branch_false: ...to here
LVM2.2.03.36/lib/device/dev-type.c:1368:20: acquire_memory: allocated here
LVM2.2.03.36/lib/device/dev-type.c:1368:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/device/dev-type.c:1387:14: branch_false: ...to here
LVM2.2.03.36/lib/device/dev-type.c:1387:12: branch_true: following ‘true’ branch...
LVM2.2.03.36/lib/device/dev-type.c:1388:17: branch_true: ...to here
LVM2.2.03.36/lib/device/dev-type.c:1388:17: danger: ‘fp’ leaks here; was allocated at [(7)](sarif:/runs/0/results/32/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): [#def277]
LVM2.2.03.36/lib/device/dev-type.c:1393:17: warning[-Wanalyzer-file-leak]: leak of FILE ‘fp’
LVM2.2.03.36/lib/device/dev-type.c:1354:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/device/dev-type.c:1357:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/device/dev-type.c:1360:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/device/dev-type.c:1368:20: branch_false: ...to here
LVM2.2.03.36/lib/device/dev-type.c:1368:20: acquire_resource: opened here
LVM2.2.03.36/lib/device/dev-type.c:1368:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/device/dev-type.c:1387:14: branch_false: ...to here
LVM2.2.03.36/lib/device/dev-type.c:1387:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/device/dev-type.c:1392:13: branch_false: ...to here
LVM2.2.03.36/lib/device/dev-type.c:1392:12: branch_true: following ‘true’ branch...
LVM2.2.03.36/lib/device/dev-type.c:1393:17: branch_true: ...to here
LVM2.2.03.36/lib/device/dev-type.c:1393:17: danger: ‘fp’ leaks here; was opened 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): [#def278]
LVM2.2.03.36/lib/device/dev-type.c:1393:17: warning[-Wanalyzer-malloc-leak]: leak of ‘fp’
LVM2.2.03.36/lib/device/dev-type.c:1354:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/device/dev-type.c:1357:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/device/dev-type.c:1360:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/device/dev-type.c:1368:20: branch_false: ...to here
LVM2.2.03.36/lib/device/dev-type.c:1368:20: acquire_memory: allocated here
LVM2.2.03.36/lib/device/dev-type.c:1368:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/device/dev-type.c:1387:14: branch_false: ...to here
LVM2.2.03.36/lib/device/dev-type.c:1387:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/device/dev-type.c:1392:13: branch_false: ...to here
LVM2.2.03.36/lib/device/dev-type.c:1392:12: branch_true: following ‘true’ branch...
LVM2.2.03.36/lib/device/dev-type.c:1393:17: branch_true: ...to here
LVM2.2.03.36/lib/device/dev-type.c:1393:17: danger: ‘fp’ leaks here; was allocated at [(7)](sarif:/runs/0/results/34/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): [#def279]
LVM2.2.03.36/lib/device/filesystem.c:63:22: warning[-Wanalyzer-malloc-leak]: leak of ‘opendir(&holders_path)’
LVM2.2.03.36/lib/device/filesystem.c:48:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/device/filesystem.c:55:20: branch_false: ...to here
LVM2.2.03.36/lib/device/filesystem.c:55:20: acquire_memory: allocated here
LVM2.2.03.36/lib/device/filesystem.c:55:12: branch_false: following ‘false’ branch...
 branch_false: ...to here
LVM2.2.03.36/lib/device/filesystem.c:63:22: danger: ‘opendir(&holders_path)’ leaks here; was allocated at [(3)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/2)
#   61|   	}
#   62|   
#   63|-> 	while ((de = readdir(dr))) {
#   64|   		if (!strcmp(de->d_name, ".") || !strcmp(de->d_name, ".."))
#   65|   			continue;

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

Error: GCC_ANALYZER_WARNING (CWE-688): [#def281]
LVM2.2.03.36/lib/device/filesystem.c:191:22: warning[-Wanalyzer-null-argument]: use of NULL ‘opendir(&devices_path)’ where non-null expected
LVM2.2.03.36/lib/device/filesystem.c:172:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/device/filesystem.c:179:20: branch_false: ...to here
LVM2.2.03.36/lib/device/filesystem.c:179:20: acquire_memory: allocated here
LVM2.2.03.36/lib/device/filesystem.c:179:12: release_memory: assuming ‘opendir(&devices_path)’ is NULL
LVM2.2.03.36/lib/device/filesystem.c:179:12: branch_true: following ‘true’ branch...
LVM2.2.03.36/lib/device/filesystem.c:180:21: branch_true: ...to here
LVM2.2.03.36/lib/device/filesystem.c:180:20: branch_false: following ‘false’ branch...
 branch_false: ...to here
LVM2.2.03.36/lib/device/filesystem.c:191:22: danger: argument 1 (‘opendir(&devices_path)’) NULL where non-null expected
#  189|   	 * So also call _fs_get_mnt for every devices to find a matched mount point.
#  190|   	 */
#  191|-> 	while ((de = readdir(dr))) {
#  192|   		if (!strcmp(de->d_name, ".") || !strcmp(de->d_name, ".."))
#  193|   			continue;

Error: GCC_ANALYZER_WARNING (CWE-775): [#def282]
LVM2.2.03.36/lib/device/filesystem.c:212:20: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘open(&rdev_path, 0)’
LVM2.2.03.36/lib/device/filesystem.c:172:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/device/filesystem.c:179:20: branch_false: ...to here
LVM2.2.03.36/lib/device/filesystem.c:179:12: branch_false: following ‘false’ branch...
 branch_false: ...to here
LVM2.2.03.36/lib/device/filesystem.c:191:16: branch_true: following ‘true’ branch...
LVM2.2.03.36/lib/device/filesystem.c:192:29: branch_true: ...to here
LVM2.2.03.36/lib/device/filesystem.c:192:20: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/device/filesystem.c:197:20: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/device/filesystem.c:204:27: branch_false: ...to here
LVM2.2.03.36/lib/device/filesystem.c:204:27: acquire_resource: opened here
LVM2.2.03.36/lib/device/filesystem.c:204:20: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/device/filesystem.c:210:21: branch_false: ...to here
LVM2.2.03.36/lib/device/filesystem.c:212:20: danger: ‘open(&rdev_path, 0)’ leaks here; was opened at [(11)](sarif:/runs/0/results/3/codeFlows/0/threadFlows/0/locations/10)
#  210|   		r = read(fd, buffer, sizeof(buffer));
#  211|   
#  212|-> 		if (close(fd))
#  213|   			log_sys_debug("close", rdev_path);
#  214|   		fd = -1;

Error: GCC_ANALYZER_WARNING (CWE-775): [#def283]
LVM2.2.03.36/lib/device/filesystem.c:469:25: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen("/proc/mounts", "r")’
LVM2.2.03.36/lib/device/filesystem.c:371:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/device/filesystem.c:386:21: branch_false: ...to here
LVM2.2.03.36/lib/device/filesystem.c:386:12: branch_false: following ‘false’ branch (when ‘fme’ is non-NULL)...
 branch_false: ...to here
LVM2.2.03.36/lib/device/filesystem.c:414:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/device/filesystem.c:430:25: branch_false: ...to here
LVM2.2.03.36/lib/device/filesystem.c:430:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/device/filesystem.c:433:14: branch_false: ...to here
LVM2.2.03.36/lib/device/filesystem.c:433:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/device/filesystem.c:436:20: branch_false: ...to here
LVM2.2.03.36/lib/device/filesystem.c:436:20: acquire_resource: opened here
LVM2.2.03.36/lib/device/filesystem.c:436:12: branch_false: following ‘false’ branch...
 branch_false: ...to here
LVM2.2.03.36/lib/device/filesystem.c:439:16: branch_true: following ‘true’ branch...
LVM2.2.03.36/lib/device/filesystem.c:440:21: branch_true: ...to here
LVM2.2.03.36/lib/device/filesystem.c:440:20: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/device/filesystem.c:442:21: branch_false: ...to here
LVM2.2.03.36/lib/device/filesystem.c:442:20: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/device/filesystem.c:447:21: branch_false: ...to here
LVM2.2.03.36/lib/device/filesystem.c:447:20: branch_false: following ‘false’ branch (when the strings are equal)...
LVM2.2.03.36/lib/device/filesystem.c:462:30: branch_false: ...to here
LVM2.2.03.36/lib/device/filesystem.c:465:20: branch_true: following ‘true’ branch...
LVM2.2.03.36/lib/device/filesystem.c:468:34: branch_true: ...to here
LVM2.2.03.36/lib/device/filesystem.c:468:20: branch_true: following ‘true’ branch...
LVM2.2.03.36/lib/device/filesystem.c:469:25: branch_true: ...to here
LVM2.2.03.36/lib/device/filesystem.c:469:25: danger: ‘fopen("/proc/mounts", "r")’ leaks here; was opened at [(12)](sarif:/runs/0/results/4/codeFlows/0/threadFlows/0/locations/11)
#  467|   
#  468|   		if (dev_match && !dir_match) {
#  469|-> 			log_debug("LV %s mounted at %s also mounted at %s.",
#  470|   				  dm_devpath, mtab_mntpath, proc_mntpath);
#  471|   			continue;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def284]
LVM2.2.03.36/lib/device/filesystem.c:469:25: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen("/proc/mounts", "r")’
LVM2.2.03.36/lib/device/filesystem.c:371:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/device/filesystem.c:386:21: branch_false: ...to here
LVM2.2.03.36/lib/device/filesystem.c:386:12: branch_false: following ‘false’ branch (when ‘fme’ is non-NULL)...
 branch_false: ...to here
LVM2.2.03.36/lib/device/filesystem.c:414:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/device/filesystem.c:430:25: branch_false: ...to here
LVM2.2.03.36/lib/device/filesystem.c:430:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/device/filesystem.c:433:14: branch_false: ...to here
LVM2.2.03.36/lib/device/filesystem.c:433:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/device/filesystem.c:436:20: branch_false: ...to here
LVM2.2.03.36/lib/device/filesystem.c:436:20: acquire_memory: allocated here
LVM2.2.03.36/lib/device/filesystem.c:436:12: branch_false: following ‘false’ branch...
 branch_false: ...to here
LVM2.2.03.36/lib/device/filesystem.c:439:16: branch_true: following ‘true’ branch...
LVM2.2.03.36/lib/device/filesystem.c:440:21: branch_true: ...to here
LVM2.2.03.36/lib/device/filesystem.c:440:20: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/device/filesystem.c:442:21: branch_false: ...to here
LVM2.2.03.36/lib/device/filesystem.c:442:20: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/device/filesystem.c:447:21: branch_false: ...to here
LVM2.2.03.36/lib/device/filesystem.c:447:20: branch_false: following ‘false’ branch (when the strings are equal)...
LVM2.2.03.36/lib/device/filesystem.c:462:30: branch_false: ...to here
LVM2.2.03.36/lib/device/filesystem.c:465:20: branch_true: following ‘true’ branch...
LVM2.2.03.36/lib/device/filesystem.c:468:34: branch_true: ...to here
LVM2.2.03.36/lib/device/filesystem.c:468:20: branch_true: following ‘true’ branch...
LVM2.2.03.36/lib/device/filesystem.c:469:25: branch_true: ...to here
LVM2.2.03.36/lib/device/filesystem.c:469:25: danger: ‘fopen("/proc/mounts", "r")’ leaks here; was allocated at [(12)](sarif:/runs/0/results/5/codeFlows/0/threadFlows/0/locations/11)
#  467|   
#  468|   		if (dev_match && !dir_match) {
#  469|-> 			log_debug("LV %s mounted at %s also mounted at %s.",
#  470|   				  dm_devpath, mtab_mntpath, proc_mntpath);
#  471|   			continue;

Error: GCC_ANALYZER_WARNING (CWE-775): [#def285]
LVM2.2.03.36/lib/device/filesystem.c:475:25: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen("/proc/mounts", "r")’
LVM2.2.03.36/lib/device/filesystem.c:371:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/device/filesystem.c:386:21: branch_false: ...to here
LVM2.2.03.36/lib/device/filesystem.c:386:12: branch_false: following ‘false’ branch (when ‘fme’ is non-NULL)...
 branch_false: ...to here
LVM2.2.03.36/lib/device/filesystem.c:414:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/device/filesystem.c:430:25: branch_false: ...to here
LVM2.2.03.36/lib/device/filesystem.c:430:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/device/filesystem.c:433:14: branch_false: ...to here
LVM2.2.03.36/lib/device/filesystem.c:433:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/device/filesystem.c:436:20: branch_false: ...to here
LVM2.2.03.36/lib/device/filesystem.c:436:20: acquire_resource: opened here
LVM2.2.03.36/lib/device/filesystem.c:436:12: branch_false: following ‘false’ branch...
 branch_false: ...to here
LVM2.2.03.36/lib/device/filesystem.c:439:16: branch_true: following ‘true’ branch...
LVM2.2.03.36/lib/device/filesystem.c:440:21: branch_true: ...to here
LVM2.2.03.36/lib/device/filesystem.c:475:25: danger: ‘fopen("/proc/mounts", "r")’ leaks here; was opened at [(12)](sarif:/runs/0/results/6/codeFlows/0/threadFlows/0/locations/11)
#  473|   
#  474|   		if (!dev_match && dir_match) {
#  475|-> 			log_error("LV %s mounted at %s may have been renamed (from %s).",
#  476|   				  dm_devpath, proc_mntpath, proc_devpath);
#  477|   			renamed = 1;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def286]
LVM2.2.03.36/lib/device/filesystem.c:475:25: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen("/proc/mounts", "r")’
LVM2.2.03.36/lib/device/filesystem.c:371:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/device/filesystem.c:386:21: branch_false: ...to here
LVM2.2.03.36/lib/device/filesystem.c:386:12: branch_false: following ‘false’ branch (when ‘fme’ is non-NULL)...
 branch_false: ...to here
LVM2.2.03.36/lib/device/filesystem.c:414:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/device/filesystem.c:430:25: branch_false: ...to here
LVM2.2.03.36/lib/device/filesystem.c:430:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/device/filesystem.c:433:14: branch_false: ...to here
LVM2.2.03.36/lib/device/filesystem.c:433:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/device/filesystem.c:436:20: branch_false: ...to here
LVM2.2.03.36/lib/device/filesystem.c:436:20: acquire_memory: allocated here
LVM2.2.03.36/lib/device/filesystem.c:436:12: branch_false: following ‘false’ branch...
 branch_false: ...to here
LVM2.2.03.36/lib/device/filesystem.c:439:16: branch_true: following ‘true’ branch...
LVM2.2.03.36/lib/device/filesystem.c:440:21: branch_true: ...to here
LVM2.2.03.36/lib/device/filesystem.c:475:25: danger: ‘fopen("/proc/mounts", "r")’ leaks here; was allocated at [(12)](sarif:/runs/0/results/7/codeFlows/0/threadFlows/0/locations/11)
#  473|   
#  474|   		if (!dev_match && dir_match) {
#  475|-> 			log_error("LV %s mounted at %s may have been renamed (from %s).",
#  476|   				  dm_devpath, proc_mntpath, proc_devpath);
#  477|   			renamed = 1;

Error: GCC_ANALYZER_WARNING (CWE-775): [#def287]
LVM2.2.03.36/lib/device/nvme.c:187:13: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘open(dev_name(dev), 0)’
LVM2.2.03.36/lib/device/nvme.c:177:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/device/nvme.c:180:19: branch_false: ...to here
LVM2.2.03.36/lib/device/nvme.c:182:19: acquire_resource: opened here
LVM2.2.03.36/lib/device/nvme.c:182:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/device/nvme.c:187:13: branch_false: ...to here
LVM2.2.03.36/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_print("dev_read_nvme_wwids nvme_get_nsid error %d %s", errno, devpath);
#  189|   		goto out;

Error: GCC_ANALYZER_WARNING (CWE-775): [#def288]
LVM2.2.03.36/lib/device/nvme.c:318:13: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘open(dev_name(dev), 0)’
LVM2.2.03.36/lib/device/nvme.c:313:19: acquire_resource: opened here
LVM2.2.03.36/lib/device/nvme.c:313:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/device/nvme.c:318:13: branch_false: ...to here
LVM2.2.03.36/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): [#def289]
LVM2.2.03.36/lib/device/nvme.c:335:20: warning[-Wanalyzer-malloc-leak]: leak of ‘status’
LVM2.2.03.36/lib/device/nvme.c:313:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/device/nvme.c:318:13: branch_false: ...to here
LVM2.2.03.36/lib/device/nvme.c:318:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/device/nvme.c:323:24: branch_false: ...to here
LVM2.2.03.36/lib/device/nvme.c:323:24: acquire_memory: allocated here
LVM2.2.03.36/lib/device/nvme.c:323:12: branch_false: following ‘false’ branch (when ‘status’ is non-NULL)...
LVM2.2.03.36/lib/device/nvme.c:326:9: branch_false: ...to here
LVM2.2.03.36/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): [#def290]
LVM2.2.03.36/lib/device/nvme.c:402:13: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘open(dev_name(dev), 0)’
LVM2.2.03.36/lib/device/nvme.c:397:19: acquire_resource: opened here
LVM2.2.03.36/lib/device/nvme.c:397:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/device/nvme.c:402:13: branch_false: ...to here
LVM2.2.03.36/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): [#def291]
LVM2.2.03.36/lib/device/nvme.c:422:20: warning[-Wanalyzer-malloc-leak]: leak of ‘status’
LVM2.2.03.36/lib/device/nvme.c:397:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/device/nvme.c:402:13: branch_false: ...to here
LVM2.2.03.36/lib/device/nvme.c:402:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/device/nvme.c:410:24: branch_false: ...to here
LVM2.2.03.36/lib/device/nvme.c:410:24: acquire_memory: allocated here
LVM2.2.03.36/lib/device/nvme.c:410:12: branch_false: following ‘false’ branch (when ‘status’ is non-NULL)...
LVM2.2.03.36/lib/device/nvme.c:413:9: branch_false: ...to here
LVM2.2.03.36/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): [#def292]
LVM2.2.03.36/lib/device/online.c:68:14: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(&lookup_path, "r")’
LVM2.2.03.36/lib/device/online.c:384:5: enter_function: entry to ‘get_pvs_lookup’
LVM2.2.03.36/lib/device/online.c:396:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/device/online.c:399:20: branch_false: ...to here
LVM2.2.03.36/lib/device/online.c:399:20: acquire_resource: opened here
LVM2.2.03.36/lib/device/online.c:399:12: branch_false: following ‘false’ branch...
 branch_false: ...to here
LVM2.2.03.36/lib/device/online.c:402:16: branch_true: following ‘true’ branch...
LVM2.2.03.36/lib/device/online.c:403:17: branch_true: ...to here
LVM2.2.03.36/lib/device/online.c:404:20: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/device/online.c:407:17: branch_false: ...to here
LVM2.2.03.36/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): [#def293]
LVM2.2.03.36/lib/device/online.c:68:14: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(&lookup_path, "r")’
LVM2.2.03.36/lib/device/online.c:384:5: enter_function: entry to ‘get_pvs_lookup’
LVM2.2.03.36/lib/device/online.c:396:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/device/online.c:399:20: branch_false: ...to here
LVM2.2.03.36/lib/device/online.c:399:20: acquire_memory: allocated here
LVM2.2.03.36/lib/device/online.c:399:12: branch_false: following ‘false’ branch...
 branch_false: ...to here
LVM2.2.03.36/lib/device/online.c:402:16: branch_true: following ‘true’ branch...
LVM2.2.03.36/lib/device/online.c:403:17: branch_true: ...to here
LVM2.2.03.36/lib/device/online.c:404:20: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/device/online.c:407:17: branch_false: ...to here
LVM2.2.03.36/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): [#def294]
LVM2.2.03.36/lib/device/online.c:70:17: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(&lookup_path, "r")’
LVM2.2.03.36/lib/device/online.c:384:5: enter_function: entry to ‘get_pvs_lookup’
LVM2.2.03.36/lib/device/online.c:396:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/device/online.c:399:20: branch_false: ...to here
LVM2.2.03.36/lib/device/online.c:399:20: acquire_resource: opened here
LVM2.2.03.36/lib/device/online.c:399:12: branch_false: following ‘false’ branch...
 branch_false: ...to here
LVM2.2.03.36/lib/device/online.c:402:16: branch_true: following ‘true’ branch...
LVM2.2.03.36/lib/device/online.c:403:17: branch_true: ...to here
LVM2.2.03.36/lib/device/online.c:404:20: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/device/online.c:407:17: branch_false: ...to here
LVM2.2.03.36/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): [#def295]
LVM2.2.03.36/lib/device/online.c:70:17: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(&lookup_path, "r")’
LVM2.2.03.36/lib/device/online.c:384:5: enter_function: entry to ‘get_pvs_lookup’
LVM2.2.03.36/lib/device/online.c:396:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/device/online.c:399:20: branch_false: ...to here
LVM2.2.03.36/lib/device/online.c:399:20: acquire_memory: allocated here
LVM2.2.03.36/lib/device/online.c:399:12: branch_false: following ‘false’ branch...
 branch_false: ...to here
LVM2.2.03.36/lib/device/online.c:402:16: branch_true: following ‘true’ branch...
LVM2.2.03.36/lib/device/online.c:403:17: branch_true: ...to here
LVM2.2.03.36/lib/device/online.c:404:20: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/device/online.c:407:17: branch_false: ...to here
LVM2.2.03.36/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): [#def296]
LVM2.2.03.36/lib/device/online.c:75:12: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘open(path, 0)’
LVM2.2.03.36/lib/device/online.c:68:14: acquire_resource: opened here
LVM2.2.03.36/lib/device/online.c:69:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/device/online.c:74:14: branch_false: ...to here
LVM2.2.03.36/lib/device/online.c:75:12: 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): [#def297]
LVM2.2.03.36/lib/device/online.c:75:13: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(&lookup_path, "r")’
LVM2.2.03.36/lib/device/online.c:384:5: enter_function: entry to ‘get_pvs_lookup’
LVM2.2.03.36/lib/device/online.c:396:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/device/online.c:399:20: branch_false: ...to here
LVM2.2.03.36/lib/device/online.c:399:20: acquire_resource: opened here
LVM2.2.03.36/lib/device/online.c:399:12: branch_false: following ‘false’ branch...
 branch_false: ...to here
LVM2.2.03.36/lib/device/online.c:402:16: branch_true: following ‘true’ branch...
LVM2.2.03.36/lib/device/online.c:403:17: branch_true: ...to here
LVM2.2.03.36/lib/device/online.c:404:20: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/device/online.c:407:17: branch_false: ...to here
LVM2.2.03.36/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): [#def298]
LVM2.2.03.36/lib/device/online.c:75:13: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(&lookup_path, "r")’
LVM2.2.03.36/lib/device/online.c:384:5: enter_function: entry to ‘get_pvs_lookup’
LVM2.2.03.36/lib/device/online.c:396:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/device/online.c:399:20: branch_false: ...to here
LVM2.2.03.36/lib/device/online.c:399:20: acquire_memory: allocated here
LVM2.2.03.36/lib/device/online.c:399:12: branch_false: following ‘false’ branch...
 branch_false: ...to here
LVM2.2.03.36/lib/device/online.c:402:16: branch_true: following ‘true’ branch...
LVM2.2.03.36/lib/device/online.c:403:17: branch_true: ...to here
LVM2.2.03.36/lib/device/online.c:404:20: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/device/online.c:407:17: branch_false: ...to here
LVM2.2.03.36/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): [#def299]
LVM2.2.03.36/lib/device/online.c:76:17: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(&lookup_path, "r")’
LVM2.2.03.36/lib/device/online.c:384:5: enter_function: entry to ‘get_pvs_lookup’
LVM2.2.03.36/lib/device/online.c:396:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/device/online.c:399:20: branch_false: ...to here
LVM2.2.03.36/lib/device/online.c:399:20: acquire_resource: opened here
LVM2.2.03.36/lib/device/online.c:399:12: branch_false: following ‘false’ branch...
 branch_false: ...to here
LVM2.2.03.36/lib/device/online.c:402:16: branch_true: following ‘true’ branch...
LVM2.2.03.36/lib/device/online.c:403:17: branch_true: ...to here
LVM2.2.03.36/lib/device/online.c:404:20: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/device/online.c:407:17: branch_false: ...to here
LVM2.2.03.36/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): [#def300]
LVM2.2.03.36/lib/device/online.c:76:17: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(&lookup_path, "r")’
LVM2.2.03.36/lib/device/online.c:384:5: enter_function: entry to ‘get_pvs_lookup’
LVM2.2.03.36/lib/device/online.c:396:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/device/online.c:399:20: branch_false: ...to here
LVM2.2.03.36/lib/device/online.c:399:20: acquire_memory: allocated here
LVM2.2.03.36/lib/device/online.c:399:12: branch_false: following ‘false’ branch...
 branch_false: ...to here
LVM2.2.03.36/lib/device/online.c:402:16: branch_true: following ‘true’ branch...
LVM2.2.03.36/lib/device/online.c:403:17: branch_true: ...to here
LVM2.2.03.36/lib/device/online.c:404:20: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/device/online.c:407:17: branch_false: ...to here
LVM2.2.03.36/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): [#def301]
LVM2.2.03.36/lib/device/online.c:78:17: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(&lookup_path, "r")’
LVM2.2.03.36/lib/device/online.c:384:5: enter_function: entry to ‘get_pvs_lookup’
LVM2.2.03.36/lib/device/online.c:396:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/device/online.c:399:20: branch_false: ...to here
LVM2.2.03.36/lib/device/online.c:399:20: acquire_resource: opened here
LVM2.2.03.36/lib/device/online.c:399:12: branch_false: following ‘false’ branch...
 branch_false: ...to here
LVM2.2.03.36/lib/device/online.c:402:16: branch_true: following ‘true’ branch...
LVM2.2.03.36/lib/device/online.c:403:17: branch_true: ...to here
LVM2.2.03.36/lib/device/online.c:404:20: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/device/online.c:407:17: branch_false: ...to here
LVM2.2.03.36/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): [#def302]
LVM2.2.03.36/lib/device/online.c:78:17: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(&lookup_path, "r")’
LVM2.2.03.36/lib/device/online.c:384:5: enter_function: entry to ‘get_pvs_lookup’
LVM2.2.03.36/lib/device/online.c:396:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/device/online.c:399:20: branch_false: ...to here
LVM2.2.03.36/lib/device/online.c:399:20: acquire_memory: allocated here
LVM2.2.03.36/lib/device/online.c:399:12: branch_false: following ‘false’ branch...
 branch_false: ...to here
LVM2.2.03.36/lib/device/online.c:402:16: branch_true: following ‘true’ branch...
LVM2.2.03.36/lib/device/online.c:403:17: branch_true: ...to here
LVM2.2.03.36/lib/device/online.c:404:20: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/device/online.c:407:17: branch_false: ...to here
LVM2.2.03.36/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): [#def303]
LVM2.2.03.36/lib/device/online.c:84:17: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(&lookup_path, "r")’
LVM2.2.03.36/lib/device/online.c:384:5: enter_function: entry to ‘get_pvs_lookup’
LVM2.2.03.36/lib/device/online.c:396:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/device/online.c:399:20: branch_false: ...to here
LVM2.2.03.36/lib/device/online.c:399:20: acquire_resource: opened here
LVM2.2.03.36/lib/device/online.c:399:12: branch_false: following ‘false’ branch...
 branch_false: ...to here
LVM2.2.03.36/lib/device/online.c:402:16: branch_true: following ‘true’ branch...
LVM2.2.03.36/lib/device/online.c:403:17: branch_true: ...to here
LVM2.2.03.36/lib/device/online.c:404:20: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/device/online.c:407:17: branch_false: ...to here
LVM2.2.03.36/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): [#def304]
LVM2.2.03.36/lib/device/online.c:84:17: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(&lookup_path, "r")’
LVM2.2.03.36/lib/device/online.c:384:5: enter_function: entry to ‘get_pvs_lookup’
LVM2.2.03.36/lib/device/online.c:396:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/device/online.c:399:20: branch_false: ...to here
LVM2.2.03.36/lib/device/online.c:399:20: acquire_memory: allocated here
LVM2.2.03.36/lib/device/online.c:399:12: branch_false: following ‘false’ branch...
 branch_false: ...to here
LVM2.2.03.36/lib/device/online.c:402:16: branch_true: following ‘true’ branch...
LVM2.2.03.36/lib/device/online.c:403:17: branch_true: ...to here
LVM2.2.03.36/lib/device/online.c:404:20: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/device/online.c:407:17: branch_false: ...to here
LVM2.2.03.36/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): [#def305]
LVM2.2.03.36/lib/device/online.c:90:25: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(&lookup_path, "r")’
LVM2.2.03.36/lib/device/online.c:384:5: enter_function: entry to ‘get_pvs_lookup’
LVM2.2.03.36/lib/device/online.c:396:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/device/online.c:399:20: branch_false: ...to here
LVM2.2.03.36/lib/device/online.c:399:20: acquire_resource: opened here
LVM2.2.03.36/lib/device/online.c:399:12: branch_false: following ‘false’ branch...
 branch_false: ...to here
LVM2.2.03.36/lib/device/online.c:402:16: branch_true: following ‘true’ branch...
LVM2.2.03.36/lib/device/online.c:403:17: branch_true: ...to here
LVM2.2.03.36/lib/device/online.c:404:20: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/device/online.c:407:17: branch_false: ...to here
LVM2.2.03.36/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): [#def306]
LVM2.2.03.36/lib/device/online.c:90:25: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(&lookup_path, "r")’
LVM2.2.03.36/lib/device/online.c:384:5: enter_function: entry to ‘get_pvs_lookup’
LVM2.2.03.36/lib/device/online.c:396:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/device/online.c:399:20: branch_false: ...to here
LVM2.2.03.36/lib/device/online.c:399:20: acquire_memory: allocated here
LVM2.2.03.36/lib/device/online.c:399:12: branch_false: following ‘false’ branch...
 branch_false: ...to here
LVM2.2.03.36/lib/device/online.c:402:16: branch_true: following ‘true’ branch...
LVM2.2.03.36/lib/device/online.c:403:17: branch_true: ...to here
LVM2.2.03.36/lib/device/online.c:404:20: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/device/online.c:407:17: branch_false: ...to here
LVM2.2.03.36/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): [#def307]
LVM2.2.03.36/lib/device/online.c:96:25: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(&lookup_path, "r")’
LVM2.2.03.36/lib/device/online.c:384:5: enter_function: entry to ‘get_pvs_lookup’
LVM2.2.03.36/lib/device/online.c:396:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/device/online.c:399:20: branch_false: ...to here
LVM2.2.03.36/lib/device/online.c:399:20: acquire_resource: opened here
LVM2.2.03.36/lib/device/online.c:399:12: branch_false: following ‘false’ branch...
 branch_false: ...to here
LVM2.2.03.36/lib/device/online.c:402:16: branch_true: following ‘true’ branch...
LVM2.2.03.36/lib/device/online.c:403:17: branch_true: ...to here
LVM2.2.03.36/lib/device/online.c:404:20: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/device/online.c:407:17: branch_false: ...to here
LVM2.2.03.36/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): [#def308]
LVM2.2.03.36/lib/device/online.c:96:25: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(&lookup_path, "r")’
LVM2.2.03.36/lib/device/online.c:384:5: enter_function: entry to ‘get_pvs_lookup’
LVM2.2.03.36/lib/device/online.c:396:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/device/online.c:399:20: branch_false: ...to here
LVM2.2.03.36/lib/device/online.c:399:20: acquire_memory: allocated here
LVM2.2.03.36/lib/device/online.c:399:12: branch_false: following ‘false’ branch...
 branch_false: ...to here
LVM2.2.03.36/lib/device/online.c:402:16: branch_true: following ‘true’ branch...
LVM2.2.03.36/lib/device/online.c:403:17: branch_true: ...to here
LVM2.2.03.36/lib/device/online.c:404:20: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/device/online.c:407:17: branch_false: ...to here
LVM2.2.03.36/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): [#def309]
LVM2.2.03.36/lib/device/online.c:157:22: warning[-Wanalyzer-malloc-leak]: leak of ‘opendir("/run/lvm/pvs_online")’
LVM2.2.03.36/lib/device/online.c:154:21: acquire_memory: allocated here
LVM2.2.03.36/lib/device/online.c:154:12: branch_false: following ‘false’ branch...
 branch_false: ...to here
LVM2.2.03.36/lib/device/online.c:157:22: danger: ‘opendir("/run/lvm/pvs_online")’ leaks here; was allocated at [(1)](sarif:/runs/0/results/17/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): [#def310]
LVM2.2.03.36/lib/device/online.c:405:25: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(&lookup_path, "r")’
LVM2.2.03.36/lib/device/online.c:396:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/device/online.c:399:20: branch_false: ...to here
LVM2.2.03.36/lib/device/online.c:399:20: acquire_resource: opened here
LVM2.2.03.36/lib/device/online.c:399:12: branch_false: following ‘false’ branch...
 branch_false: ...to here
LVM2.2.03.36/lib/device/online.c:402:16: branch_true: following ‘true’ branch...
LVM2.2.03.36/lib/device/online.c:403:17: branch_true: ...to here
LVM2.2.03.36/lib/device/online.c:404:20: branch_true: following ‘true’ branch...
LVM2.2.03.36/lib/device/online.c:405:25: branch_true: ...to here
LVM2.2.03.36/lib/device/online.c:405:25: danger: ‘fopen(&lookup_path, "r")’ leaks here; was opened at [(3)](sarif:/runs/0/results/18/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): [#def311]
LVM2.2.03.36/lib/device/online.c:405:25: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(&lookup_path, "r")’
LVM2.2.03.36/lib/device/online.c:396:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/device/online.c:399:20: branch_false: ...to here
LVM2.2.03.36/lib/device/online.c:399:20: acquire_memory: allocated here
LVM2.2.03.36/lib/device/online.c:399:12: branch_false: following ‘false’ branch...
 branch_false: ...to here
LVM2.2.03.36/lib/device/online.c:402:16: branch_true: following ‘true’ branch...
LVM2.2.03.36/lib/device/online.c:403:17: branch_true: ...to here
LVM2.2.03.36/lib/device/online.c:404:20: branch_true: following ‘true’ branch...
LVM2.2.03.36/lib/device/online.c:405:25: branch_true: ...to here
LVM2.2.03.36/lib/device/online.c:405:25: danger: ‘fopen(&lookup_path, "r")’ leaks here; was allocated at [(3)](sarif:/runs/0/results/19/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): [#def312]
LVM2.2.03.36/lib/device/online.c:444:9: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(&lookup_path, "r")’
LVM2.2.03.36/lib/device/online.c:396:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/device/online.c:399:20: branch_false: ...to here
LVM2.2.03.36/lib/device/online.c:399:20: acquire_resource: opened here
LVM2.2.03.36/lib/device/online.c:399:12: branch_false: following ‘false’ branch...
 branch_false: ...to here
LVM2.2.03.36/lib/device/online.c:402:16: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/device/online.c:444:9: branch_false: ...to here
LVM2.2.03.36/lib/device/online.c:444:9: danger: ‘fopen(&lookup_path, "r")’ leaks here; was opened at [(3)](sarif:/runs/0/results/20/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): [#def313]
LVM2.2.03.36/lib/device/online.c:444:9: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(&lookup_path, "r")’
LVM2.2.03.36/lib/device/online.c:396:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/device/online.c:399:20: branch_false: ...to here
LVM2.2.03.36/lib/device/online.c:399:20: acquire_memory: allocated here
LVM2.2.03.36/lib/device/online.c:399:12: branch_false: following ‘false’ branch...
 branch_false: ...to here
LVM2.2.03.36/lib/device/online.c:402:16: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/device/online.c:444:9: branch_false: ...to here
LVM2.2.03.36/lib/device/online.c:444:9: danger: ‘fopen(&lookup_path, "r")’ leaks here; was allocated at [(3)](sarif:/runs/0/results/21/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-775): [#def314]
LVM2.2.03.36/lib/device/online.c:453:12: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(&lookup_path, "r")’
LVM2.2.03.36/lib/device/online.c:384:5: enter_function: entry to ‘get_pvs_lookup’
LVM2.2.03.36/lib/device/online.c:396:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/device/online.c:399:20: branch_false: ...to here
LVM2.2.03.36/lib/device/online.c:399:20: acquire_resource: opened here
LVM2.2.03.36/lib/device/online.c:399:12: branch_false: following ‘false’ branch...
 branch_false: ...to here
LVM2.2.03.36/lib/device/online.c:402:16: branch_true: following ‘true’ branch...
LVM2.2.03.36/lib/device/online.c:403:17: branch_true: ...to here
LVM2.2.03.36/lib/device/online.c:404:20: branch_true: following ‘true’ branch...
LVM2.2.03.36/lib/device/online.c:405:25: branch_true: ...to here
LVM2.2.03.36/lib/device/online.c:452:9: call_function: calling ‘free_po_list’ from ‘get_pvs_lookup’
#  451|   bad:
#  452|   	free_po_list(pvs_online);
#  453|-> 	if (fclose(fp))
#  454|   		log_sys_debug("fclose", lookup_path);
#  455|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def315]
LVM2.2.03.36/lib/device/online.c:453:12: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(&lookup_path, "r")’
LVM2.2.03.36/lib/device/online.c:384:5: enter_function: entry to ‘get_pvs_lookup’
LVM2.2.03.36/lib/device/online.c:396:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/device/online.c:399:20: branch_false: ...to here
LVM2.2.03.36/lib/device/online.c:399:20: acquire_memory: allocated here
LVM2.2.03.36/lib/device/online.c:399:12: branch_false: following ‘false’ branch...
 branch_false: ...to here
LVM2.2.03.36/lib/device/online.c:402:16: branch_true: following ‘true’ branch...
LVM2.2.03.36/lib/device/online.c:403:17: branch_true: ...to here
LVM2.2.03.36/lib/device/online.c:404:20: branch_true: following ‘true’ branch...
LVM2.2.03.36/lib/device/online.c:405:25: branch_true: ...to here
LVM2.2.03.36/lib/device/online.c:452:9: call_function: calling ‘free_po_list’ from ‘get_pvs_lookup’
#  451|   bad:
#  452|   	free_po_list(pvs_online);
#  453|-> 	if (fclose(fp))
#  454|   		log_sys_debug("fclose", lookup_path);
#  455|   

Error: GCC_ANALYZER_WARNING (CWE-775): [#def316]
LVM2.2.03.36/lib/device/persist.c:288:17: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(&path, "r")’
LVM2.2.03.36/lib/device/persist.c:1001:12: enter_function: entry to ‘get_our_key_sanlock_start’
LVM2.2.03.36/lib/device/persist.c:1015:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/device/persist.c:1021:14: branch_false: ...to here
LVM2.2.03.36/lib/device/persist.c:1021:14: call_function: calling ‘read_key_file’ from ‘get_our_key_sanlock_start’
#  286|   		p = strchr(line, ' ') + 1;
#  287|   
#  288|-> 		dm_strncpy(buf_key, p, sizeof(buf_key));
#  289|   		break;
#  290|   	}

Error: GCC_ANALYZER_WARNING (CWE-401): [#def317]
LVM2.2.03.36/lib/device/persist.c:288:17: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(&path, "r")’
LVM2.2.03.36/lib/device/persist.c:1001:12: enter_function: entry to ‘get_our_key_sanlock_start’
LVM2.2.03.36/lib/device/persist.c:1015:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/device/persist.c:1021:14: branch_false: ...to here
LVM2.2.03.36/lib/device/persist.c:1021:14: call_function: calling ‘read_key_file’ from ‘get_our_key_sanlock_start’
#  286|   		p = strchr(line, ' ') + 1;
#  287|   
#  288|-> 		dm_strncpy(buf_key, p, sizeof(buf_key));
#  289|   		break;
#  290|   	}

Error: GCC_ANALYZER_WARNING (CWE-775): [#def318]
LVM2.2.03.36/lib/device/persist.c:617:12: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘open(dev_name(dev), 0)’
LVM2.2.03.36/lib/device/persist.c:653:5: enter_function: entry to ‘dev_find_key’
LVM2.2.03.36/lib/device/persist.c:660:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/device/persist.c:665:13: branch_false: ...to here
LVM2.2.03.36/lib/device/persist.c:665:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/device/persist.c:669:18: branch_false: ...to here
LVM2.2.03.36/lib/device/persist.c:670:23: call_function: calling ‘dev_find_key_scsi’ from ‘dev_find_key’
#  615|   out:
#  616|   	free(response_buf);
#  617|-> 	if (close(fd))
#  618|   		log_sys_debug("close", devname);
#  619|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def319]
LVM2.2.03.36/lib/error/errseg.c:105:9: warning[-Wanalyzer-malloc-leak]: leak of ‘calloc(1, 72)’
LVM2.2.03.36/lib/error/errseg.c:94:22: enter_function: entry to ‘init_error_segtype’
LVM2.2.03.36/lib/error/errseg.c:96:40: call_function: inlined call to ‘zalloc’ from ‘init_error_segtype’
LVM2.2.03.36/lib/error/errseg.c:98:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/error/errseg.c:101:9: branch_false: ...to here
LVM2.2.03.36/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): [#def320]
LVM2.2.03.36/lib/filters/filter-composite.c:87:17: warning[-Wanalyzer-malloc-leak]: leak of ‘filters_copy’
LVM2.2.03.36/lib/filters/filter-composite.c:75:12: branch_false: following ‘false’ branch (when ‘filters’ is non-NULL)...
LVM2.2.03.36/lib/filters/filter-composite.c:78:56: branch_false: ...to here
LVM2.2.03.36/lib/filters/filter-composite.c:78:30: acquire_memory: allocated here
LVM2.2.03.36/lib/filters/filter-composite.c:78:12: branch_false: following ‘false’ branch (when ‘filters_copy’ is non-NULL)...
LVM2.2.03.36/lib/filters/filter-composite.c:83:9: branch_false: ...to here
LVM2.2.03.36/lib/filters/filter-composite.c:86:12: branch_true: following ‘true’ branch...
LVM2.2.03.36/lib/filters/filter-composite.c:87:17: branch_true: ...to here
LVM2.2.03.36/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): [#def321]
LVM2.2.03.36/lib/filters/filter-composite.c:99:9: warning[-Wanalyzer-malloc-leak]: leak of ‘calloc(1, 48)’
LVM2.2.03.36/lib/filters/filter-composite.c:71:20: enter_function: entry to ‘composite_filter_create’
LVM2.2.03.36/lib/filters/filter-composite.c:75:12: branch_false: following ‘false’ branch (when ‘filters’ is non-NULL)...
LVM2.2.03.36/lib/filters/filter-composite.c:78:56: branch_false: ...to here
LVM2.2.03.36/lib/filters/filter-composite.c:78:12: branch_false: following ‘false’ branch (when ‘filters_copy’ is non-NULL)...
LVM2.2.03.36/lib/filters/filter-composite.c:83:9: branch_false: ...to here
LVM2.2.03.36/lib/filters/filter-composite.c:86:21: call_function: inlined call to ‘zalloc’ from ‘composite_filter_create’
LVM2.2.03.36/lib/filters/filter-composite.c:86:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/filters/filter-composite.c:92:9: branch_false: ...to here
LVM2.2.03.36/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): [#def322]
LVM2.2.03.36/lib/filters/filter-composite.c:99:9: warning[-Wanalyzer-malloc-leak]: leak of ‘filters_copy’
LVM2.2.03.36/lib/filters/filter-composite.c:75:12: branch_false: following ‘false’ branch (when ‘filters’ is non-NULL)...
LVM2.2.03.36/lib/filters/filter-composite.c:78:56: branch_false: ...to here
LVM2.2.03.36/lib/filters/filter-composite.c:78:30: acquire_memory: allocated here
LVM2.2.03.36/lib/filters/filter-composite.c:78:12: branch_false: following ‘false’ branch (when ‘filters_copy’ is non-NULL)...
LVM2.2.03.36/lib/filters/filter-composite.c:83:9: branch_false: ...to here
LVM2.2.03.36/lib/filters/filter-composite.c:86:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/filters/filter-composite.c:92:9: branch_false: ...to here
LVM2.2.03.36/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): [#def323]
LVM2.2.03.36/lib/filters/filter-deviceid.c:66:9: warning[-Wanalyzer-malloc-leak]: leak of ‘calloc(1, 48)’
LVM2.2.03.36/lib/filters/filter-deviceid.c:52:20: enter_function: entry to ‘deviceid_filter_create’
LVM2.2.03.36/lib/filters/filter-deviceid.c:56:19: call_function: inlined call to ‘zalloc’ from ‘deviceid_filter_create’
LVM2.2.03.36/lib/filters/filter-deviceid.c:56:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/filters/filter-deviceid.c:61:9: branch_false: ...to here
LVM2.2.03.36/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): [#def324]
LVM2.2.03.36/lib/filters/filter-fwraid.c:126:9: warning[-Wanalyzer-malloc-leak]: leak of ‘calloc(1, 48)’
LVM2.2.03.36/lib/filters/filter-fwraid.c:111:20: enter_function: entry to ‘fwraid_filter_create’
LVM2.2.03.36/lib/filters/filter-fwraid.c:115:19: call_function: inlined call to ‘zalloc’ from ‘fwraid_filter_create’
LVM2.2.03.36/lib/filters/filter-fwraid.c:115:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/filters/filter-fwraid.c:120:9: branch_false: ...to here
LVM2.2.03.36/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): [#def325]
LVM2.2.03.36/lib/filters/filter-md.c:149:9: warning[-Wanalyzer-malloc-leak]: leak of ‘calloc(1, 48)’
LVM2.2.03.36/lib/filters/filter-md.c:134:20: enter_function: entry to ‘md_filter_create’
LVM2.2.03.36/lib/filters/filter-md.c:138:19: call_function: inlined call to ‘zalloc’ from ‘md_filter_create’
LVM2.2.03.36/lib/filters/filter-md.c:138:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/filters/filter-md.c:143:9: branch_false: ...to here
LVM2.2.03.36/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): [#def326]
LVM2.2.03.36/lib/filters/filter-mpath.c:87:9: warning[-Wanalyzer-malloc-leak]: leak of ‘calloc(1, 48)’
LVM2.2.03.36/lib/filters/filter-mpath.c:67:20: enter_function: entry to ‘mpath_filter_create’
LVM2.2.03.36/lib/filters/filter-mpath.c:72:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/filters/filter-mpath.c:77:19: call_function: inlined call to ‘zalloc’ from ‘mpath_filter_create’
LVM2.2.03.36/lib/filters/filter-mpath.c:77:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/filters/filter-mpath.c:82:9: branch_false: ...to here
LVM2.2.03.36/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): [#def327]
LVM2.2.03.36/lib/filters/filter-partitioned.c:68:9: warning[-Wanalyzer-malloc-leak]: leak of ‘calloc(1, 48)’
LVM2.2.03.36/lib/filters/filter-partitioned.c:54:20: enter_function: entry to ‘partitioned_filter_create’
LVM2.2.03.36/lib/filters/filter-partitioned.c:58:19: call_function: inlined call to ‘zalloc’ from ‘partitioned_filter_create’
LVM2.2.03.36/lib/filters/filter-partitioned.c:58:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/filters/filter-partitioned.c:63:9: branch_false: ...to here
LVM2.2.03.36/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): [#def328]
LVM2.2.03.36/lib/filters/filter-persistent.c:61:29: warning[-Wanalyzer-malloc-leak]: leak of ‘calloc(1, 24)’
LVM2.2.03.36/lib/filters/filter-persistent.c:157:20: enter_function: entry to ‘persistent_filter_create’
LVM2.2.03.36/lib/filters/filter-persistent.c:162:20: call_function: inlined call to ‘zalloc’ from ‘persistent_filter_create’
LVM2.2.03.36/lib/filters/filter-persistent.c:162:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/filters/filter-persistent.c:167:9: branch_false: ...to here
LVM2.2.03.36/lib/filters/filter-persistent.c:171:14: call_function: calling ‘_init_hash’ from ‘persistent_filter_create’
#   59|   		radix_tree_destroy(pf->devices);
#   60|   
#   61|-> 	if (!(pf->devices = radix_tree_create(NULL, NULL)))
#   62|   		return_0;
#   63|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def329]
LVM2.2.03.36/lib/filters/filter-persistent.c:62:17: warning[-Wanalyzer-malloc-leak]: leak of ‘calloc(1, 24)’
LVM2.2.03.36/lib/filters/filter-persistent.c:157:20: enter_function: entry to ‘persistent_filter_create’
LVM2.2.03.36/lib/filters/filter-persistent.c:162:20: call_function: inlined call to ‘zalloc’ from ‘persistent_filter_create’
LVM2.2.03.36/lib/filters/filter-persistent.c:162:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/filters/filter-persistent.c:167:9: branch_false: ...to here
LVM2.2.03.36/lib/filters/filter-persistent.c:171:14: call_function: calling ‘_init_hash’ from ‘persistent_filter_create’
#   60|   
#   61|   	if (!(pf->devices = radix_tree_create(NULL, NULL)))
#   62|-> 		return_0;
#   63|   
#   64|   	return 1;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def330]
LVM2.2.03.36/lib/filters/filter-persistent.c:172:17: warning[-Wanalyzer-malloc-leak]: leak of ‘calloc(1, 24)’
LVM2.2.03.36/lib/filters/filter-persistent.c:157:20: enter_function: entry to ‘persistent_filter_create’
LVM2.2.03.36/lib/filters/filter-persistent.c:162:20: call_function: inlined call to ‘zalloc’ from ‘persistent_filter_create’
LVM2.2.03.36/lib/filters/filter-persistent.c:162:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/filters/filter-persistent.c:167:9: branch_false: ...to here
LVM2.2.03.36/lib/filters/filter-persistent.c:171:14: call_function: calling ‘_init_hash’ from ‘persistent_filter_create’
LVM2.2.03.36/lib/filters/filter-persistent.c:171:14: return_function: returning to ‘persistent_filter_create’ from ‘_init_hash’
LVM2.2.03.36/lib/filters/filter-persistent.c:171:12: branch_true: following ‘true’ branch...
LVM2.2.03.36/lib/filters/filter-persistent.c:172:17: branch_true: ...to here
LVM2.2.03.36/lib/filters/filter-persistent.c:172:17: danger: ‘calloc(1, 24)’ leaks here; was allocated at [(3)](sarif:/runs/0/results/2/codeFlows/0/threadFlows/0/locations/2)
#  170|   
#  171|   	if (!(_init_hash(pf))) {
#  172|-> 		log_error("Couldn't create hash table for persistent filter.");
#  173|   		goto bad;
#  174|   	}

Error: GCC_ANALYZER_WARNING (CWE-401): [#def331]
LVM2.2.03.36/lib/filters/filter-persistent.c:177:17: warning[-Wanalyzer-malloc-leak]: leak of ‘calloc(1, 24)’
LVM2.2.03.36/lib/filters/filter-persistent.c:157:20: enter_function: entry to ‘persistent_filter_create’
LVM2.2.03.36/lib/filters/filter-persistent.c:162:20: call_function: inlined call to ‘zalloc’ from ‘persistent_filter_create’
LVM2.2.03.36/lib/filters/filter-persistent.c:162:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/filters/filter-persistent.c:167:9: branch_false: ...to here
LVM2.2.03.36/lib/filters/filter-persistent.c:171:14: call_function: calling ‘_init_hash’ from ‘persistent_filter_create’
LVM2.2.03.36/lib/filters/filter-persistent.c:171:14: return_function: returning to ‘persistent_filter_create’ from ‘_init_hash’
LVM2.2.03.36/lib/filters/filter-persistent.c:171:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/filters/filter-persistent.c:176:19: call_function: inlined call to ‘zalloc’ from ‘persistent_filter_create’
LVM2.2.03.36/lib/filters/filter-persistent.c:176:12: branch_true: following ‘true’ branch...
LVM2.2.03.36/lib/filters/filter-persistent.c:177:17: branch_true: ...to here
LVM2.2.03.36/lib/filters/filter-persistent.c:177:17: danger: ‘calloc(1, 24)’ leaks here; was allocated at [(3)](sarif:/runs/0/results/3/codeFlows/0/threadFlows/0/locations/2)
#  175|   
#  176|   	if (!(f = zalloc(sizeof(*f)))) {
#  177|-> 		log_error("Allocation of device filter for persistent filter failed.");
#  178|   		goto bad;
#  179|   	}

Error: GCC_ANALYZER_WARNING (CWE-401): [#def332]
LVM2.2.03.36/lib/filters/filter-persistent.c:188:9: warning[-Wanalyzer-malloc-leak]: leak of ‘<unknown>’
LVM2.2.03.36/lib/filters/filter-persistent.c:157:20: enter_function: entry to ‘persistent_filter_create’
LVM2.2.03.36/lib/filters/filter-persistent.c:162:20: call_function: inlined call to ‘zalloc’ from ‘persistent_filter_create’
LVM2.2.03.36/lib/filters/filter-persistent.c:162:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/filters/filter-persistent.c:167:9: branch_false: ...to here
LVM2.2.03.36/lib/filters/filter-persistent.c:171:14: call_function: calling ‘_init_hash’ from ‘persistent_filter_create’
LVM2.2.03.36/lib/filters/filter-persistent.c:171:14: return_function: returning to ‘persistent_filter_create’ from ‘_init_hash’
LVM2.2.03.36/lib/filters/filter-persistent.c:171:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/filters/filter-persistent.c:176:19: call_function: inlined call to ‘zalloc’ from ‘persistent_filter_create’
LVM2.2.03.36/lib/filters/filter-persistent.c:176:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/filters/filter-persistent.c:181:9: branch_false: ...to here
LVM2.2.03.36/lib/filters/filter-persistent.c:188:9: danger: ‘<unknown>’ leaks here; was allocated at [(3)](sarif:/runs/0/results/4/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): [#def333]
LVM2.2.03.36/lib/filters/filter-persistent.c:188:9: warning[-Wanalyzer-malloc-leak]: leak of ‘calloc(1, 48)’
LVM2.2.03.36/lib/filters/filter-persistent.c:157:20: enter_function: entry to ‘persistent_filter_create’
LVM2.2.03.36/lib/filters/filter-persistent.c:162:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/filters/filter-persistent.c:167:9: branch_false: ...to here
LVM2.2.03.36/lib/filters/filter-persistent.c:171:14: call_function: calling ‘_init_hash’ from ‘persistent_filter_create’
LVM2.2.03.36/lib/filters/filter-persistent.c:171:14: return_function: returning to ‘persistent_filter_create’ from ‘_init_hash’
LVM2.2.03.36/lib/filters/filter-persistent.c:171:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/filters/filter-persistent.c:176:19: call_function: inlined call to ‘zalloc’ from ‘persistent_filter_create’
LVM2.2.03.36/lib/filters/filter-persistent.c:176:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/filters/filter-persistent.c:181:9: branch_false: ...to here
LVM2.2.03.36/lib/filters/filter-persistent.c:188:9: danger: ‘calloc(1, 48)’ leaks here; was allocated at [(12)](sarif:/runs/0/results/5/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): [#def334]
LVM2.2.03.36/lib/filters/filter-persistent.c:194:17: warning[-Wanalyzer-malloc-leak]: leak of ‘calloc(1, 24)’
LVM2.2.03.36/lib/filters/filter-persistent.c:157:20: enter_function: entry to ‘persistent_filter_create’
LVM2.2.03.36/lib/filters/filter-persistent.c:162:20: call_function: inlined call to ‘zalloc’ from ‘persistent_filter_create’
LVM2.2.03.36/lib/filters/filter-persistent.c:162:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/filters/filter-persistent.c:167:9: branch_false: ...to here
LVM2.2.03.36/lib/filters/filter-persistent.c:171:14: call_function: calling ‘_init_hash’ from ‘persistent_filter_create’
LVM2.2.03.36/lib/filters/filter-persistent.c:171:14: return_function: returning to ‘persistent_filter_create’ from ‘_init_hash’
LVM2.2.03.36/lib/filters/filter-persistent.c:176:12: branch_true: following ‘true’ branch...
LVM2.2.03.36/lib/filters/filter-persistent.c:177:17: branch_true: ...to here
LVM2.2.03.36/lib/filters/filter-persistent.c:193:12: branch_true: following ‘true’ branch...
LVM2.2.03.36/lib/filters/filter-persistent.c:194:17: branch_true: ...to here
LVM2.2.03.36/lib/filters/filter-persistent.c:194:17: danger: ‘calloc(1, 24)’ leaks here; was allocated at [(3)](sarif:/runs/0/results/6/codeFlows/0/threadFlows/0/locations/2)
#  192|         bad:
#  193|   	if (pf->devices)
#  194|-> 		radix_tree_destroy(pf->devices);
#  195|   	free(pf);
#  196|   	free(f);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def335]
LVM2.2.03.36/lib/filters/filter-signature.c:88:9: warning[-Wanalyzer-malloc-leak]: leak of ‘calloc(1, 48)’
LVM2.2.03.36/lib/filters/filter-signature.c:73:20: enter_function: entry to ‘signature_filter_create’
LVM2.2.03.36/lib/filters/filter-signature.c:77:19: call_function: inlined call to ‘zalloc’ from ‘signature_filter_create’
LVM2.2.03.36/lib/filters/filter-signature.c:77:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/filters/filter-signature.c:82:9: branch_false: ...to here
LVM2.2.03.36/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): [#def336]
LVM2.2.03.36/lib/filters/filter-sysfs.c:99:9: warning[-Wanalyzer-malloc-leak]: leak of ‘calloc(1, strlen(sysfs_dir) + 49)’
LVM2.2.03.36/lib/filters/filter-sysfs.c:73:20: enter_function: entry to ‘sysfs_filter_create’
LVM2.2.03.36/lib/filters/filter-sysfs.c:78:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/filters/filter-sysfs.c:84:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/filters/filter-sysfs.c:87:15: branch_false: ...to here
LVM2.2.03.36/lib/filters/filter-sysfs.c:88:19: call_function: inlined call to ‘zalloc’ from ‘sysfs_filter_create’
LVM2.2.03.36/lib/filters/filter-sysfs.c:88:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/filters/filter-sysfs.c:91:9: branch_false: ...to here
LVM2.2.03.36/lib/filters/filter-sysfs.c:99:9: danger: ‘calloc(1, strlen(sysfs_dir) + 49)’ leaks here; was allocated at [(7)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/6)
#   97|   	f->private = (f + 1);
#   98|   
#   99|-> 	log_debug_devs("Sysfs filter initialised.");
#  100|   
#  101|   	return f;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def337]
LVM2.2.03.36/lib/filters/filter-type.c:61:9: warning[-Wanalyzer-malloc-leak]: leak of ‘calloc(1, 48)’
LVM2.2.03.36/lib/filters/filter-type.c:46:20: enter_function: entry to ‘lvm_type_filter_create’
LVM2.2.03.36/lib/filters/filter-type.c:50:19: call_function: inlined call to ‘zalloc’ from ‘lvm_type_filter_create’
LVM2.2.03.36/lib/filters/filter-type.c:50:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/filters/filter-type.c:55:9: branch_false: ...to here
LVM2.2.03.36/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): [#def338]
LVM2.2.03.36/lib/filters/filter-usable.c:99:17: warning[-Wanalyzer-malloc-leak]: leak of ‘calloc(1, 48)’
LVM2.2.03.36/lib/filters/filter-usable.c:83:20: enter_function: entry to ‘usable_filter_create’
LVM2.2.03.36/lib/filters/filter-usable.c:88:19: call_function: inlined call to ‘zalloc’ from ‘usable_filter_create’
LVM2.2.03.36/lib/filters/filter-usable.c:88:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/filters/filter-usable.c:93:9: branch_false: ...to here
LVM2.2.03.36/lib/filters/filter-usable.c:98:12: branch_true: following ‘true’ branch...
LVM2.2.03.36/lib/filters/filter-usable.c:99:17: branch_true: ...to here
LVM2.2.03.36/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): [#def339]
LVM2.2.03.36/lib/filters/filter-usable.c:106:33: warning[-Wanalyzer-malloc-leak]: leak of ‘calloc(1, 4)’
LVM2.2.03.36/lib/filters/filter-usable.c:83:20: enter_function: entry to ‘usable_filter_create’
LVM2.2.03.36/lib/filters/filter-usable.c:88:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/filters/filter-usable.c:93:9: branch_false: ...to here
LVM2.2.03.36/lib/filters/filter-usable.c:98:22: call_function: inlined call to ‘zalloc’ from ‘usable_filter_create’
LVM2.2.03.36/lib/filters/filter-usable.c:98:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/filters/filter-usable.c:104:9: branch_false: ...to here
LVM2.2.03.36/lib/filters/filter-usable.c:106:33: danger: ‘calloc(1, 4)’ leaks here; was allocated at [(5)](sarif:/runs/0/results/1/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): [#def340]
LVM2.2.03.36/lib/filters/filter-usable.c:106:33: warning[-Wanalyzer-malloc-leak]: leak of ‘calloc(1, 48)’
LVM2.2.03.36/lib/filters/filter-usable.c:83:20: enter_function: entry to ‘usable_filter_create’
LVM2.2.03.36/lib/filters/filter-usable.c:88:19: call_function: inlined call to ‘zalloc’ from ‘usable_filter_create’
LVM2.2.03.36/lib/filters/filter-usable.c:88:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/filters/filter-usable.c:93:9: branch_false: ...to here
LVM2.2.03.36/lib/filters/filter-usable.c:98:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/filters/filter-usable.c:104:9: branch_false: ...to here
LVM2.2.03.36/lib/filters/filter-usable.c:106:33: danger: ‘calloc(1, 48)’ leaks here; was allocated at [(3)](sarif:/runs/0/results/2/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): [#def341]
LVM2.2.03.36/lib/filters/filter-usable.c:109:27: warning[-Wanalyzer-malloc-leak]: leak of ‘calloc(1, 4)’
LVM2.2.03.36/lib/filters/filter-usable.c:83:20: enter_function: entry to ‘usable_filter_create’
LVM2.2.03.36/lib/filters/filter-usable.c:88:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/filters/filter-usable.c:93:9: branch_false: ...to here
LVM2.2.03.36/lib/filters/filter-usable.c:98:22: call_function: inlined call to ‘zalloc’ from ‘usable_filter_create’
LVM2.2.03.36/lib/filters/filter-usable.c:98:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/filters/filter-usable.c:104:9: branch_false: ...to here
LVM2.2.03.36/lib/filters/filter-usable.c:109:27: danger: ‘calloc(1, 4)’ leaks here; was allocated at [(5)](sarif:/runs/0/results/4/codeFlows/0/threadFlows/0/locations/4)
#  107|   	data->check_error_target = 1;
#  108|   	data->check_reserved = 1;
#  109|-> 	data->check_lv = !find_config_tree_bool(cmd, devices_scan_lvs_CFG, NULL);
#  110|   
#  111|   	f->private = data;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def342]
LVM2.2.03.36/lib/filters/filter-usable.c:109:27: warning[-Wanalyzer-malloc-leak]: leak of ‘calloc(1, 48)’
LVM2.2.03.36/lib/filters/filter-usable.c:83:20: enter_function: entry to ‘usable_filter_create’
LVM2.2.03.36/lib/filters/filter-usable.c:88:19: call_function: inlined call to ‘zalloc’ from ‘usable_filter_create’
LVM2.2.03.36/lib/filters/filter-usable.c:88:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/filters/filter-usable.c:93:9: branch_false: ...to here
LVM2.2.03.36/lib/filters/filter-usable.c:98:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/filters/filter-usable.c:104:9: branch_false: ...to here
LVM2.2.03.36/lib/filters/filter-usable.c:109:27: danger: ‘calloc(1, 48)’ leaks here; was allocated at [(3)](sarif:/runs/0/results/3/codeFlows/0/threadFlows/0/locations/2)
#  107|   	data->check_error_target = 1;
#  108|   	data->check_reserved = 1;
#  109|-> 	data->check_lv = !find_config_tree_bool(cmd, devices_scan_lvs_CFG, NULL);
#  110|   
#  111|   	f->private = data;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def343]
LVM2.2.03.36/lib/filters/filter-usable.c:113:9: warning[-Wanalyzer-malloc-leak]: leak of ‘<unknown>’
LVM2.2.03.36/lib/filters/filter-usable.c:83:20: enter_function: entry to ‘usable_filter_create’
LVM2.2.03.36/lib/filters/filter-usable.c:88:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/filters/filter-usable.c:93:9: branch_false: ...to here
LVM2.2.03.36/lib/filters/filter-usable.c:98:22: call_function: inlined call to ‘zalloc’ from ‘usable_filter_create’
LVM2.2.03.36/lib/filters/filter-usable.c:98:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/filters/filter-usable.c:104:9: branch_false: ...to here
LVM2.2.03.36/lib/filters/filter-usable.c:113:9: danger: ‘<unknown>’ leaks here; was allocated at [(5)](sarif:/runs/0/results/5/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): [#def344]
LVM2.2.03.36/lib/filters/filter-usable.c:113:9: warning[-Wanalyzer-malloc-leak]: leak of ‘calloc(1, 48)’
LVM2.2.03.36/lib/filters/filter-usable.c:83:20: enter_function: entry to ‘usable_filter_create’
LVM2.2.03.36/lib/filters/filter-usable.c:88:19: call_function: inlined call to ‘zalloc’ from ‘usable_filter_create’
LVM2.2.03.36/lib/filters/filter-usable.c:88:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/filters/filter-usable.c:93:9: branch_false: ...to here
LVM2.2.03.36/lib/filters/filter-usable.c:98:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/filters/filter-usable.c:104:9: branch_false: ...to here
LVM2.2.03.36/lib/filters/filter-usable.c:113:9: danger: ‘calloc(1, 48)’ leaks here; was allocated at [(3)](sarif:/runs/0/results/6/codeFlows/0/threadFlows/0/locations/2)
#  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): [#def345]
LVM2.2.03.36/lib/format_text/archive.c:256:14: warning[-Wanalyzer-malloc-leak]: leak of ‘fp’
LVM2.2.03.36/lib/format_text/archive.c:243:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/format_text/archive.c:249:20: branch_false: ...to here
LVM2.2.03.36/lib/format_text/archive.c:249:20: acquire_memory: allocated here
LVM2.2.03.36/lib/format_text/archive.c:249:12: branch_false: following ‘false’ branch (when ‘fp’ is non-NULL)...
LVM2.2.03.36/lib/format_text/archive.c:256:14: branch_false: ...to here
LVM2.2.03.36/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): [#def346]
LVM2.2.03.36/lib/format_text/export.c:310:9: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
LVM2.2.03.36/lib/format_text/export.c:693:12: enter_function: entry to ‘_print_timestamp’
LVM2.2.03.36/lib/format_text/export.c:699:12: branch_true: following ‘true’ branch...
LVM2.2.03.36/lib/format_text/export.c:700:21: branch_true: ...to here
LVM2.2.03.36/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): [#def347]
LVM2.2.03.36/lib/format_text/export.c:323:9: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
LVM2.2.03.36/lib/format_text/export.c:930:12: enter_function: entry to ‘_print_historical_lvs’
LVM2.2.03.36/lib/format_text/export.c:934:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/format_text/export.c:937:9: branch_false: ...to here
LVM2.2.03.36/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): [#def348]
LVM2.2.03.36/lib/format_text/export.c:962:27: warning[-Wanalyzer-malloc-leak]: leak of ‘f.data.fp’
LVM2.2.03.36/lib/format_text/export.c:1047:8: enter_function: entry to ‘text_vg_export_raw’
LVM2.2.03.36/lib/format_text/export.c:1060:34: call_function: inlined call to ‘zalloc’ from ‘text_vg_export_raw’
LVM2.2.03.36/lib/format_text/export.c:1060:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/format_text/export.c:1065:14: branch_false: ...to here
LVM2.2.03.36/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): [#def349]
LVM2.2.03.36/lib/format_text/export.c:963:17: warning[-Wanalyzer-malloc-leak]: leak of ‘f.data.fp’
LVM2.2.03.36/lib/format_text/export.c:1047:8: enter_function: entry to ‘text_vg_export_raw’
LVM2.2.03.36/lib/format_text/export.c:1060:34: call_function: inlined call to ‘zalloc’ from ‘text_vg_export_raw’
LVM2.2.03.36/lib/format_text/export.c:1060:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/format_text/export.c:1065:14: branch_false: ...to here
LVM2.2.03.36/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): [#def350]
LVM2.2.03.36/lib/format_text/export.c:969:22: warning[-Wanalyzer-malloc-leak]: leak of ‘f.data.fp’
LVM2.2.03.36/lib/format_text/export.c:1047:8: enter_function: entry to ‘text_vg_export_raw’
LVM2.2.03.36/lib/format_text/export.c:1060:34: call_function: inlined call to ‘zalloc’ from ‘text_vg_export_raw’
LVM2.2.03.36/lib/format_text/export.c:1060:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/format_text/export.c:1065:14: branch_false: ...to here
LVM2.2.03.36/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): [#def351]
LVM2.2.03.36/lib/format_text/export.c:970:25: warning[-Wanalyzer-malloc-leak]: leak of ‘f.data.fp’
LVM2.2.03.36/lib/format_text/export.c:1047:8: enter_function: entry to ‘text_vg_export_raw’
LVM2.2.03.36/lib/format_text/export.c:1060:34: call_function: inlined call to ‘zalloc’ from ‘text_vg_export_raw’
LVM2.2.03.36/lib/format_text/export.c:1060:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/format_text/export.c:1065:14: branch_false: ...to here
LVM2.2.03.36/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): [#def352]
LVM2.2.03.36/lib/format_text/export.c:983:17: warning[-Wanalyzer-malloc-leak]: leak of ‘f.data.fp’
LVM2.2.03.36/lib/format_text/export.c:1047:8: enter_function: entry to ‘text_vg_export_raw’
LVM2.2.03.36/lib/format_text/export.c:1060:34: call_function: inlined call to ‘zalloc’ from ‘text_vg_export_raw’
LVM2.2.03.36/lib/format_text/export.c:1060:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/format_text/export.c:1065:14: branch_false: ...to here
LVM2.2.03.36/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): [#def353]
LVM2.2.03.36/lib/format_text/format-text.c:1328:9: warning[-Wanalyzer-malloc-leak]: leak of ‘fp’
LVM2.2.03.36/lib/format_text/format-text.c:1315:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/format_text/format-text.c:1321:20: branch_false: ...to here
LVM2.2.03.36/lib/format_text/format-text.c:1321:20: acquire_memory: allocated here
LVM2.2.03.36/lib/format_text/format-text.c:1321:12: branch_false: following ‘false’ branch (when ‘fp’ is non-NULL)...
LVM2.2.03.36/lib/format_text/format-text.c:1328:9: branch_false: ...to here
LVM2.2.03.36/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): [#def354]
LVM2.2.03.36/lib/format_text/format-text.c:1330:14: warning[-Wanalyzer-malloc-leak]: leak of ‘fp’
LVM2.2.03.36/lib/format_text/format-text.c:1315:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/format_text/format-text.c:1321:20: branch_false: ...to here
LVM2.2.03.36/lib/format_text/format-text.c:1321:20: acquire_memory: allocated here
LVM2.2.03.36/lib/format_text/format-text.c:1321:12: branch_false: following ‘false’ branch (when ‘fp’ is non-NULL)...
LVM2.2.03.36/lib/format_text/format-text.c:1328:9: branch_false: ...to here
LVM2.2.03.36/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): [#def355]
LVM2.2.03.36/lib/format_text/format-text.c:2565:21: warning[-Wanalyzer-malloc-leak]: leak of ‘calloc(1, 120)’
LVM2.2.03.36/lib/format_text/format-text.c:2591:21: enter_function: entry to ‘create_text_format’
LVM2.2.03.36/lib/format_text/format-text.c:2598:21: call_function: inlined call to ‘zalloc’ from ‘create_text_format’
LVM2.2.03.36/lib/format_text/format-text.c:2598:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/format_text/format-text.c:2603:9: branch_false: ...to here
LVM2.2.03.36/lib/format_text/format-text.c:2613:12: branch_false: following ‘false’ branch (when ‘mda_lists’ is non-NULL)...
LVM2.2.03.36/lib/format_text/format-text.c:2619:9: branch_false: ...to here
LVM2.2.03.36/lib/format_text/format-text.c:2623:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/format_text/format-text.c:2628:14: branch_false: ...to here
LVM2.2.03.36/lib/format_text/format-text.c:2628:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/format_text/format-text.c:2634:32: branch_false: ...to here
LVM2.2.03.36/lib/format_text/format-text.c:2634:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/format_text/format-text.c:2637:9: branch_false: ...to here
LVM2.2.03.36/lib/format_text/format-text.c:2640:21: call_function: calling ‘_text_create_text_instance’ from ‘create_text_format’
# 2563|   	struct format_instance *fid;
# 2564|   
# 2565|-> 	if (!(fid = alloc_fid(fmt, fic)))
# 2566|   		return_NULL;
# 2567|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def356]
LVM2.2.03.36/lib/format_text/format-text.c:2614:17: warning[-Wanalyzer-malloc-leak]: leak of ‘calloc(1, 120)’
LVM2.2.03.36/lib/format_text/format-text.c:2591:21: enter_function: entry to ‘create_text_format’
LVM2.2.03.36/lib/format_text/format-text.c:2598:21: call_function: inlined call to ‘zalloc’ from ‘create_text_format’
LVM2.2.03.36/lib/format_text/format-text.c:2598:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/format_text/format-text.c:2603:9: branch_false: ...to here
LVM2.2.03.36/lib/format_text/format-text.c:2613:12: branch_true: following ‘true’ branch (when ‘mda_lists’ is NULL)...
LVM2.2.03.36/lib/format_text/format-text.c:2614:17: branch_true: ...to here
LVM2.2.03.36/lib/format_text/format-text.c:2614:17: danger: ‘calloc(1, 120)’ leaks here; was allocated at [(3)](sarif:/runs/0/results/3/codeFlows/0/threadFlows/0/locations/2)
# 2612|   
# 2613|   	if (!(mda_lists = malloc(sizeof(struct mda_lists)))) {
# 2614|-> 		log_error("Failed to allocate dir_list");
# 2615|   		free(fmt);
# 2616|   		return NULL;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def357]
LVM2.2.03.36/lib/format_text/format-text.c:2623:31: warning[-Wanalyzer-malloc-leak]: leak of ‘calloc(1, 120)’
LVM2.2.03.36/lib/format_text/format-text.c:2591:21: enter_function: entry to ‘create_text_format’
LVM2.2.03.36/lib/format_text/format-text.c:2598:21: call_function: inlined call to ‘zalloc’ from ‘create_text_format’
LVM2.2.03.36/lib/format_text/format-text.c:2598:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/format_text/format-text.c:2603:9: branch_false: ...to here
LVM2.2.03.36/lib/format_text/format-text.c:2613:12: branch_false: following ‘false’ branch (when ‘mda_lists’ is non-NULL)...
LVM2.2.03.36/lib/format_text/format-text.c:2619:9: branch_false: ...to here
LVM2.2.03.36/lib/format_text/format-text.c:2623:31: danger: ‘calloc(1, 120)’ leaks here; was allocated at [(3)](sarif:/runs/0/results/4/codeFlows/0/threadFlows/0/locations/2)
# 2621|   	fmt->private = (void *) mda_lists;
# 2622|   
# 2623|-> 	if (!(fmt->labeller = text_labeller_create(fmt))) {
# 2624|   		log_error("Couldn't create text label handler.");
# 2625|   		goto bad;

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

Error: GCC_ANALYZER_WARNING (CWE-401): [#def359]
LVM2.2.03.36/lib/format_text/format-text.c:2624:17: warning[-Wanalyzer-malloc-leak]: leak of ‘calloc(1, 120)’
LVM2.2.03.36/lib/format_text/format-text.c:2591:21: enter_function: entry to ‘create_text_format’
LVM2.2.03.36/lib/format_text/format-text.c:2598:21: call_function: inlined call to ‘zalloc’ from ‘create_text_format’
LVM2.2.03.36/lib/format_text/format-text.c:2598:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/format_text/format-text.c:2603:9: branch_false: ...to here
LVM2.2.03.36/lib/format_text/format-text.c:2613:12: branch_false: following ‘false’ branch (when ‘mda_lists’ is non-NULL)...
LVM2.2.03.36/lib/format_text/format-text.c:2619:9: branch_false: ...to here
LVM2.2.03.36/lib/format_text/format-text.c:2623:12: branch_true: following ‘true’ branch...
LVM2.2.03.36/lib/format_text/format-text.c:2624:17: branch_true: ...to here
LVM2.2.03.36/lib/format_text/format-text.c:2624:17: danger: ‘calloc(1, 120)’ leaks here; was allocated at [(3)](sarif:/runs/0/results/6/codeFlows/0/threadFlows/0/locations/2)
# 2622|   
# 2623|   	if (!(fmt->labeller = text_labeller_create(fmt))) {
# 2624|-> 		log_error("Couldn't create text label handler.");
# 2625|   		goto bad;
# 2626|   	}

Error: GCC_ANALYZER_WARNING (CWE-401): [#def360]
LVM2.2.03.36/lib/format_text/format-text.c:2628:14: warning[-Wanalyzer-malloc-leak]: leak of ‘calloc(1, 120)’
LVM2.2.03.36/lib/format_text/format-text.c:2591:21: enter_function: entry to ‘create_text_format’
LVM2.2.03.36/lib/format_text/format-text.c:2598:21: call_function: inlined call to ‘zalloc’ from ‘create_text_format’
LVM2.2.03.36/lib/format_text/format-text.c:2598:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/format_text/format-text.c:2603:9: branch_false: ...to here
LVM2.2.03.36/lib/format_text/format-text.c:2613:12: branch_false: following ‘false’ branch (when ‘mda_lists’ is non-NULL)...
LVM2.2.03.36/lib/format_text/format-text.c:2619:9: branch_false: ...to here
LVM2.2.03.36/lib/format_text/format-text.c:2623:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/format_text/format-text.c:2628:14: branch_false: ...to here
LVM2.2.03.36/lib/format_text/format-text.c:2628:14: danger: ‘calloc(1, 120)’ leaks here; was allocated at [(3)](sarif:/runs/0/results/7/codeFlows/0/threadFlows/0/locations/2)
# 2626|   	}
# 2627|   
# 2628|-> 	if (!(label_register_handler(fmt->labeller))) {
# 2629|   		log_error("Couldn't register text label handler.");
# 2630|   		fmt->labeller->ops->destroy(fmt->labeller);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def361]
LVM2.2.03.36/lib/format_text/format-text.c:2629:17: warning[-Wanalyzer-malloc-leak]: leak of ‘calloc(1, 120)’
LVM2.2.03.36/lib/format_text/format-text.c:2591:21: enter_function: entry to ‘create_text_format’
LVM2.2.03.36/lib/format_text/format-text.c:2598:21: call_function: inlined call to ‘zalloc’ from ‘create_text_format’
LVM2.2.03.36/lib/format_text/format-text.c:2598:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/format_text/format-text.c:2603:9: branch_false: ...to here
LVM2.2.03.36/lib/format_text/format-text.c:2613:12: branch_false: following ‘false’ branch (when ‘mda_lists’ is non-NULL)...
LVM2.2.03.36/lib/format_text/format-text.c:2619:9: branch_false: ...to here
LVM2.2.03.36/lib/format_text/format-text.c:2623:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/format_text/format-text.c:2628:14: branch_false: ...to here
LVM2.2.03.36/lib/format_text/format-text.c:2628:12: branch_true: following ‘true’ branch...
LVM2.2.03.36/lib/format_text/format-text.c:2629:17: branch_true: ...to here
LVM2.2.03.36/lib/format_text/format-text.c:2629:17: danger: ‘calloc(1, 120)’ leaks here; was allocated at [(3)](sarif:/runs/0/results/8/codeFlows/0/threadFlows/0/locations/2)
# 2627|   
# 2628|   	if (!(label_register_handler(fmt->labeller))) {
# 2629|-> 		log_error("Couldn't register text label handler.");
# 2630|   		fmt->labeller->ops->destroy(fmt->labeller);
# 2631|   		goto bad;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def362]
LVM2.2.03.36/lib/format_text/format-text.c:2630:17: warning[-Wanalyzer-malloc-leak]: leak of ‘calloc(1, 120)’
LVM2.2.03.36/lib/format_text/format-text.c:2591:21: enter_function: entry to ‘create_text_format’
LVM2.2.03.36/lib/format_text/format-text.c:2598:21: call_function: inlined call to ‘zalloc’ from ‘create_text_format’
LVM2.2.03.36/lib/format_text/format-text.c:2598:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/format_text/format-text.c:2603:9: branch_false: ...to here
LVM2.2.03.36/lib/format_text/format-text.c:2613:12: branch_false: following ‘false’ branch (when ‘mda_lists’ is non-NULL)...
LVM2.2.03.36/lib/format_text/format-text.c:2619:9: branch_false: ...to here
LVM2.2.03.36/lib/format_text/format-text.c:2623:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/format_text/format-text.c:2628:14: branch_false: ...to here
LVM2.2.03.36/lib/format_text/format-text.c:2628:12: branch_true: following ‘true’ branch...
LVM2.2.03.36/lib/format_text/format-text.c:2629:17: branch_true: ...to here
LVM2.2.03.36/lib/format_text/format-text.c:2630:17: danger: ‘calloc(1, 120)’ leaks here; was allocated at [(3)](sarif:/runs/0/results/9/codeFlows/0/threadFlows/0/locations/2)
# 2628|   	if (!(label_register_handler(fmt->labeller))) {
# 2629|   		log_error("Couldn't register text label handler.");
# 2630|-> 		fmt->labeller->ops->destroy(fmt->labeller);
# 2631|   		goto bad;
# 2632|   	}

Error: GCC_ANALYZER_WARNING (CWE-401): [#def363]
LVM2.2.03.36/lib/format_text/format-text.c:2634:32: warning[-Wanalyzer-malloc-leak]: leak of ‘calloc(1, 120)’
LVM2.2.03.36/lib/format_text/format-text.c:2591:21: enter_function: entry to ‘create_text_format’
LVM2.2.03.36/lib/format_text/format-text.c:2598:21: call_function: inlined call to ‘zalloc’ from ‘create_text_format’
LVM2.2.03.36/lib/format_text/format-text.c:2598:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/format_text/format-text.c:2603:9: branch_false: ...to here
LVM2.2.03.36/lib/format_text/format-text.c:2613:12: branch_false: following ‘false’ branch (when ‘mda_lists’ is non-NULL)...
LVM2.2.03.36/lib/format_text/format-text.c:2619:9: branch_false: ...to here
LVM2.2.03.36/lib/format_text/format-text.c:2623:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/format_text/format-text.c:2628:14: branch_false: ...to here
LVM2.2.03.36/lib/format_text/format-text.c:2628:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/format_text/format-text.c:2634:32: branch_false: ...to here
LVM2.2.03.36/lib/format_text/format-text.c:2634:32: danger: ‘calloc(1, 120)’ leaks here; was allocated at [(3)](sarif:/runs/0/results/10/codeFlows/0/threadFlows/0/locations/2)
# 2632|   	}
# 2633|   
# 2634|-> 	if (!(fmt->orphan_vg = alloc_vg("text_orphan", cmd, fmt->orphan_vg_name)))
# 2635|   		goto_bad;
# 2636|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def364]
LVM2.2.03.36/lib/format_text/format-text.c:2635:17: warning[-Wanalyzer-malloc-leak]: leak of ‘calloc(1, 120)’
LVM2.2.03.36/lib/format_text/format-text.c:2591:21: enter_function: entry to ‘create_text_format’
LVM2.2.03.36/lib/format_text/format-text.c:2598:21: call_function: inlined call to ‘zalloc’ from ‘create_text_format’
LVM2.2.03.36/lib/format_text/format-text.c:2598:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/format_text/format-text.c:2603:9: branch_false: ...to here
LVM2.2.03.36/lib/format_text/format-text.c:2613:12: branch_false: following ‘false’ branch (when ‘mda_lists’ is non-NULL)...
LVM2.2.03.36/lib/format_text/format-text.c:2619:9: branch_false: ...to here
LVM2.2.03.36/lib/format_text/format-text.c:2623:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/format_text/format-text.c:2628:14: branch_false: ...to here
LVM2.2.03.36/lib/format_text/format-text.c:2628:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/format_text/format-text.c:2634:32: branch_false: ...to here
LVM2.2.03.36/lib/format_text/format-text.c:2634:12: branch_true: following ‘true’ branch...
LVM2.2.03.36/lib/format_text/format-text.c:2635:17: branch_true: ...to here
LVM2.2.03.36/lib/format_text/format-text.c:2635:17: danger: ‘calloc(1, 120)’ leaks here; was allocated at [(3)](sarif:/runs/0/results/11/codeFlows/0/threadFlows/0/locations/2)
# 2633|   
# 2634|   	if (!(fmt->orphan_vg = alloc_vg("text_orphan", cmd, fmt->orphan_vg_name)))
# 2635|-> 		goto_bad;
# 2636|   
# 2637|   	fic.type = FMT_INSTANCE_AUX_MDAS;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def365]
LVM2.2.03.36/lib/format_text/text_label.c:216:9: warning[-Wanalyzer-malloc-leak]: leak of ‘dal’
LVM2.2.03.36/lib/format_text/text_label.c:201:12: branch_true: following ‘true’ branch (when ‘mem’ is NULL)...
LVM2.2.03.36/lib/format_text/text_label.c:202:29: branch_true: ...to here
LVM2.2.03.36/lib/format_text/text_label.c:202:29: acquire_memory: allocated here
LVM2.2.03.36/lib/format_text/text_label.c:202:20: branch_false: following ‘false’ branch (when ‘dal’ is non-NULL)...
LVM2.2.03.36/lib/format_text/text_label.c:213:9: branch_false: ...to here
LVM2.2.03.36/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): [#def366]
LVM2.2.03.36/lib/format_text/text_label.c:259:25: warning[-Wanalyzer-malloc-leak]: leak of ‘mdal’
LVM2.2.03.36/lib/format_text/text_label.c:252:12: branch_true: following ‘true’ branch (when ‘mem’ is NULL)...
LVM2.2.03.36/lib/format_text/text_label.c:253:30: branch_true: ...to here
LVM2.2.03.36/lib/format_text/text_label.c:253:30: acquire_memory: allocated here
LVM2.2.03.36/lib/format_text/text_label.c:253:20: branch_false: following ‘false’ branch (when ‘mdal’ is non-NULL)...
LVM2.2.03.36/lib/format_text/text_label.c:258:30: branch_false: ...to here
LVM2.2.03.36/lib/format_text/text_label.c:258:20: branch_true: following ‘true’ branch (when ‘mdac’ is NULL)...
LVM2.2.03.36/lib/format_text/text_label.c:259:25: branch_true: ...to here
LVM2.2.03.36/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): [#def367]
LVM2.2.03.36/lib/format_text/text_label.c:294:9: warning[-Wanalyzer-malloc-leak]: leak of ‘mdac’
LVM2.2.03.36/lib/format_text/text_label.c:252:12: branch_true: following ‘true’ branch (when ‘mem’ is NULL)...
LVM2.2.03.36/lib/format_text/text_label.c:253:30: branch_true: ...to here
LVM2.2.03.36/lib/format_text/text_label.c:253:20: branch_false: following ‘false’ branch (when ‘mdal’ is non-NULL)...
LVM2.2.03.36/lib/format_text/text_label.c:258:30: branch_false: ...to here
LVM2.2.03.36/lib/format_text/text_label.c:258:30: acquire_memory: allocated here
LVM2.2.03.36/lib/format_text/text_label.c:258:20: branch_false: following ‘false’ branch (when ‘mdac’ is non-NULL)...
LVM2.2.03.36/lib/format_text/text_label.c:275:21: branch_false: ...to here
LVM2.2.03.36/lib/format_text/text_label.c:294:9: danger: ‘mdac’ leaks here; was allocated at [(5)](sarif:/runs/0/results/2/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): [#def368]
LVM2.2.03.36/lib/format_text/text_label.c:294:9: warning[-Wanalyzer-malloc-leak]: leak of ‘mdal’
LVM2.2.03.36/lib/format_text/text_label.c:252:12: branch_true: following ‘true’ branch (when ‘mem’ is NULL)...
LVM2.2.03.36/lib/format_text/text_label.c:253:30: branch_true: ...to here
LVM2.2.03.36/lib/format_text/text_label.c:253:30: acquire_memory: allocated here
LVM2.2.03.36/lib/format_text/text_label.c:253:20: branch_false: following ‘false’ branch (when ‘mdal’ is non-NULL)...
LVM2.2.03.36/lib/format_text/text_label.c:258:30: branch_false: ...to here
LVM2.2.03.36/lib/format_text/text_label.c:258:20: branch_false: following ‘false’ branch (when ‘mdac’ is non-NULL)...
LVM2.2.03.36/lib/format_text/text_label.c:275:21: branch_false: ...to here
LVM2.2.03.36/lib/format_text/text_label.c:294:9: danger: ‘mdal’ leaks here; was allocated at [(3)](sarif:/runs/0/results/3/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): [#def369]
LVM2.2.03.36/lib/freeseg/freeseg.c:40:9: warning[-Wanalyzer-malloc-leak]: leak of ‘calloc(1, 72)’
LVM2.2.03.36/lib/freeseg/freeseg.c:29:22: enter_function: entry to ‘init_free_segtype’
LVM2.2.03.36/lib/freeseg/freeseg.c:31:40: call_function: inlined call to ‘zalloc’ from ‘init_free_segtype’
LVM2.2.03.36/lib/freeseg/freeseg.c:33:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/freeseg/freeseg.c:36:9: branch_false: ...to here
LVM2.2.03.36/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): [#def370]
LVM2.2.03.36/lib/integrity/integrity.c:344:14: warning[-Wanalyzer-malloc-leak]: leak of ‘calloc(1, 72)’
LVM2.2.03.36/lib/integrity/integrity.c:330:5: enter_function: entry to ‘init_integrity_segtypes’
LVM2.2.03.36/lib/integrity/integrity.c:333:40: call_function: inlined call to ‘zalloc’ from ‘init_integrity_segtypes’
LVM2.2.03.36/lib/integrity/integrity.c:335:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/integrity/integrity.c:340:9: branch_false: ...to here
LVM2.2.03.36/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): [#def371]
LVM2.2.03.36/lib/label/hints.c:282:17: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(&_hints_file, "w")’
LVM2.2.03.36/lib/label/hints.c:963:5: enter_function: entry to ‘write_hint_file’
LVM2.2.03.36/lib/label/hints.c:981:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/label/hints.c:985:13: branch_false: ...to here
LVM2.2.03.36/lib/label/hints.c:996:20: branch_false: following ‘false’ branch (when ‘newhints != 4’)...
LVM2.2.03.36/lib/label/hints.c:1000:9: branch_false: ...to here
LVM2.2.03.36/lib/label/hints.c:1002:20: acquire_resource: opened here
LVM2.2.03.36/lib/label/hints.c:1002:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/label/hints.c:1007:13: branch_false: ...to here
LVM2.2.03.36/lib/label/hints.c:1128:12: branch_true: following ‘true’ branch (when ‘newhints == 1’)...
LVM2.2.03.36/lib/label/hints.c:1129:17: branch_true: ...to here
LVM2.2.03.36/lib/label/hints.c:1129:17: call_function: calling ‘_unlink_newhints’ from ‘write_hint_file’
#  280|   {
#  281|   	if (unlink(_newhints_file))
#  282|-> 		log_debug("unlink_newhints errno %d %s", errno, _newhints_file);
#  283|   }
#  284|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def372]
LVM2.2.03.36/lib/label/hints.c:282:17: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(&_hints_file, "w")’
LVM2.2.03.36/lib/label/hints.c:963:5: enter_function: entry to ‘write_hint_file’
LVM2.2.03.36/lib/label/hints.c:981:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/label/hints.c:985:13: branch_false: ...to here
LVM2.2.03.36/lib/label/hints.c:996:20: branch_false: following ‘false’ branch (when ‘newhints != 4’)...
LVM2.2.03.36/lib/label/hints.c:1000:9: branch_false: ...to here
LVM2.2.03.36/lib/label/hints.c:1002:20: acquire_memory: allocated here
LVM2.2.03.36/lib/label/hints.c:1002:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/label/hints.c:1007:13: branch_false: ...to here
LVM2.2.03.36/lib/label/hints.c:1128:12: branch_true: following ‘true’ branch (when ‘newhints == 1’)...
LVM2.2.03.36/lib/label/hints.c:1129:17: branch_true: ...to here
LVM2.2.03.36/lib/label/hints.c:1129:17: call_function: calling ‘_unlink_newhints’ from ‘write_hint_file’
#  280|   {
#  281|   	if (unlink(_newhints_file))
#  282|-> 		log_debug("unlink_newhints errno %d %s", errno, _newhints_file);
#  283|   }
#  284|   

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

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

Error: GCC_ANALYZER_WARNING (CWE-775): [#def375]
LVM2.2.03.36/lib/label/hints.c:302:17: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(&_hints_file, "w")’
LVM2.2.03.36/lib/label/hints.c:1184:6: enter_function: entry to ‘clear_hint_file’
LVM2.2.03.36/lib/label/hints.c:1187:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/label/hints.c:1190:9: branch_false: ...to here
LVM2.2.03.36/lib/label/hints.c:1207:14: call_function: calling ‘_clear_hints’ from ‘clear_hint_file’
#  300|   
#  301|   	if (fflush(fp))
#  302|-> 		log_debug("clear_hints flush errno %d %s", errno, _hints_file);
#  303|   
#  304|   	if (fclose(fp))

Error: GCC_ANALYZER_WARNING (CWE-401): [#def376]
LVM2.2.03.36/lib/label/hints.c:302:17: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(&_hints_file, "w")’
LVM2.2.03.36/lib/label/hints.c:1184:6: enter_function: entry to ‘clear_hint_file’
LVM2.2.03.36/lib/label/hints.c:1187:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/label/hints.c:1190:9: branch_false: ...to here
LVM2.2.03.36/lib/label/hints.c:1207:14: call_function: calling ‘_clear_hints’ from ‘clear_hint_file’
#  300|   
#  301|   	if (fflush(fp))
#  302|-> 		log_debug("clear_hints flush errno %d %s", errno, _hints_file);
#  303|   
#  304|   	if (fclose(fp))

Error: GCC_ANALYZER_WARNING (CWE-775): [#def377]
LVM2.2.03.36/lib/label/hints.c:437:13: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(&_hints_file, "w")’
LVM2.2.03.36/lib/label/hints.c:963:5: enter_function: entry to ‘write_hint_file’
LVM2.2.03.36/lib/label/hints.c:981:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/label/hints.c:985:13: branch_false: ...to here
LVM2.2.03.36/lib/label/hints.c:996:20: branch_false: following ‘false’ branch (when ‘newhints != 4’)...
LVM2.2.03.36/lib/label/hints.c:1000:9: branch_false: ...to here
LVM2.2.03.36/lib/label/hints.c:1002:20: acquire_resource: opened here
LVM2.2.03.36/lib/label/hints.c:1002:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/label/hints.c:1007:13: branch_false: ...to here
LVM2.2.03.36/lib/label/hints.c:1009:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/label/hints.c:1024:9: branch_false: following ‘false’ branch...
 branch_false: ...to here
LVM2.2.03.36/lib/label/hints.c:1028:9: branch_false: following ‘false’ branch...
 branch_false: ...to here
LVM2.2.03.36/lib/label/hints.c:1051:12: branch_false: following ‘false’ branch...
 branch_false: ...to here
LVM2.2.03.36/lib/label/hints.c:1062:16: branch_true: following ‘true’ branch...
LVM2.2.03.36/lib/label/hints.c:1063:21: branch_true: ...to here
LVM2.2.03.36/lib/label/hints.c:1066:22: call_function: calling ‘_dev_in_hint_hash’ from ‘write_hint_file’
#  435|   	uint64_t devsize = 0;
#  436|   
#  437|-> 	if (dm_list_empty(&dev->aliases))
#  438|   		return 0;
#  439|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def378]
LVM2.2.03.36/lib/label/hints.c:437:13: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(&_hints_file, "w")’
LVM2.2.03.36/lib/label/hints.c:963:5: enter_function: entry to ‘write_hint_file’
LVM2.2.03.36/lib/label/hints.c:981:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/label/hints.c:985:13: branch_false: ...to here
LVM2.2.03.36/lib/label/hints.c:996:20: branch_false: following ‘false’ branch (when ‘newhints != 4’)...
LVM2.2.03.36/lib/label/hints.c:1000:9: branch_false: ...to here
LVM2.2.03.36/lib/label/hints.c:1002:20: acquire_memory: allocated here
LVM2.2.03.36/lib/label/hints.c:1002:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/label/hints.c:1007:13: branch_false: ...to here
LVM2.2.03.36/lib/label/hints.c:1009:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/label/hints.c:1024:9: branch_false: following ‘false’ branch...
 branch_false: ...to here
LVM2.2.03.36/lib/label/hints.c:1028:9: branch_false: following ‘false’ branch...
 branch_false: ...to here
LVM2.2.03.36/lib/label/hints.c:1051:12: branch_false: following ‘false’ branch...
 branch_false: ...to here
LVM2.2.03.36/lib/label/hints.c:1062:16: branch_true: following ‘true’ branch...
LVM2.2.03.36/lib/label/hints.c:1063:21: branch_true: ...to here
LVM2.2.03.36/lib/label/hints.c:1066:22: call_function: calling ‘_dev_in_hint_hash’ from ‘write_hint_file’
#  435|   	uint64_t devsize = 0;
#  436|   
#  437|-> 	if (dm_list_empty(&dev->aliases))
#  438|   		return 0;
#  439|   

Error: GCC_ANALYZER_WARNING (CWE-775): [#def379]
LVM2.2.03.36/lib/label/hints.c:440:14: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(&_hints_file, "w")’
LVM2.2.03.36/lib/label/hints.c:963:5: enter_function: entry to ‘write_hint_file’
LVM2.2.03.36/lib/label/hints.c:981:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/label/hints.c:985:13: branch_false: ...to here
LVM2.2.03.36/lib/label/hints.c:996:20: branch_false: following ‘false’ branch (when ‘newhints != 4’)...
LVM2.2.03.36/lib/label/hints.c:1000:9: branch_false: ...to here
LVM2.2.03.36/lib/label/hints.c:1002:20: acquire_resource: opened here
LVM2.2.03.36/lib/label/hints.c:1002:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/label/hints.c:1007:13: branch_false: ...to here
LVM2.2.03.36/lib/label/hints.c:1009:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/label/hints.c:1024:9: branch_false: following ‘false’ branch...
 branch_false: ...to here
LVM2.2.03.36/lib/label/hints.c:1028:9: branch_false: following ‘false’ branch...
 branch_false: ...to here
LVM2.2.03.36/lib/label/hints.c:1051:12: branch_false: following ‘false’ branch...
 branch_false: ...to here
LVM2.2.03.36/lib/label/hints.c:1062:16: branch_true: following ‘true’ branch...
LVM2.2.03.36/lib/label/hints.c:1063:21: branch_true: ...to here
LVM2.2.03.36/lib/label/hints.c:1066:22: call_function: calling ‘_dev_in_hint_hash’ from ‘write_hint_file’
#  438|   		return 0;
#  439|   
#  440|-> 	if (!cmd->filter->passes_filter(cmd, cmd->filter, dev, "regex"))
#  441|   		return 0;
#  442|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def380]
LVM2.2.03.36/lib/label/hints.c:440:14: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(&_hints_file, "w")’
LVM2.2.03.36/lib/label/hints.c:963:5: enter_function: entry to ‘write_hint_file’
LVM2.2.03.36/lib/label/hints.c:981:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/label/hints.c:985:13: branch_false: ...to here
LVM2.2.03.36/lib/label/hints.c:996:20: branch_false: following ‘false’ branch (when ‘newhints != 4’)...
LVM2.2.03.36/lib/label/hints.c:1000:9: branch_false: ...to here
LVM2.2.03.36/lib/label/hints.c:1002:20: acquire_memory: allocated here
LVM2.2.03.36/lib/label/hints.c:1002:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/label/hints.c:1007:13: branch_false: ...to here
LVM2.2.03.36/lib/label/hints.c:1009:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/label/hints.c:1024:9: branch_false: following ‘false’ branch...
 branch_false: ...to here
LVM2.2.03.36/lib/label/hints.c:1028:9: branch_false: following ‘false’ branch...
 branch_false: ...to here
LVM2.2.03.36/lib/label/hints.c:1051:12: branch_false: following ‘false’ branch...
 branch_false: ...to here
LVM2.2.03.36/lib/label/hints.c:1062:16: branch_true: following ‘true’ branch...
LVM2.2.03.36/lib/label/hints.c:1063:21: branch_true: ...to here
LVM2.2.03.36/lib/label/hints.c:1066:22: call_function: calling ‘_dev_in_hint_hash’ from ‘write_hint_file’
#  438|   		return 0;
#  439|   
#  440|-> 	if (!cmd->filter->passes_filter(cmd, cmd->filter, dev, "regex"))
#  441|   		return 0;
#  442|   

Error: GCC_ANALYZER_WARNING (CWE-775): [#def381]
LVM2.2.03.36/lib/label/hints.c:443:14: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(&_hints_file, "w")’
LVM2.2.03.36/lib/label/hints.c:963:5: enter_function: entry to ‘write_hint_file’
LVM2.2.03.36/lib/label/hints.c:981:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/label/hints.c:985:13: branch_false: ...to here
LVM2.2.03.36/lib/label/hints.c:996:20: branch_false: following ‘false’ branch (when ‘newhints != 4’)...
LVM2.2.03.36/lib/label/hints.c:1000:9: branch_false: ...to here
LVM2.2.03.36/lib/label/hints.c:1002:20: acquire_resource: opened here
LVM2.2.03.36/lib/label/hints.c:1002:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/label/hints.c:1007:13: branch_false: ...to here
LVM2.2.03.36/lib/label/hints.c:1009:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/label/hints.c:1024:9: branch_false: following ‘false’ branch...
 branch_false: ...to here
LVM2.2.03.36/lib/label/hints.c:1028:9: branch_false: following ‘false’ branch...
 branch_false: ...to here
LVM2.2.03.36/lib/label/hints.c:1051:12: branch_false: following ‘false’ branch...
 branch_false: ...to here
LVM2.2.03.36/lib/label/hints.c:1062:16: branch_true: following ‘true’ branch...
LVM2.2.03.36/lib/label/hints.c:1063:21: branch_true: ...to here
LVM2.2.03.36/lib/label/hints.c:1066:22: call_function: calling ‘_dev_in_hint_hash’ from ‘write_hint_file’
#  441|   		return 0;
#  442|   
#  443|-> 	if (!cmd->filter->passes_filter(cmd, cmd->filter, dev, "type"))
#  444|   		return 0;
#  445|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def382]
LVM2.2.03.36/lib/label/hints.c:443:14: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(&_hints_file, "w")’
LVM2.2.03.36/lib/label/hints.c:963:5: enter_function: entry to ‘write_hint_file’
LVM2.2.03.36/lib/label/hints.c:981:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/label/hints.c:985:13: branch_false: ...to here
LVM2.2.03.36/lib/label/hints.c:996:20: branch_false: following ‘false’ branch (when ‘newhints != 4’)...
LVM2.2.03.36/lib/label/hints.c:1000:9: branch_false: ...to here
LVM2.2.03.36/lib/label/hints.c:1002:20: acquire_memory: allocated here
LVM2.2.03.36/lib/label/hints.c:1002:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/label/hints.c:1007:13: branch_false: ...to here
LVM2.2.03.36/lib/label/hints.c:1009:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/label/hints.c:1024:9: branch_false: following ‘false’ branch...
 branch_false: ...to here
LVM2.2.03.36/lib/label/hints.c:1028:9: branch_false: following ‘false’ branch...
 branch_false: ...to here
LVM2.2.03.36/lib/label/hints.c:1051:12: branch_false: following ‘false’ branch...
 branch_false: ...to here
LVM2.2.03.36/lib/label/hints.c:1062:16: branch_true: following ‘true’ branch...
LVM2.2.03.36/lib/label/hints.c:1063:21: branch_true: ...to here
LVM2.2.03.36/lib/label/hints.c:1066:22: call_function: calling ‘_dev_in_hint_hash’ from ‘write_hint_file’
#  441|   		return 0;
#  442|   
#  443|-> 	if (!cmd->filter->passes_filter(cmd, cmd->filter, dev, "type"))
#  444|   		return 0;
#  445|   

Error: GCC_ANALYZER_WARNING (CWE-775): [#def383]
LVM2.2.03.36/lib/label/hints.c:447:31: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(&_hints_file, "w")’
LVM2.2.03.36/lib/label/hints.c:963:5: enter_function: entry to ‘write_hint_file’
LVM2.2.03.36/lib/label/hints.c:981:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/label/hints.c:985:13: branch_false: ...to here
LVM2.2.03.36/lib/label/hints.c:996:20: branch_false: following ‘false’ branch (when ‘newhints != 4’)...
LVM2.2.03.36/lib/label/hints.c:1000:9: branch_false: ...to here
LVM2.2.03.36/lib/label/hints.c:1002:20: acquire_resource: opened here
LVM2.2.03.36/lib/label/hints.c:1002:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/label/hints.c:1007:13: branch_false: ...to here
LVM2.2.03.36/lib/label/hints.c:1009:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/label/hints.c:1024:9: branch_false: following ‘false’ branch...
 branch_false: ...to here
LVM2.2.03.36/lib/label/hints.c:1028:9: branch_false: following ‘false’ branch...
 branch_false: ...to here
LVM2.2.03.36/lib/label/hints.c:1051:12: branch_false: following ‘false’ branch...
 branch_false: ...to here
LVM2.2.03.36/lib/label/hints.c:1062:16: branch_true: following ‘true’ branch...
LVM2.2.03.36/lib/label/hints.c:1063:21: branch_true: ...to here
LVM2.2.03.36/lib/label/hints.c:1066:22: call_function: calling ‘_dev_in_hint_hash’ from ‘write_hint_file’
#  445|   
#  446|   	/* exclude LVs from hint accounting when scan_lvs is 0 */
#  447|-> 	if (!cmd->scan_lvs && dm_is_dm_major(MAJOR(dev->dev)) && dev_is_lv(cmd, dev))
#  448|   		return 0;
#  449|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def384]
LVM2.2.03.36/lib/label/hints.c:447:31: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(&_hints_file, "w")’
LVM2.2.03.36/lib/label/hints.c:963:5: enter_function: entry to ‘write_hint_file’
LVM2.2.03.36/lib/label/hints.c:981:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/label/hints.c:985:13: branch_false: ...to here
LVM2.2.03.36/lib/label/hints.c:996:20: branch_false: following ‘false’ branch (when ‘newhints != 4’)...
LVM2.2.03.36/lib/label/hints.c:1000:9: branch_false: ...to here
LVM2.2.03.36/lib/label/hints.c:1002:20: acquire_memory: allocated here
LVM2.2.03.36/lib/label/hints.c:1002:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/label/hints.c:1007:13: branch_false: ...to here
LVM2.2.03.36/lib/label/hints.c:1009:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/label/hints.c:1024:9: branch_false: following ‘false’ branch...
 branch_false: ...to here
LVM2.2.03.36/lib/label/hints.c:1028:9: branch_false: following ‘false’ branch...
 branch_false: ...to here
LVM2.2.03.36/lib/label/hints.c:1051:12: branch_false: following ‘false’ branch...
 branch_false: ...to here
LVM2.2.03.36/lib/label/hints.c:1062:16: branch_true: following ‘true’ branch...
LVM2.2.03.36/lib/label/hints.c:1063:21: branch_true: ...to here
LVM2.2.03.36/lib/label/hints.c:1066:22: call_function: calling ‘_dev_in_hint_hash’ from ‘write_hint_file’
#  445|   
#  446|   	/* exclude LVs from hint accounting when scan_lvs is 0 */
#  447|-> 	if (!cmd->scan_lvs && dm_is_dm_major(MAJOR(dev->dev)) && dev_is_lv(cmd, dev))
#  448|   		return 0;
#  449|   

Error: GCC_ANALYZER_WARNING (CWE-775): [#def385]
LVM2.2.03.36/lib/label/hints.c:447:66: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(&_hints_file, "w")’
LVM2.2.03.36/lib/label/hints.c:963:5: enter_function: entry to ‘write_hint_file’
LVM2.2.03.36/lib/label/hints.c:981:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/label/hints.c:985:13: branch_false: ...to here
LVM2.2.03.36/lib/label/hints.c:996:20: branch_false: following ‘false’ branch (when ‘newhints != 4’)...
LVM2.2.03.36/lib/label/hints.c:1000:9: branch_false: ...to here
LVM2.2.03.36/lib/label/hints.c:1002:20: acquire_resource: opened here
LVM2.2.03.36/lib/label/hints.c:1002:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/label/hints.c:1007:13: branch_false: ...to here
LVM2.2.03.36/lib/label/hints.c:1009:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/label/hints.c:1024:9: branch_false: following ‘false’ branch...
 branch_false: ...to here
LVM2.2.03.36/lib/label/hints.c:1028:9: branch_false: following ‘false’ branch...
 branch_false: ...to here
LVM2.2.03.36/lib/label/hints.c:1051:12: branch_false: following ‘false’ branch...
 branch_false: ...to here
LVM2.2.03.36/lib/label/hints.c:1062:16: branch_true: following ‘true’ branch...
LVM2.2.03.36/lib/label/hints.c:1063:21: branch_true: ...to here
LVM2.2.03.36/lib/label/hints.c:1066:22: call_function: calling ‘_dev_in_hint_hash’ from ‘write_hint_file’
#  445|   
#  446|   	/* exclude LVs from hint accounting when scan_lvs is 0 */
#  447|-> 	if (!cmd->scan_lvs && dm_is_dm_major(MAJOR(dev->dev)) && dev_is_lv(cmd, dev))
#  448|   		return 0;
#  449|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def386]
LVM2.2.03.36/lib/label/hints.c:447:66: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(&_hints_file, "w")’
LVM2.2.03.36/lib/label/hints.c:963:5: enter_function: entry to ‘write_hint_file’
LVM2.2.03.36/lib/label/hints.c:981:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/label/hints.c:985:13: branch_false: ...to here
LVM2.2.03.36/lib/label/hints.c:996:20: branch_false: following ‘false’ branch (when ‘newhints != 4’)...
LVM2.2.03.36/lib/label/hints.c:1000:9: branch_false: ...to here
LVM2.2.03.36/lib/label/hints.c:1002:20: acquire_memory: allocated here
LVM2.2.03.36/lib/label/hints.c:1002:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/label/hints.c:1007:13: branch_false: ...to here
LVM2.2.03.36/lib/label/hints.c:1009:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/label/hints.c:1024:9: branch_false: following ‘false’ branch...
 branch_false: ...to here
LVM2.2.03.36/lib/label/hints.c:1028:9: branch_false: following ‘false’ branch...
 branch_false: ...to here
LVM2.2.03.36/lib/label/hints.c:1051:12: branch_false: following ‘false’ branch...
 branch_false: ...to here
LVM2.2.03.36/lib/label/hints.c:1062:16: branch_true: following ‘true’ branch...
LVM2.2.03.36/lib/label/hints.c:1063:21: branch_true: ...to here
LVM2.2.03.36/lib/label/hints.c:1066:22: call_function: calling ‘_dev_in_hint_hash’ from ‘write_hint_file’
#  445|   
#  446|   	/* exclude LVs from hint accounting when scan_lvs is 0 */
#  447|-> 	if (!cmd->scan_lvs && dm_is_dm_major(MAJOR(dev->dev)) && dev_is_lv(cmd, dev))
#  448|   		return 0;
#  449|   

Error: GCC_ANALYZER_WARNING (CWE-775): [#def387]
LVM2.2.03.36/lib/label/hints.c:450:14: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(&_hints_file, "w")’
LVM2.2.03.36/lib/label/hints.c:963:5: enter_function: entry to ‘write_hint_file’
LVM2.2.03.36/lib/label/hints.c:981:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/label/hints.c:985:13: branch_false: ...to here
LVM2.2.03.36/lib/label/hints.c:996:20: branch_false: following ‘false’ branch (when ‘newhints != 4’)...
LVM2.2.03.36/lib/label/hints.c:1000:9: branch_false: ...to here
LVM2.2.03.36/lib/label/hints.c:1002:20: acquire_resource: opened here
LVM2.2.03.36/lib/label/hints.c:1002:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/label/hints.c:1007:13: branch_false: ...to here
LVM2.2.03.36/lib/label/hints.c:1009:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/label/hints.c:1024:9: branch_false: following ‘false’ branch...
 branch_false: ...to here
LVM2.2.03.36/lib/label/hints.c:1028:9: branch_false: following ‘false’ branch...
 branch_false: ...to here
LVM2.2.03.36/lib/label/hints.c:1051:12: branch_false: following ‘false’ branch...
 branch_false: ...to here
LVM2.2.03.36/lib/label/hints.c:1062:16: branch_true: following ‘true’ branch...
LVM2.2.03.36/lib/label/hints.c:1063:21: branch_true: ...to here
LVM2.2.03.36/lib/label/hints.c:1066:22: call_function: calling ‘_dev_in_hint_hash’ from ‘write_hint_file’
#  448|   		return 0;
#  449|   
#  450|-> 	if (!dev_get_size(dev, &devsize) || !devsize)
#  451|   		return 0;
#  452|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def388]
LVM2.2.03.36/lib/label/hints.c:450:14: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(&_hints_file, "w")’
LVM2.2.03.36/lib/label/hints.c:963:5: enter_function: entry to ‘write_hint_file’
LVM2.2.03.36/lib/label/hints.c:981:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/label/hints.c:985:13: branch_false: ...to here
LVM2.2.03.36/lib/label/hints.c:996:20: branch_false: following ‘false’ branch (when ‘newhints != 4’)...
LVM2.2.03.36/lib/label/hints.c:1000:9: branch_false: ...to here
LVM2.2.03.36/lib/label/hints.c:1002:20: acquire_memory: allocated here
LVM2.2.03.36/lib/label/hints.c:1002:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/label/hints.c:1007:13: branch_false: ...to here
LVM2.2.03.36/lib/label/hints.c:1009:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/label/hints.c:1024:9: branch_false: following ‘false’ branch...
 branch_false: ...to here
LVM2.2.03.36/lib/label/hints.c:1028:9: branch_false: following ‘false’ branch...
 branch_false: ...to here
LVM2.2.03.36/lib/label/hints.c:1051:12: branch_false: following ‘false’ branch...
 branch_false: ...to here
LVM2.2.03.36/lib/label/hints.c:1062:16: branch_true: following ‘true’ branch...
LVM2.2.03.36/lib/label/hints.c:1063:21: branch_true: ...to here
LVM2.2.03.36/lib/label/hints.c:1066:22: call_function: calling ‘_dev_in_hint_hash’ from ‘write_hint_file’
#  448|   		return 0;
#  449|   
#  450|-> 	if (!dev_get_size(dev, &devsize) || !devsize)
#  451|   		return 0;
#  452|   

Error: GCC_ANALYZER_WARNING (CWE-775): [#def389]
LVM2.2.03.36/lib/label/hints.c:648:20: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(&_hints_file, "r")’
LVM2.2.03.36/lib/label/hints.c:691:12: enter_function: entry to ‘_read_hint_file’
LVM2.2.03.36/lib/label/hints.c:713:20: acquire_resource: opened here
LVM2.2.03.36/lib/label/hints.c:713:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/label/hints.c:716:9: branch_false: ...to here
LVM2.2.03.36/lib/label/hints.c:718:21: branch_true: following ‘true’ branch (when ‘i != 4’)...
LVM2.2.03.36/lib/label/hints.c:719:17: branch_true: ...to here
LVM2.2.03.36/lib/label/hints.c:721:16: branch_true: following ‘true’ branch...
LVM2.2.03.36/lib/label/hints.c:722:17: branch_true: ...to here
LVM2.2.03.36/lib/label/hints.c:723:20: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/label/hints.c:726:26: branch_false: ...to here
LVM2.2.03.36/lib/label/hints.c:726:20: branch_false: following ‘false’ branch (when ‘p’ is NULL)...
LVM2.2.03.36/lib/label/hints.c:740:22: branch_false: ...to here
LVM2.2.03.36/lib/label/hints.c:740:20: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/label/hints.c:757:22: branch_false: ...to here
LVM2.2.03.36/lib/label/hints.c:757:20: branch_true: following ‘true’ branch...
LVM2.2.03.36/lib/label/hints.c:758:25: branch_true: ...to here
LVM2.2.03.36/lib/label/hints.c:758:25: call_function: calling ‘_filter_to_str’ from ‘_read_hint_file’
#  646|   	*strp = NULL;
#  647|   
#  648|-> 	if (!(cn = find_config_tree_array(cmd, filter_cfg, NULL))) {
#  649|   		/* shouldn't happen because default is a|*| */
#  650|   		return;

Error: GCC_ANALYZER_WARNING (CWE-775): [#def390]
LVM2.2.03.36/lib/label/hints.c:648:20: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(&_hints_file, "w")’
LVM2.2.03.36/lib/label/hints.c:963:5: enter_function: entry to ‘write_hint_file’
LVM2.2.03.36/lib/label/hints.c:981:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/label/hints.c:985:13: branch_false: ...to here
LVM2.2.03.36/lib/label/hints.c:996:20: branch_false: following ‘false’ branch (when ‘newhints != 4’)...
LVM2.2.03.36/lib/label/hints.c:1000:9: branch_false: ...to here
LVM2.2.03.36/lib/label/hints.c:1002:20: acquire_resource: opened here
LVM2.2.03.36/lib/label/hints.c:1002:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/label/hints.c:1007:13: branch_false: ...to here
LVM2.2.03.36/lib/label/hints.c:1009:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/label/hints.c:1023:9: call_function: calling ‘_filter_to_str’ from ‘write_hint_file’
#  646|   	*strp = NULL;
#  647|   
#  648|-> 	if (!(cn = find_config_tree_array(cmd, filter_cfg, NULL))) {
#  649|   		/* shouldn't happen because default is a|*| */
#  650|   		return;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def391]
LVM2.2.03.36/lib/label/hints.c:648:20: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(&_hints_file, "r")’
LVM2.2.03.36/lib/label/hints.c:691:12: enter_function: entry to ‘_read_hint_file’
LVM2.2.03.36/lib/label/hints.c:713:20: acquire_memory: allocated here
LVM2.2.03.36/lib/label/hints.c:713:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/label/hints.c:716:9: branch_false: ...to here
LVM2.2.03.36/lib/label/hints.c:718:21: branch_true: following ‘true’ branch (when ‘i != 4’)...
LVM2.2.03.36/lib/label/hints.c:719:17: branch_true: ...to here
LVM2.2.03.36/lib/label/hints.c:721:16: branch_true: following ‘true’ branch...
LVM2.2.03.36/lib/label/hints.c:722:17: branch_true: ...to here
LVM2.2.03.36/lib/label/hints.c:723:20: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/label/hints.c:726:26: branch_false: ...to here
LVM2.2.03.36/lib/label/hints.c:726:20: branch_false: following ‘false’ branch (when ‘p’ is NULL)...
LVM2.2.03.36/lib/label/hints.c:740:22: branch_false: ...to here
LVM2.2.03.36/lib/label/hints.c:740:20: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/label/hints.c:757:22: branch_false: ...to here
LVM2.2.03.36/lib/label/hints.c:757:20: branch_true: following ‘true’ branch...
LVM2.2.03.36/lib/label/hints.c:758:25: branch_true: ...to here
LVM2.2.03.36/lib/label/hints.c:758:25: call_function: calling ‘_filter_to_str’ from ‘_read_hint_file’
#  646|   	*strp = NULL;
#  647|   
#  648|-> 	if (!(cn = find_config_tree_array(cmd, filter_cfg, NULL))) {
#  649|   		/* shouldn't happen because default is a|*| */
#  650|   		return;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def392]
LVM2.2.03.36/lib/label/hints.c:648:20: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(&_hints_file, "w")’
LVM2.2.03.36/lib/label/hints.c:963:5: enter_function: entry to ‘write_hint_file’
LVM2.2.03.36/lib/label/hints.c:981:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/label/hints.c:985:13: branch_false: ...to here
LVM2.2.03.36/lib/label/hints.c:996:20: branch_false: following ‘false’ branch (when ‘newhints != 4’)...
LVM2.2.03.36/lib/label/hints.c:1000:9: branch_false: ...to here
LVM2.2.03.36/lib/label/hints.c:1002:20: acquire_memory: allocated here
LVM2.2.03.36/lib/label/hints.c:1002:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/label/hints.c:1007:13: branch_false: ...to here
LVM2.2.03.36/lib/label/hints.c:1009:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/label/hints.c:1023:9: call_function: calling ‘_filter_to_str’ from ‘write_hint_file’
#  646|   	*strp = NULL;
#  647|   
#  648|-> 	if (!(cn = find_config_tree_array(cmd, filter_cfg, NULL))) {
#  649|   		/* shouldn't happen because default is a|*| */
#  650|   		return;

Error: GCC_ANALYZER_WARNING (CWE-775): [#def393]
LVM2.2.03.36/lib/label/hints.c:716:9: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(&_hints_file, "r")’
LVM2.2.03.36/lib/label/hints.c:713:20: acquire_resource: opened here
LVM2.2.03.36/lib/label/hints.c:713:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/label/hints.c:716:9: branch_false: ...to here
LVM2.2.03.36/lib/label/hints.c:716:9: danger: ‘fopen(&_hints_file, "r")’ leaks here; was opened at [(1)](sarif:/runs/0/results/28/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): [#def394]
LVM2.2.03.36/lib/label/hints.c:716:9: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(&_hints_file, "r")’
LVM2.2.03.36/lib/label/hints.c:713:20: acquire_memory: allocated here
LVM2.2.03.36/lib/label/hints.c:713:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/label/hints.c:716:9: branch_false: ...to here
LVM2.2.03.36/lib/label/hints.c:716:9: danger: ‘fopen(&_hints_file, "r")’ leaks here; was allocated at [(1)](sarif:/runs/0/results/29/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): [#def395]
LVM2.2.03.36/lib/label/hints.c:742:33: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(&_hints_file, "r")’
LVM2.2.03.36/lib/label/hints.c:713:20: acquire_resource: opened here
LVM2.2.03.36/lib/label/hints.c:713:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/label/hints.c:716:9: branch_false: ...to here
LVM2.2.03.36/lib/label/hints.c:718:21: branch_true: following ‘true’ branch (when ‘i != 4’)...
LVM2.2.03.36/lib/label/hints.c:719:17: branch_true: ...to here
LVM2.2.03.36/lib/label/hints.c:721:16: branch_true: following ‘true’ branch...
LVM2.2.03.36/lib/label/hints.c:722:17: branch_true: ...to here
LVM2.2.03.36/lib/label/hints.c:723:20: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/label/hints.c:726:26: branch_false: ...to here
LVM2.2.03.36/lib/label/hints.c:726:20: branch_false: following ‘false’ branch (when ‘p’ is NULL)...
LVM2.2.03.36/lib/label/hints.c:740:22: branch_false: ...to here
LVM2.2.03.36/lib/label/hints.c:740:20: branch_true: following ‘true’ branch...
LVM2.2.03.36/lib/label/hints.c:741:29: branch_true: ...to here
LVM2.2.03.36/lib/label/hints.c:741:28: branch_true: following ‘true’ branch...
LVM2.2.03.36/lib/label/hints.c:742:33: branch_true: ...to here
LVM2.2.03.36/lib/label/hints.c:742:33: danger: ‘fopen(&_hints_file, "r")’ leaks here; was opened at [(1)](sarif:/runs/0/results/30/codeFlows/0/threadFlows/0/locations/0)
#  740|   		if (!strncmp(_hint_line, "hints_version:", keylen)) {
#  741|   			if (sscanf(_hint_line + keylen, "%d.%d", &hv_major, &hv_minor) != 2) {
#  742|-> 				log_debug("ignore hints with unknown version %d.%d", hv_major, hv_minor);
#  743|   				*needs_refresh = 1;
#  744|   				break;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def396]
LVM2.2.03.36/lib/label/hints.c:742:33: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(&_hints_file, "r")’
LVM2.2.03.36/lib/label/hints.c:713:20: acquire_memory: allocated here
LVM2.2.03.36/lib/label/hints.c:713:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/label/hints.c:716:9: branch_false: ...to here
LVM2.2.03.36/lib/label/hints.c:718:21: branch_true: following ‘true’ branch (when ‘i != 4’)...
LVM2.2.03.36/lib/label/hints.c:719:17: branch_true: ...to here
LVM2.2.03.36/lib/label/hints.c:721:16: branch_true: following ‘true’ branch...
LVM2.2.03.36/lib/label/hints.c:722:17: branch_true: ...to here
LVM2.2.03.36/lib/label/hints.c:723:20: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/label/hints.c:726:26: branch_false: ...to here
LVM2.2.03.36/lib/label/hints.c:726:20: branch_false: following ‘false’ branch (when ‘p’ is NULL)...
LVM2.2.03.36/lib/label/hints.c:740:22: branch_false: ...to here
LVM2.2.03.36/lib/label/hints.c:740:20: branch_true: following ‘true’ branch...
LVM2.2.03.36/lib/label/hints.c:741:29: branch_true: ...to here
LVM2.2.03.36/lib/label/hints.c:741:28: branch_true: following ‘true’ branch...
LVM2.2.03.36/lib/label/hints.c:742:33: branch_true: ...to here
LVM2.2.03.36/lib/label/hints.c:742:33: danger: ‘fopen(&_hints_file, "r")’ leaks here; was allocated at [(1)](sarif:/runs/0/results/31/codeFlows/0/threadFlows/0/locations/0)
#  740|   		if (!strncmp(_hint_line, "hints_version:", keylen)) {
#  741|   			if (sscanf(_hint_line + keylen, "%d.%d", &hv_major, &hv_minor) != 2) {
#  742|-> 				log_debug("ignore hints with unknown version %d.%d", hv_major, hv_minor);
#  743|   				*needs_refresh = 1;
#  744|   				break;

Error: GCC_ANALYZER_WARNING (CWE-775): [#def397]
LVM2.2.03.36/lib/label/hints.c:748:33: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(&_hints_file, "r")’
LVM2.2.03.36/lib/label/hints.c:713:20: acquire_resource: opened here
LVM2.2.03.36/lib/label/hints.c:713:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/label/hints.c:716:9: branch_false: ...to here
LVM2.2.03.36/lib/label/hints.c:718:21: branch_true: following ‘true’ branch (when ‘i != 4’)...
LVM2.2.03.36/lib/label/hints.c:719:17: branch_true: ...to here
LVM2.2.03.36/lib/label/hints.c:721:16: branch_true: following ‘true’ branch...
LVM2.2.03.36/lib/label/hints.c:722:17: branch_true: ...to here
LVM2.2.03.36/lib/label/hints.c:723:20: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/label/hints.c:726:26: branch_false: ...to here
LVM2.2.03.36/lib/label/hints.c:726:20: branch_false: following ‘false’ branch (when ‘p’ is NULL)...
LVM2.2.03.36/lib/label/hints.c:740:22: branch_false: ...to here
LVM2.2.03.36/lib/label/hints.c:740:20: branch_true: following ‘true’ branch...
LVM2.2.03.36/lib/label/hints.c:741:29: branch_true: ...to here
LVM2.2.03.36/lib/label/hints.c:741:28: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/label/hints.c:747:29: branch_false: ...to here
LVM2.2.03.36/lib/label/hints.c:747:28: branch_true: following ‘true’ branch...
LVM2.2.03.36/lib/label/hints.c:748:33: branch_true: ...to here
LVM2.2.03.36/lib/label/hints.c:748:33: danger: ‘fopen(&_hints_file, "r")’ leaks here; was opened at [(1)](sarif:/runs/0/results/32/codeFlows/0/threadFlows/0/locations/0)
#  746|   
#  747|   			if (hv_major != HINTS_VERSION_MAJOR) {
#  748|-> 				log_debug("ignore hints with version %d.%d current %d.%d",
#  749|   					  hv_major, hv_minor, HINTS_VERSION_MAJOR, HINTS_VERSION_MINOR);
#  750|   				*needs_refresh = 1;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def398]
LVM2.2.03.36/lib/label/hints.c:748:33: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(&_hints_file, "r")’
LVM2.2.03.36/lib/label/hints.c:713:20: acquire_memory: allocated here
LVM2.2.03.36/lib/label/hints.c:713:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/label/hints.c:716:9: branch_false: ...to here
LVM2.2.03.36/lib/label/hints.c:718:21: branch_true: following ‘true’ branch (when ‘i != 4’)...
LVM2.2.03.36/lib/label/hints.c:719:17: branch_true: ...to here
LVM2.2.03.36/lib/label/hints.c:721:16: branch_true: following ‘true’ branch...
LVM2.2.03.36/lib/label/hints.c:722:17: branch_true: ...to here
LVM2.2.03.36/lib/label/hints.c:723:20: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/label/hints.c:726:26: branch_false: ...to here
LVM2.2.03.36/lib/label/hints.c:726:20: branch_false: following ‘false’ branch (when ‘p’ is NULL)...
LVM2.2.03.36/lib/label/hints.c:740:22: branch_false: ...to here
LVM2.2.03.36/lib/label/hints.c:740:20: branch_true: following ‘true’ branch...
LVM2.2.03.36/lib/label/hints.c:741:29: branch_true: ...to here
LVM2.2.03.36/lib/label/hints.c:741:28: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/label/hints.c:747:29: branch_false: ...to here
LVM2.2.03.36/lib/label/hints.c:747:28: branch_true: following ‘true’ branch...
LVM2.2.03.36/lib/label/hints.c:748:33: branch_true: ...to here
LVM2.2.03.36/lib/label/hints.c:748:33: danger: ‘fopen(&_hints_file, "r")’ leaks here; was allocated at [(1)](sarif:/runs/0/results/33/codeFlows/0/threadFlows/0/locations/0)
#  746|   
#  747|   			if (hv_major != HINTS_VERSION_MAJOR) {
#  748|-> 				log_debug("ignore hints with version %d.%d current %d.%d",
#  749|   					  hv_major, hv_minor, HINTS_VERSION_MAJOR, HINTS_VERSION_MINOR);
#  750|   				*needs_refresh = 1;

Error: GCC_ANALYZER_WARNING (CWE-775): [#def399]
LVM2.2.03.36/lib/label/hints.c:760:33: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(&_hints_file, "r")’
LVM2.2.03.36/lib/label/hints.c:713:20: acquire_resource: opened here
LVM2.2.03.36/lib/label/hints.c:713:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/label/hints.c:716:9: branch_false: ...to here
LVM2.2.03.36/lib/label/hints.c:718:21: branch_true: following ‘true’ branch (when ‘i != 4’)...
LVM2.2.03.36/lib/label/hints.c:719:17: branch_true: ...to here
LVM2.2.03.36/lib/label/hints.c:721:16: branch_true: following ‘true’ branch...
LVM2.2.03.36/lib/label/hints.c:722:17: branch_true: ...to here
LVM2.2.03.36/lib/label/hints.c:723:20: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/label/hints.c:726:26: branch_false: ...to here
LVM2.2.03.36/lib/label/hints.c:726:20: branch_false: following ‘false’ branch (when ‘p’ is NULL)...
LVM2.2.03.36/lib/label/hints.c:740:22: branch_false: ...to here
LVM2.2.03.36/lib/label/hints.c:740:20: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/label/hints.c:757:22: branch_false: ...to here
LVM2.2.03.36/lib/label/hints.c:757:20: branch_true: following ‘true’ branch...
LVM2.2.03.36/lib/label/hints.c:758:25: branch_true: ...to here
LVM2.2.03.36/lib/label/hints.c:759:28: branch_true: following ‘true’ branch...
LVM2.2.03.36/lib/label/hints.c:760:33: branch_true: ...to here
LVM2.2.03.36/lib/label/hints.c:760:33: danger: ‘fopen(&_hints_file, "r")’ leaks here; was opened at [(1)](sarif:/runs/0/results/34/codeFlows/0/threadFlows/0/locations/0)
#  758|   			_filter_to_str(cmd, devices_global_filter_CFG, &filter_str);
#  759|   			if (!filter_str || strcmp(filter_str, _hint_line + keylen)) {
#  760|-> 				log_debug("ignore hints with different global_filter");
#  761|   				free(filter_str);
#  762|   				*needs_refresh = 1;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def400]
LVM2.2.03.36/lib/label/hints.c:760:33: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(&_hints_file, "r")’
LVM2.2.03.36/lib/label/hints.c:713:20: acquire_memory: allocated here
LVM2.2.03.36/lib/label/hints.c:713:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/label/hints.c:716:9: branch_false: ...to here
LVM2.2.03.36/lib/label/hints.c:718:21: branch_true: following ‘true’ branch (when ‘i != 4’)...
LVM2.2.03.36/lib/label/hints.c:719:17: branch_true: ...to here
LVM2.2.03.36/lib/label/hints.c:721:16: branch_true: following ‘true’ branch...
LVM2.2.03.36/lib/label/hints.c:722:17: branch_true: ...to here
LVM2.2.03.36/lib/label/hints.c:723:20: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/label/hints.c:726:26: branch_false: ...to here
LVM2.2.03.36/lib/label/hints.c:726:20: branch_false: following ‘false’ branch (when ‘p’ is NULL)...
LVM2.2.03.36/lib/label/hints.c:740:22: branch_false: ...to here
LVM2.2.03.36/lib/label/hints.c:740:20: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/label/hints.c:757:22: branch_false: ...to here
LVM2.2.03.36/lib/label/hints.c:757:20: branch_true: following ‘true’ branch...
LVM2.2.03.36/lib/label/hints.c:758:25: branch_true: ...to here
LVM2.2.03.36/lib/label/hints.c:759:28: branch_true: following ‘true’ branch...
LVM2.2.03.36/lib/label/hints.c:760:33: branch_true: ...to here
LVM2.2.03.36/lib/label/hints.c:760:33: danger: ‘fopen(&_hints_file, "r")’ leaks here; was allocated at [(1)](sarif:/runs/0/results/35/codeFlows/0/threadFlows/0/locations/0)
#  758|   			_filter_to_str(cmd, devices_global_filter_CFG, &filter_str);
#  759|   			if (!filter_str || strcmp(filter_str, _hint_line + keylen)) {
#  760|-> 				log_debug("ignore hints with different global_filter");
#  761|   				free(filter_str);
#  762|   				*needs_refresh = 1;

Error: GCC_ANALYZER_WARNING (CWE-775): [#def401]
LVM2.2.03.36/lib/label/hints.c:773:33: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(&_hints_file, "r")’
LVM2.2.03.36/lib/label/hints.c:713:20: acquire_resource: opened here
LVM2.2.03.36/lib/label/hints.c:713:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/label/hints.c:716:9: branch_false: ...to here
LVM2.2.03.36/lib/label/hints.c:718:21: branch_true: following ‘true’ branch (when ‘i != 4’)...
LVM2.2.03.36/lib/label/hints.c:719:17: branch_true: ...to here
LVM2.2.03.36/lib/label/hints.c:721:16: branch_true: following ‘true’ branch...
LVM2.2.03.36/lib/label/hints.c:722:17: branch_true: ...to here
LVM2.2.03.36/lib/label/hints.c:723:20: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/label/hints.c:726:26: branch_false: ...to here
LVM2.2.03.36/lib/label/hints.c:726:20: branch_false: following ‘false’ branch (when ‘p’ is NULL)...
LVM2.2.03.36/lib/label/hints.c:740:22: branch_false: ...to here
LVM2.2.03.36/lib/label/hints.c:740:20: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/label/hints.c:757:22: branch_false: ...to here
LVM2.2.03.36/lib/label/hints.c:757:20: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/label/hints.c:770:22: branch_false: ...to here
LVM2.2.03.36/lib/label/hints.c:770:20: branch_true: following ‘true’ branch...
LVM2.2.03.36/lib/label/hints.c:771:25: branch_true: ...to here
LVM2.2.03.36/lib/label/hints.c:772:28: branch_true: following ‘true’ branch...
LVM2.2.03.36/lib/label/hints.c:773:33: branch_true: ...to here
LVM2.2.03.36/lib/label/hints.c:773:33: danger: ‘fopen(&_hints_file, "r")’ leaks here; was opened at [(1)](sarif:/runs/0/results/36/codeFlows/0/threadFlows/0/locations/0)
#  771|   			_filter_to_str(cmd, devices_filter_CFG, &filter_str);
#  772|   			if (!filter_str || strcmp(filter_str, _hint_line + keylen)) {
#  773|-> 				log_debug("ignore hints with different filter");
#  774|   				free(filter_str);
#  775|   				*needs_refresh = 1;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def402]
LVM2.2.03.36/lib/label/hints.c:773:33: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(&_hints_file, "r")’
LVM2.2.03.36/lib/label/hints.c:713:20: acquire_memory: allocated here
LVM2.2.03.36/lib/label/hints.c:713:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/label/hints.c:716:9: branch_false: ...to here
LVM2.2.03.36/lib/label/hints.c:718:21: branch_true: following ‘true’ branch (when ‘i != 4’)...
LVM2.2.03.36/lib/label/hints.c:719:17: branch_true: ...to here
LVM2.2.03.36/lib/label/hints.c:721:16: branch_true: following ‘true’ branch...
LVM2.2.03.36/lib/label/hints.c:722:17: branch_true: ...to here
LVM2.2.03.36/lib/label/hints.c:723:20: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/label/hints.c:726:26: branch_false: ...to here
LVM2.2.03.36/lib/label/hints.c:726:20: branch_false: following ‘false’ branch (when ‘p’ is NULL)...
LVM2.2.03.36/lib/label/hints.c:740:22: branch_false: ...to here
LVM2.2.03.36/lib/label/hints.c:740:20: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/label/hints.c:757:22: branch_false: ...to here
LVM2.2.03.36/lib/label/hints.c:757:20: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/label/hints.c:770:22: branch_false: ...to here
LVM2.2.03.36/lib/label/hints.c:770:20: branch_true: following ‘true’ branch...
LVM2.2.03.36/lib/label/hints.c:771:25: branch_true: ...to here
LVM2.2.03.36/lib/label/hints.c:772:28: branch_true: following ‘true’ branch...
LVM2.2.03.36/lib/label/hints.c:773:33: branch_true: ...to here
LVM2.2.03.36/lib/label/hints.c:773:33: danger: ‘fopen(&_hints_file, "r")’ leaks here; was allocated at [(1)](sarif:/runs/0/results/37/codeFlows/0/threadFlows/0/locations/0)
#  771|   			_filter_to_str(cmd, devices_filter_CFG, &filter_str);
#  772|   			if (!filter_str || strcmp(filter_str, _hint_line + keylen)) {
#  773|-> 				log_debug("ignore hints with different filter");
#  774|   				free(filter_str);
#  775|   				*needs_refresh = 1;

Error: GCC_ANALYZER_WARNING (CWE-775): [#def403]
LVM2.2.03.36/lib/label/hints.c:787:33: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(&_hints_file, "r")’
LVM2.2.03.36/lib/label/hints.c:713:20: acquire_resource: opened here
LVM2.2.03.36/lib/label/hints.c:713:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/label/hints.c:716:9: branch_false: ...to here
LVM2.2.03.36/lib/label/hints.c:718:21: branch_true: following ‘true’ branch (when ‘i != 4’)...
LVM2.2.03.36/lib/label/hints.c:719:17: branch_true: ...to here
LVM2.2.03.36/lib/label/hints.c:721:16: branch_true: following ‘true’ branch...
LVM2.2.03.36/lib/label/hints.c:722:17: branch_true: ...to here
LVM2.2.03.36/lib/label/hints.c:723:20: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/label/hints.c:726:26: branch_false: ...to here
LVM2.2.03.36/lib/label/hints.c:726:20: branch_false: following ‘false’ branch (when ‘p’ is NULL)...
LVM2.2.03.36/lib/label/hints.c:740:22: branch_false: ...to here
LVM2.2.03.36/lib/label/hints.c:740:20: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/label/hints.c:757:22: branch_false: ...to here
LVM2.2.03.36/lib/label/hints.c:757:20: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/label/hints.c:770:22: branch_false: ...to here
LVM2.2.03.36/lib/label/hints.c:770:20: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/label/hints.c:783:22: branch_false: ...to here
LVM2.2.03.36/lib/label/hints.c:783:20: branch_true: following ‘true’ branch...
LVM2.2.03.36/lib/label/hints.c:784:34: branch_true: ...to here
LVM2.2.03.36/lib/label/hints.c:787:33: danger: ‘fopen(&_hints_file, "r")’ leaks here; was opened at [(1)](sarif:/runs/0/results/38/codeFlows/0/threadFlows/0/locations/0)
#  785|   			if ((sscanf(_hint_line + keylen, "%u", &scan_lvs) != 1) ||
#  786|   			    scan_lvs != cmd->scan_lvs) {
#  787|-> 				log_debug("ignore hints with different or unreadable scan_lvs");
#  788|   				*needs_refresh = 1;
#  789|   				break;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def404]
LVM2.2.03.36/lib/label/hints.c:787:33: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(&_hints_file, "r")’
LVM2.2.03.36/lib/label/hints.c:713:20: acquire_memory: allocated here
LVM2.2.03.36/lib/label/hints.c:713:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/label/hints.c:716:9: branch_false: ...to here
LVM2.2.03.36/lib/label/hints.c:718:21: branch_true: following ‘true’ branch (when ‘i != 4’)...
LVM2.2.03.36/lib/label/hints.c:719:17: branch_true: ...to here
LVM2.2.03.36/lib/label/hints.c:721:16: branch_true: following ‘true’ branch...
LVM2.2.03.36/lib/label/hints.c:722:17: branch_true: ...to here
LVM2.2.03.36/lib/label/hints.c:723:20: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/label/hints.c:726:26: branch_false: ...to here
LVM2.2.03.36/lib/label/hints.c:726:20: branch_false: following ‘false’ branch (when ‘p’ is NULL)...
LVM2.2.03.36/lib/label/hints.c:740:22: branch_false: ...to here
LVM2.2.03.36/lib/label/hints.c:740:20: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/label/hints.c:757:22: branch_false: ...to here
LVM2.2.03.36/lib/label/hints.c:757:20: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/label/hints.c:770:22: branch_false: ...to here
LVM2.2.03.36/lib/label/hints.c:770:20: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/label/hints.c:783:22: branch_false: ...to here
LVM2.2.03.36/lib/label/hints.c:783:20: branch_true: following ‘true’ branch...
LVM2.2.03.36/lib/label/hints.c:784:34: branch_true: ...to here
LVM2.2.03.36/lib/label/hints.c:787:33: danger: ‘fopen(&_hints_file, "r")’ leaks here; was allocated at [(1)](sarif:/runs/0/results/39/codeFlows/0/threadFlows/0/locations/0)
#  785|   			if ((sscanf(_hint_line + keylen, "%u", &scan_lvs) != 1) ||
#  786|   			    scan_lvs != cmd->scan_lvs) {
#  787|-> 				log_debug("ignore hints with different or unreadable scan_lvs");
#  788|   				*needs_refresh = 1;
#  789|   				break;

Error: GCC_ANALYZER_WARNING (CWE-775): [#def405]
LVM2.2.03.36/lib/label/hints.c:797:49: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(&_hints_file, "r")’
LVM2.2.03.36/lib/label/hints.c:713:20: acquire_resource: opened here
LVM2.2.03.36/lib/label/hints.c:713:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/label/hints.c:716:9: branch_false: ...to here
LVM2.2.03.36/lib/label/hints.c:718:21: branch_true: following ‘true’ branch (when ‘i != 4’)...
LVM2.2.03.36/lib/label/hints.c:719:17: branch_true: ...to here
LVM2.2.03.36/lib/label/hints.c:721:16: branch_true: following ‘true’ branch...
LVM2.2.03.36/lib/label/hints.c:722:17: branch_true: ...to here
LVM2.2.03.36/lib/label/hints.c:723:20: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/label/hints.c:726:26: branch_false: ...to here
LVM2.2.03.36/lib/label/hints.c:726:20: branch_false: following ‘false’ branch (when ‘p’ is NULL)...
LVM2.2.03.36/lib/label/hints.c:740:22: branch_false: ...to here
LVM2.2.03.36/lib/label/hints.c:740:20: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/label/hints.c:757:22: branch_false: ...to here
LVM2.2.03.36/lib/label/hints.c:757:20: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/label/hints.c:770:22: branch_false: ...to here
LVM2.2.03.36/lib/label/hints.c:770:20: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/label/hints.c:783:22: branch_false: ...to here
LVM2.2.03.36/lib/label/hints.c:783:20: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/label/hints.c:795:22: branch_false: ...to here
LVM2.2.03.36/lib/label/hints.c:795:20: branch_true: following ‘true’ branch...
LVM2.2.03.36/lib/label/hints.c:797:49: branch_true: ...to here
LVM2.2.03.36/lib/label/hints.c:797:49: danger: ‘fopen(&_hints_file, "r")’ leaks here; was opened at [(1)](sarif:/runs/0/results/40/codeFlows/0/threadFlows/0/locations/0)
#  795|   		if (!strncmp(_hint_line, "devices_file:", keylen)) {
#  796|   			const char *df_hint = _hint_line + keylen;
#  797|-> 			const char *df_config = find_config_tree_str(cmd, devices_devicesfile_CFG, NULL);
#  798|   			/* when a devices file is not used, hints should have devices_file:. */
#  799|   			if (!cmd->enable_devices_file || !df_hint || !df_config) {

Error: GCC_ANALYZER_WARNING (CWE-401): [#def406]
LVM2.2.03.36/lib/label/hints.c:797:49: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(&_hints_file, "r")’
LVM2.2.03.36/lib/label/hints.c:713:20: acquire_memory: allocated here
LVM2.2.03.36/lib/label/hints.c:713:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/label/hints.c:716:9: branch_false: ...to here
LVM2.2.03.36/lib/label/hints.c:718:21: branch_true: following ‘true’ branch (when ‘i != 4’)...
LVM2.2.03.36/lib/label/hints.c:719:17: branch_true: ...to here
LVM2.2.03.36/lib/label/hints.c:721:16: branch_true: following ‘true’ branch...
LVM2.2.03.36/lib/label/hints.c:722:17: branch_true: ...to here
LVM2.2.03.36/lib/label/hints.c:723:20: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/label/hints.c:726:26: branch_false: ...to here
LVM2.2.03.36/lib/label/hints.c:726:20: branch_false: following ‘false’ branch (when ‘p’ is NULL)...
LVM2.2.03.36/lib/label/hints.c:740:22: branch_false: ...to here
LVM2.2.03.36/lib/label/hints.c:740:20: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/label/hints.c:757:22: branch_false: ...to here
LVM2.2.03.36/lib/label/hints.c:757:20: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/label/hints.c:770:22: branch_false: ...to here
LVM2.2.03.36/lib/label/hints.c:770:20: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/label/hints.c:783:22: branch_false: ...to here
LVM2.2.03.36/lib/label/hints.c:783:20: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/label/hints.c:795:22: branch_false: ...to here
LVM2.2.03.36/lib/label/hints.c:795:20: branch_true: following ‘true’ branch...
LVM2.2.03.36/lib/label/hints.c:797:49: branch_true: ...to here
LVM2.2.03.36/lib/label/hints.c:797:49: danger: ‘fopen(&_hints_file, "r")’ leaks here; was allocated at [(1)](sarif:/runs/0/results/41/codeFlows/0/threadFlows/0/locations/0)
#  795|   		if (!strncmp(_hint_line, "devices_file:", keylen)) {
#  796|   			const char *df_hint = _hint_line + keylen;
#  797|-> 			const char *df_config = find_config_tree_str(cmd, devices_devicesfile_CFG, NULL);
#  798|   			/* when a devices file is not used, hints should have devices_file:. */
#  799|   			if (!cmd->enable_devices_file || !df_hint || !df_config) {

Error: GCC_ANALYZER_WARNING (CWE-775): [#def407]
LVM2.2.03.36/lib/label/hints.c:801:41: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(&_hints_file, "r")’
LVM2.2.03.36/lib/label/hints.c:713:20: acquire_resource: opened here
LVM2.2.03.36/lib/label/hints.c:713:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/label/hints.c:716:9: branch_false: ...to here
LVM2.2.03.36/lib/label/hints.c:718:21: branch_true: following ‘true’ branch (when ‘i != 4’)...
LVM2.2.03.36/lib/label/hints.c:719:17: branch_true: ...to here
LVM2.2.03.36/lib/label/hints.c:721:16: branch_true: following ‘true’ branch...
LVM2.2.03.36/lib/label/hints.c:722:17: branch_true: ...to here
LVM2.2.03.36/lib/label/hints.c:723:20: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/label/hints.c:726:26: branch_false: ...to here
LVM2.2.03.36/lib/label/hints.c:726:20: branch_false: following ‘false’ branch (when ‘p’ is NULL)...
LVM2.2.03.36/lib/label/hints.c:740:22: branch_false: ...to here
LVM2.2.03.36/lib/label/hints.c:740:20: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/label/hints.c:757:22: branch_false: ...to here
LVM2.2.03.36/lib/label/hints.c:757:20: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/label/hints.c:770:22: branch_false: ...to here
LVM2.2.03.36/lib/label/hints.c:770:20: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/label/hints.c:783:22: branch_false: ...to here
LVM2.2.03.36/lib/label/hints.c:783:20: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/label/hints.c:795:22: branch_false: ...to here
LVM2.2.03.36/lib/label/hints.c:795:20: branch_true: following ‘true’ branch...
LVM2.2.03.36/lib/label/hints.c:797:49: branch_true: ...to here
LVM2.2.03.36/lib/label/hints.c:800:36: branch_true: following ‘true’ branch...
LVM2.2.03.36/lib/label/hints.c:801:41: branch_true: ...to here
LVM2.2.03.36/lib/label/hints.c:801:41: danger: ‘fopen(&_hints_file, "r")’ leaks here; was opened at [(1)](sarif:/runs/0/results/42/codeFlows/0/threadFlows/0/locations/0)
#  799|   			if (!cmd->enable_devices_file || !df_hint || !df_config) {
#  800|   				if (df_hint[0] != '.') {
#  801|-> 					log_debug("ignore hints with different devices_file: not enabled vs %s", df_hint);
#  802|   					*needs_refresh = 1;
#  803|   					break;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def408]
LVM2.2.03.36/lib/label/hints.c:801:41: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(&_hints_file, "r")’
LVM2.2.03.36/lib/label/hints.c:713:20: acquire_memory: allocated here
LVM2.2.03.36/lib/label/hints.c:713:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/label/hints.c:716:9: branch_false: ...to here
LVM2.2.03.36/lib/label/hints.c:718:21: branch_true: following ‘true’ branch (when ‘i != 4’)...
LVM2.2.03.36/lib/label/hints.c:719:17: branch_true: ...to here
LVM2.2.03.36/lib/label/hints.c:721:16: branch_true: following ‘true’ branch...
LVM2.2.03.36/lib/label/hints.c:722:17: branch_true: ...to here
LVM2.2.03.36/lib/label/hints.c:723:20: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/label/hints.c:726:26: branch_false: ...to here
LVM2.2.03.36/lib/label/hints.c:726:20: branch_false: following ‘false’ branch (when ‘p’ is NULL)...
LVM2.2.03.36/lib/label/hints.c:740:22: branch_false: ...to here
LVM2.2.03.36/lib/label/hints.c:740:20: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/label/hints.c:757:22: branch_false: ...to here
LVM2.2.03.36/lib/label/hints.c:757:20: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/label/hints.c:770:22: branch_false: ...to here
LVM2.2.03.36/lib/label/hints.c:770:20: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/label/hints.c:783:22: branch_false: ...to here
LVM2.2.03.36/lib/label/hints.c:783:20: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/label/hints.c:795:22: branch_false: ...to here
LVM2.2.03.36/lib/label/hints.c:795:20: branch_true: following ‘true’ branch...
LVM2.2.03.36/lib/label/hints.c:797:49: branch_true: ...to here
LVM2.2.03.36/lib/label/hints.c:800:36: branch_true: following ‘true’ branch...
LVM2.2.03.36/lib/label/hints.c:801:41: branch_true: ...to here
LVM2.2.03.36/lib/label/hints.c:801:41: danger: ‘fopen(&_hints_file, "r")’ leaks here; was allocated at [(1)](sarif:/runs/0/results/43/codeFlows/0/threadFlows/0/locations/0)
#  799|   			if (!cmd->enable_devices_file || !df_hint || !df_config) {
#  800|   				if (df_hint[0] != '.') {
#  801|-> 					log_debug("ignore hints with different devices_file: not enabled vs %s", df_hint);
#  802|   					*needs_refresh = 1;
#  803|   					break;

Error: GCC_ANALYZER_WARNING (CWE-775): [#def409]
LVM2.2.03.36/lib/label/hints.c:806:33: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(&_hints_file, "r")’
LVM2.2.03.36/lib/label/hints.c:713:20: acquire_resource: opened here
LVM2.2.03.36/lib/label/hints.c:713:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/label/hints.c:716:9: branch_false: ...to here
LVM2.2.03.36/lib/label/hints.c:718:21: branch_true: following ‘true’ branch (when ‘i != 4’)...
LVM2.2.03.36/lib/label/hints.c:719:17: branch_true: ...to here
LVM2.2.03.36/lib/label/hints.c:721:16: branch_true: following ‘true’ branch...
LVM2.2.03.36/lib/label/hints.c:722:17: branch_true: ...to here
LVM2.2.03.36/lib/label/hints.c:723:20: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/label/hints.c:726:26: branch_false: ...to here
LVM2.2.03.36/lib/label/hints.c:726:20: branch_false: following ‘false’ branch (when ‘p’ is NULL)...
LVM2.2.03.36/lib/label/hints.c:740:22: branch_false: ...to here
LVM2.2.03.36/lib/label/hints.c:740:20: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/label/hints.c:757:22: branch_false: ...to here
LVM2.2.03.36/lib/label/hints.c:757:20: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/label/hints.c:770:22: branch_false: ...to here
LVM2.2.03.36/lib/label/hints.c:770:20: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/label/hints.c:783:22: branch_false: ...to here
LVM2.2.03.36/lib/label/hints.c:783:20: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/label/hints.c:795:22: branch_false: ...to here
LVM2.2.03.36/lib/label/hints.c:795:20: branch_true: following ‘true’ branch...
LVM2.2.03.36/lib/label/hints.c:797:49: branch_true: ...to here
LVM2.2.03.36/lib/label/hints.c:799:28: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/label/hints.c:805:35: branch_true: following ‘true’ branch (when the strings are non-equal)...
LVM2.2.03.36/lib/label/hints.c:806:33: branch_true: ...to here
LVM2.2.03.36/lib/label/hints.c:806:33: danger: ‘fopen(&_hints_file, "r")’ leaks here; was opened at [(1)](sarif:/runs/0/results/44/codeFlows/0/threadFlows/0/locations/0)
#  804|   				}
#  805|   			} else if (strcmp(df_hint, df_config)) {
#  806|-> 				log_debug("ignore hints with different devices_file: %s vs %s", df_hint, df_config);
#  807|   				*needs_refresh = 1;
#  808|   				break;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def410]
LVM2.2.03.36/lib/label/hints.c:806:33: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(&_hints_file, "r")’
LVM2.2.03.36/lib/label/hints.c:713:20: acquire_memory: allocated here
LVM2.2.03.36/lib/label/hints.c:713:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/label/hints.c:716:9: branch_false: ...to here
LVM2.2.03.36/lib/label/hints.c:718:21: branch_true: following ‘true’ branch (when ‘i != 4’)...
LVM2.2.03.36/lib/label/hints.c:719:17: branch_true: ...to here
LVM2.2.03.36/lib/label/hints.c:721:16: branch_true: following ‘true’ branch...
LVM2.2.03.36/lib/label/hints.c:722:17: branch_true: ...to here
LVM2.2.03.36/lib/label/hints.c:723:20: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/label/hints.c:726:26: branch_false: ...to here
LVM2.2.03.36/lib/label/hints.c:726:20: branch_false: following ‘false’ branch (when ‘p’ is NULL)...
LVM2.2.03.36/lib/label/hints.c:740:22: branch_false: ...to here
LVM2.2.03.36/lib/label/hints.c:740:20: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/label/hints.c:757:22: branch_false: ...to here
LVM2.2.03.36/lib/label/hints.c:757:20: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/label/hints.c:770:22: branch_false: ...to here
LVM2.2.03.36/lib/label/hints.c:770:20: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/label/hints.c:783:22: branch_false: ...to here
LVM2.2.03.36/lib/label/hints.c:783:20: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/label/hints.c:795:22: branch_false: ...to here
LVM2.2.03.36/lib/label/hints.c:795:20: branch_true: following ‘true’ branch...
LVM2.2.03.36/lib/label/hints.c:797:49: branch_true: ...to here
LVM2.2.03.36/lib/label/hints.c:799:28: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/label/hints.c:805:35: branch_true: following ‘true’ branch (when the strings are non-equal)...
LVM2.2.03.36/lib/label/hints.c:806:33: branch_true: ...to here
LVM2.2.03.36/lib/label/hints.c:806:33: danger: ‘fopen(&_hints_file, "r")’ leaks here; was allocated at [(1)](sarif:/runs/0/results/45/codeFlows/0/threadFlows/0/locations/0)
#  804|   				}
#  805|   			} else if (strcmp(df_hint, df_config)) {
#  806|-> 				log_debug("ignore hints with different devices_file: %s vs %s", df_hint, df_config);
#  807|   				*needs_refresh = 1;
#  808|   				break;

Error: GCC_ANALYZER_WARNING (CWE-775): [#def411]
LVM2.2.03.36/lib/label/hints.c:816:33: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(&_hints_file, "r")’
LVM2.2.03.36/lib/label/hints.c:713:20: acquire_resource: opened here
LVM2.2.03.36/lib/label/hints.c:713:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/label/hints.c:716:9: branch_false: ...to here
LVM2.2.03.36/lib/label/hints.c:718:21: branch_true: following ‘true’ branch (when ‘i != 4’)...
LVM2.2.03.36/lib/label/hints.c:719:17: branch_true: ...to here
LVM2.2.03.36/lib/label/hints.c:721:16: branch_true: following ‘true’ branch...
LVM2.2.03.36/lib/label/hints.c:722:17: branch_true: ...to here
LVM2.2.03.36/lib/label/hints.c:723:20: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/label/hints.c:726:26: branch_false: ...to here
LVM2.2.03.36/lib/label/hints.c:726:20: branch_false: following ‘false’ branch (when ‘p’ is NULL)...
LVM2.2.03.36/lib/label/hints.c:740:22: branch_false: ...to here
LVM2.2.03.36/lib/label/hints.c:740:20: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/label/hints.c:757:22: branch_false: ...to here
LVM2.2.03.36/lib/label/hints.c:757:20: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/label/hints.c:770:22: branch_false: ...to here
LVM2.2.03.36/lib/label/hints.c:770:20: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/label/hints.c:783:22: branch_false: ...to here
LVM2.2.03.36/lib/label/hints.c:783:20: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/label/hints.c:795:22: branch_false: ...to here
LVM2.2.03.36/lib/label/hints.c:795:20: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/label/hints.c:814:22: branch_false: ...to here
LVM2.2.03.36/lib/label/hints.c:814:20: branch_true: following ‘true’ branch...
LVM2.2.03.36/lib/label/hints.c:815:29: branch_true: ...to here
LVM2.2.03.36/lib/label/hints.c:815:28: branch_true: following ‘true’ branch...
LVM2.2.03.36/lib/label/hints.c:816:33: branch_true: ...to here
LVM2.2.03.36/lib/label/hints.c:816:33: danger: ‘fopen(&_hints_file, "r")’ leaks here; was opened at [(1)](sarif:/runs/0/results/46/codeFlows/0/threadFlows/0/locations/0)
#  814|   		if (!strncmp(_hint_line, "devs_hash:", keylen)) {
#  815|   			if (sscanf(_hint_line + keylen, "%u %u", &read_hash, &read_count) != 2) {
#  816|-> 				log_debug("ignore hints with invalid devs_hash");
#  817|   				*needs_refresh = 1;
#  818|   				break;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def412]
LVM2.2.03.36/lib/label/hints.c:816:33: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(&_hints_file, "r")’
LVM2.2.03.36/lib/label/hints.c:713:20: acquire_memory: allocated here
LVM2.2.03.36/lib/label/hints.c:713:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/label/hints.c:716:9: branch_false: ...to here
LVM2.2.03.36/lib/label/hints.c:718:21: branch_true: following ‘true’ branch (when ‘i != 4’)...
LVM2.2.03.36/lib/label/hints.c:719:17: branch_true: ...to here
LVM2.2.03.36/lib/label/hints.c:721:16: branch_true: following ‘true’ branch...
LVM2.2.03.36/lib/label/hints.c:722:17: branch_true: ...to here
LVM2.2.03.36/lib/label/hints.c:723:20: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/label/hints.c:726:26: branch_false: ...to here
LVM2.2.03.36/lib/label/hints.c:726:20: branch_false: following ‘false’ branch (when ‘p’ is NULL)...
LVM2.2.03.36/lib/label/hints.c:740:22: branch_false: ...to here
LVM2.2.03.36/lib/label/hints.c:740:20: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/label/hints.c:757:22: branch_false: ...to here
LVM2.2.03.36/lib/label/hints.c:757:20: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/label/hints.c:770:22: branch_false: ...to here
LVM2.2.03.36/lib/label/hints.c:770:20: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/label/hints.c:783:22: branch_false: ...to here
LVM2.2.03.36/lib/label/hints.c:783:20: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/label/hints.c:795:22: branch_false: ...to here
LVM2.2.03.36/lib/label/hints.c:795:20: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/label/hints.c:814:22: branch_false: ...to here
LVM2.2.03.36/lib/label/hints.c:814:20: branch_true: following ‘true’ branch...
LVM2.2.03.36/lib/label/hints.c:815:29: branch_true: ...to here
LVM2.2.03.36/lib/label/hints.c:815:28: branch_true: following ‘true’ branch...
LVM2.2.03.36/lib/label/hints.c:816:33: branch_true: ...to here
LVM2.2.03.36/lib/label/hints.c:816:33: danger: ‘fopen(&_hints_file, "r")’ leaks here; was allocated at [(1)](sarif:/runs/0/results/47/codeFlows/0/threadFlows/0/locations/0)
#  814|   		if (!strncmp(_hint_line, "devs_hash:", keylen)) {
#  815|   			if (sscanf(_hint_line + keylen, "%u %u", &read_hash, &read_count) != 2) {
#  816|-> 				log_debug("ignore hints with invalid devs_hash");
#  817|   				*needs_refresh = 1;
#  818|   				break;

Error: GCC_ANALYZER_WARNING (CWE-775): [#def413]
LVM2.2.03.36/lib/label/hints.c:830:21: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(&_hints_file, "r")’
LVM2.2.03.36/lib/label/hints.c:713:20: acquire_resource: opened here
LVM2.2.03.36/lib/label/hints.c:713:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/label/hints.c:716:9: branch_false: ...to here
LVM2.2.03.36/lib/label/hints.c:718:21: branch_true: following ‘true’ branch (when ‘i != 4’)...
LVM2.2.03.36/lib/label/hints.c:719:17: branch_true: ...to here
LVM2.2.03.36/lib/label/hints.c:721:16: branch_true: following ‘true’ branch...
LVM2.2.03.36/lib/label/hints.c:722:17: branch_true: ...to here
LVM2.2.03.36/lib/label/hints.c:723:20: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/label/hints.c:726:26: branch_false: ...to here
LVM2.2.03.36/lib/label/hints.c:726:20: branch_false: following ‘false’ branch (when ‘p’ is NULL)...
LVM2.2.03.36/lib/label/hints.c:740:22: branch_false: ...to here
LVM2.2.03.36/lib/label/hints.c:740:20: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/label/hints.c:757:22: branch_false: ...to here
LVM2.2.03.36/lib/label/hints.c:757:20: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/label/hints.c:770:22: branch_false: ...to here
LVM2.2.03.36/lib/label/hints.c:770:20: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/label/hints.c:783:22: branch_false: ...to here
LVM2.2.03.36/lib/label/hints.c:783:20: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/label/hints.c:795:22: branch_false: ...to here
LVM2.2.03.36/lib/label/hints.c:795:20: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/label/hints.c:814:22: branch_false: ...to here
LVM2.2.03.36/lib/label/hints.c:814:20: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/label/hints.c:827:21: branch_false: ...to here
LVM2.2.03.36/lib/label/hints.c:827:20: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/label/hints.c:830:21: branch_false: ...to here
LVM2.2.03.36/lib/label/hints.c:830:21: danger: ‘fopen(&_hints_file, "r")’ leaks here; was opened at [(1)](sarif:/runs/0/results/48/codeFlows/0/threadFlows/0/locations/0)
#  828|   			continue;
#  829|   
#  830|-> 		if (dm_split_words(_hint_line, HINT_LINE_WORDS, 0, split) < 1)
#  831|   			continue;
#  832|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def414]
LVM2.2.03.36/lib/label/hints.c:830:21: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(&_hints_file, "r")’
LVM2.2.03.36/lib/label/hints.c:713:20: acquire_memory: allocated here
LVM2.2.03.36/lib/label/hints.c:713:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/label/hints.c:716:9: branch_false: ...to here
LVM2.2.03.36/lib/label/hints.c:718:21: branch_true: following ‘true’ branch (when ‘i != 4’)...
LVM2.2.03.36/lib/label/hints.c:719:17: branch_true: ...to here
LVM2.2.03.36/lib/label/hints.c:721:16: branch_true: following ‘true’ branch...
LVM2.2.03.36/lib/label/hints.c:722:17: branch_true: ...to here
LVM2.2.03.36/lib/label/hints.c:723:20: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/label/hints.c:726:26: branch_false: ...to here
LVM2.2.03.36/lib/label/hints.c:726:20: branch_false: following ‘false’ branch (when ‘p’ is NULL)...
LVM2.2.03.36/lib/label/hints.c:740:22: branch_false: ...to here
LVM2.2.03.36/lib/label/hints.c:740:20: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/label/hints.c:757:22: branch_false: ...to here
LVM2.2.03.36/lib/label/hints.c:757:20: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/label/hints.c:770:22: branch_false: ...to here
LVM2.2.03.36/lib/label/hints.c:770:20: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/label/hints.c:783:22: branch_false: ...to here
LVM2.2.03.36/lib/label/hints.c:783:20: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/label/hints.c:795:22: branch_false: ...to here
LVM2.2.03.36/lib/label/hints.c:795:20: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/label/hints.c:814:22: branch_false: ...to here
LVM2.2.03.36/lib/label/hints.c:814:20: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/label/hints.c:827:21: branch_false: ...to here
LVM2.2.03.36/lib/label/hints.c:827:20: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/label/hints.c:830:21: branch_false: ...to here
LVM2.2.03.36/lib/label/hints.c:830:21: danger: ‘fopen(&_hints_file, "r")’ leaks here; was allocated at [(1)](sarif:/runs/0/results/49/codeFlows/0/threadFlows/0/locations/0)
#  828|   			continue;
#  829|   
#  830|-> 		if (dm_split_words(_hint_line, HINT_LINE_WORDS, 0, split) < 1)
#  831|   			continue;
#  832|   

Error: GCC_ANALYZER_WARNING (CWE-775): [#def415]
LVM2.2.03.36/lib/label/hints.c:859:17: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(&_hints_file, "r")’
LVM2.2.03.36/lib/label/hints.c:713:20: acquire_resource: opened here
LVM2.2.03.36/lib/label/hints.c:713:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/label/hints.c:716:9: branch_false: ...to here
LVM2.2.03.36/lib/label/hints.c:718:21: branch_true: following ‘true’ branch (when ‘i != 4’)...
LVM2.2.03.36/lib/label/hints.c:719:17: branch_true: ...to here
LVM2.2.03.36/lib/label/hints.c:721:16: branch_true: following ‘true’ branch...
LVM2.2.03.36/lib/label/hints.c:722:17: branch_true: ...to here
LVM2.2.03.36/lib/label/hints.c:723:20: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/label/hints.c:726:26: branch_false: ...to here
LVM2.2.03.36/lib/label/hints.c:726:20: branch_false: following ‘false’ branch (when ‘p’ is NULL)...
LVM2.2.03.36/lib/label/hints.c:740:22: branch_false: ...to here
LVM2.2.03.36/lib/label/hints.c:740:20: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/label/hints.c:757:22: branch_false: ...to here
LVM2.2.03.36/lib/label/hints.c:757:20: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/label/hints.c:770:22: branch_false: ...to here
LVM2.2.03.36/lib/label/hints.c:770:20: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/label/hints.c:783:22: branch_false: ...to here
LVM2.2.03.36/lib/label/hints.c:783:20: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/label/hints.c:795:22: branch_false: ...to here
LVM2.2.03.36/lib/label/hints.c:795:20: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/label/hints.c:814:22: branch_false: ...to here
LVM2.2.03.36/lib/label/hints.c:814:20: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/label/hints.c:827:21: branch_false: ...to here
LVM2.2.03.36/lib/label/hints.c:827:20: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/label/hints.c:830:21: branch_false: ...to here
LVM2.2.03.36/lib/label/hints.c:830:20: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/label/hints.c:833:17: branch_false: ...to here
LVM2.2.03.36/lib/label/hints.c:853:20: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/label/hints.c:857:17: branch_false: ...to here
LVM2.2.03.36/lib/label/hints.c:859:17: danger: ‘fopen(&_hints_file, "r")’ leaks here; was opened at [(1)](sarif:/runs/0/results/50/codeFlows/0/threadFlows/0/locations/0)
#  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-401): [#def416]
LVM2.2.03.36/lib/label/hints.c:859:17: warning[-Wanalyzer-malloc-leak]: leak of ‘calloc(1, 4288)’
LVM2.2.03.36/lib/label/hints.c:691:12: enter_function: entry to ‘_read_hint_file’
LVM2.2.03.36/lib/label/hints.c:713:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/label/hints.c:716:9: branch_false: ...to here
LVM2.2.03.36/lib/label/hints.c:718:21: branch_true: following ‘true’ branch (when ‘i != 4’)...
LVM2.2.03.36/lib/label/hints.c:719:17: branch_true: ...to here
LVM2.2.03.36/lib/label/hints.c:721:16: branch_true: following ‘true’ branch...
LVM2.2.03.36/lib/label/hints.c:722:17: branch_true: ...to here
LVM2.2.03.36/lib/label/hints.c:723:20: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/label/hints.c:726:26: branch_false: ...to here
LVM2.2.03.36/lib/label/hints.c:726:20: branch_false: following ‘false’ branch (when ‘p’ is NULL)...
LVM2.2.03.36/lib/label/hints.c:740:22: branch_false: ...to here
LVM2.2.03.36/lib/label/hints.c:740:20: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/label/hints.c:757:22: branch_false: ...to here
LVM2.2.03.36/lib/label/hints.c:757:20: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/label/hints.c:770:22: branch_false: ...to here
LVM2.2.03.36/lib/label/hints.c:770:20: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/label/hints.c:783:22: branch_false: ...to here
LVM2.2.03.36/lib/label/hints.c:783:20: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/label/hints.c:795:22: branch_false: ...to here
LVM2.2.03.36/lib/label/hints.c:795:20: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/label/hints.c:814:22: branch_false: ...to here
LVM2.2.03.36/lib/label/hints.c:814:20: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/label/hints.c:827:21: branch_false: ...to here
LVM2.2.03.36/lib/label/hints.c:827:20: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/label/hints.c:830:21: branch_false: ...to here
LVM2.2.03.36/lib/label/hints.c:830:20: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/label/hints.c:833:17: branch_false: ...to here
LVM2.2.03.36/lib/label/hints.c:853:36: call_function: inlined call to ‘zalloc’ from ‘_read_hint_file’
LVM2.2.03.36/lib/label/hints.c:853:20: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/label/hints.c:857:17: branch_false: ...to here
LVM2.2.03.36/lib/label/hints.c:859:17: danger: ‘calloc(1, 4288)’ leaks here; was allocated at [(30)](sarif:/runs/0/results/52/codeFlows/0/threadFlows/0/locations/29)
#  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-401): [#def417]
LVM2.2.03.36/lib/label/hints.c:859:17: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(&_hints_file, "r")’
LVM2.2.03.36/lib/label/hints.c:713:20: acquire_memory: allocated here
LVM2.2.03.36/lib/label/hints.c:713:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/label/hints.c:716:9: branch_false: ...to here
LVM2.2.03.36/lib/label/hints.c:718:21: branch_true: following ‘true’ branch (when ‘i != 4’)...
LVM2.2.03.36/lib/label/hints.c:719:17: branch_true: ...to here
LVM2.2.03.36/lib/label/hints.c:721:16: branch_true: following ‘true’ branch...
LVM2.2.03.36/lib/label/hints.c:722:17: branch_true: ...to here
LVM2.2.03.36/lib/label/hints.c:723:20: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/label/hints.c:726:26: branch_false: ...to here
LVM2.2.03.36/lib/label/hints.c:726:20: branch_false: following ‘false’ branch (when ‘p’ is NULL)...
LVM2.2.03.36/lib/label/hints.c:740:22: branch_false: ...to here
LVM2.2.03.36/lib/label/hints.c:740:20: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/label/hints.c:757:22: branch_false: ...to here
LVM2.2.03.36/lib/label/hints.c:757:20: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/label/hints.c:770:22: branch_false: ...to here
LVM2.2.03.36/lib/label/hints.c:770:20: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/label/hints.c:783:22: branch_false: ...to here
LVM2.2.03.36/lib/label/hints.c:783:20: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/label/hints.c:795:22: branch_false: ...to here
LVM2.2.03.36/lib/label/hints.c:795:20: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/label/hints.c:814:22: branch_false: ...to here
LVM2.2.03.36/lib/label/hints.c:814:20: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/label/hints.c:827:21: branch_false: ...to here
LVM2.2.03.36/lib/label/hints.c:827:20: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/label/hints.c:830:21: branch_false: ...to here
LVM2.2.03.36/lib/label/hints.c:830:20: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/label/hints.c:833:17: branch_false: ...to here
LVM2.2.03.36/lib/label/hints.c:853:20: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/label/hints.c:857:17: branch_false: ...to here
LVM2.2.03.36/lib/label/hints.c:859:17: danger: ‘fopen(&_hints_file, "r")’ leaks here; was allocated at [(1)](sarif:/runs/0/results/51/codeFlows/0/threadFlows/0/locations/0)
#  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): [#def418]
LVM2.2.03.36/lib/label/hints.c:860:17: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(&_hints_file, "r")’
LVM2.2.03.36/lib/label/hints.c:713:20: acquire_resource: opened here
LVM2.2.03.36/lib/label/hints.c:713:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/label/hints.c:716:9: branch_false: ...to here
LVM2.2.03.36/lib/label/hints.c:718:21: branch_true: following ‘true’ branch (when ‘i != 4’)...
LVM2.2.03.36/lib/label/hints.c:719:17: branch_true: ...to here
LVM2.2.03.36/lib/label/hints.c:721:16: branch_true: following ‘true’ branch...
LVM2.2.03.36/lib/label/hints.c:722:17: branch_true: ...to here
LVM2.2.03.36/lib/label/hints.c:723:20: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/label/hints.c:726:26: branch_false: ...to here
LVM2.2.03.36/lib/label/hints.c:726:20: branch_false: following ‘false’ branch (when ‘p’ is NULL)...
LVM2.2.03.36/lib/label/hints.c:740:22: branch_false: ...to here
LVM2.2.03.36/lib/label/hints.c:740:20: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/label/hints.c:757:22: branch_false: ...to here
LVM2.2.03.36/lib/label/hints.c:757:20: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/label/hints.c:770:22: branch_false: ...to here
LVM2.2.03.36/lib/label/hints.c:770:20: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/label/hints.c:783:22: branch_false: ...to here
LVM2.2.03.36/lib/label/hints.c:783:20: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/label/hints.c:795:22: branch_false: ...to here
LVM2.2.03.36/lib/label/hints.c:795:20: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/label/hints.c:814:22: branch_false: ...to here
LVM2.2.03.36/lib/label/hints.c:814:20: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/label/hints.c:827:21: branch_false: ...to here
LVM2.2.03.36/lib/label/hints.c:827:20: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/label/hints.c:830:21: branch_false: ...to here
LVM2.2.03.36/lib/label/hints.c:830:20: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/label/hints.c:833:17: branch_false: ...to here
LVM2.2.03.36/lib/label/hints.c:853:20: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/label/hints.c:857:17: branch_false: ...to here
LVM2.2.03.36/lib/label/hints.c:860:17: danger: ‘fopen(&_hints_file, "r")’ leaks here; was opened at [(1)](sarif:/runs/0/results/54/codeFlows/0/threadFlows/0/locations/0)
#  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++;
#  862|   	}

Error: GCC_ANALYZER_WARNING (CWE-401): [#def419]
LVM2.2.03.36/lib/label/hints.c:860:17: warning[-Wanalyzer-malloc-leak]: leak of ‘calloc(1, 4288)’
LVM2.2.03.36/lib/label/hints.c:691:12: enter_function: entry to ‘_read_hint_file’
LVM2.2.03.36/lib/label/hints.c:713:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/label/hints.c:716:9: branch_false: ...to here
LVM2.2.03.36/lib/label/hints.c:718:21: branch_true: following ‘true’ branch (when ‘i != 4’)...
LVM2.2.03.36/lib/label/hints.c:719:17: branch_true: ...to here
LVM2.2.03.36/lib/label/hints.c:721:16: branch_true: following ‘true’ branch...
LVM2.2.03.36/lib/label/hints.c:722:17: branch_true: ...to here
LVM2.2.03.36/lib/label/hints.c:723:20: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/label/hints.c:726:26: branch_false: ...to here
LVM2.2.03.36/lib/label/hints.c:726:20: branch_false: following ‘false’ branch (when ‘p’ is NULL)...
LVM2.2.03.36/lib/label/hints.c:740:22: branch_false: ...to here
LVM2.2.03.36/lib/label/hints.c:740:20: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/label/hints.c:757:22: branch_false: ...to here
LVM2.2.03.36/lib/label/hints.c:757:20: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/label/hints.c:770:22: branch_false: ...to here
LVM2.2.03.36/lib/label/hints.c:770:20: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/label/hints.c:783:22: branch_false: ...to here
LVM2.2.03.36/lib/label/hints.c:783:20: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/label/hints.c:795:22: branch_false: ...to here
LVM2.2.03.36/lib/label/hints.c:795:20: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/label/hints.c:814:22: branch_false: ...to here
LVM2.2.03.36/lib/label/hints.c:814:20: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/label/hints.c:827:21: branch_false: ...to here
LVM2.2.03.36/lib/label/hints.c:827:20: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/label/hints.c:830:21: branch_false: ...to here
LVM2.2.03.36/lib/label/hints.c:830:20: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/label/hints.c:833:17: branch_false: ...to here
LVM2.2.03.36/lib/label/hints.c:853:36: call_function: inlined call to ‘zalloc’ from ‘_read_hint_file’
LVM2.2.03.36/lib/label/hints.c:853:20: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/label/hints.c:857:17: branch_false: ...to here
LVM2.2.03.36/lib/label/hints.c:860:17: danger: ‘calloc(1, 4288)’ leaks here; was allocated at [(30)](sarif:/runs/0/results/53/codeFlows/0/threadFlows/0/locations/29)
#  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++;
#  862|   	}

Error: GCC_ANALYZER_WARNING (CWE-401): [#def420]
LVM2.2.03.36/lib/label/hints.c:860:17: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(&_hints_file, "r")’
LVM2.2.03.36/lib/label/hints.c:713:20: acquire_memory: allocated here
LVM2.2.03.36/lib/label/hints.c:713:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/label/hints.c:716:9: branch_false: ...to here
LVM2.2.03.36/lib/label/hints.c:718:21: branch_true: following ‘true’ branch (when ‘i != 4’)...
LVM2.2.03.36/lib/label/hints.c:719:17: branch_true: ...to here
LVM2.2.03.36/lib/label/hints.c:721:16: branch_true: following ‘true’ branch...
LVM2.2.03.36/lib/label/hints.c:722:17: branch_true: ...to here
LVM2.2.03.36/lib/label/hints.c:723:20: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/label/hints.c:726:26: branch_false: ...to here
LVM2.2.03.36/lib/label/hints.c:726:20: branch_false: following ‘false’ branch (when ‘p’ is NULL)...
LVM2.2.03.36/lib/label/hints.c:740:22: branch_false: ...to here
LVM2.2.03.36/lib/label/hints.c:740:20: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/label/hints.c:757:22: branch_false: ...to here
LVM2.2.03.36/lib/label/hints.c:757:20: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/label/hints.c:770:22: branch_false: ...to here
LVM2.2.03.36/lib/label/hints.c:770:20: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/label/hints.c:783:22: branch_false: ...to here
LVM2.2.03.36/lib/label/hints.c:783:20: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/label/hints.c:795:22: branch_false: ...to here
LVM2.2.03.36/lib/label/hints.c:795:20: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/label/hints.c:814:22: branch_false: ...to here
LVM2.2.03.36/lib/label/hints.c:814:20: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/label/hints.c:827:21: branch_false: ...to here
LVM2.2.03.36/lib/label/hints.c:827:20: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/label/hints.c:830:21: branch_false: ...to here
LVM2.2.03.36/lib/label/hints.c:830:20: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/label/hints.c:833:17: branch_false: ...to here
LVM2.2.03.36/lib/label/hints.c:853:20: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/label/hints.c:857:17: branch_false: ...to here
LVM2.2.03.36/lib/label/hints.c:860:17: danger: ‘fopen(&_hints_file, "r")’ leaks here; was allocated at [(1)](sarif:/runs/0/results/55/codeFlows/0/threadFlows/0/locations/0)
#  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++;
#  862|   	}

Error: GCC_ANALYZER_WARNING (CWE-775): [#def421]
LVM2.2.03.36/lib/label/hints.c:1009:13: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(&_hints_file, "w")’
LVM2.2.03.36/lib/label/hints.c:981:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/label/hints.c:985:13: branch_false: ...to here
LVM2.2.03.36/lib/label/hints.c:996:20: branch_false: following ‘false’ branch (when ‘newhints != 4’)...
LVM2.2.03.36/lib/label/hints.c:1000:9: branch_false: ...to here
LVM2.2.03.36/lib/label/hints.c:1002:20: acquire_resource: opened here
LVM2.2.03.36/lib/label/hints.c:1002:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/label/hints.c:1007:13: branch_false: ...to here
LVM2.2.03.36/lib/label/hints.c:1009:13: danger: ‘fopen(&_hints_file, "w")’ leaks here; was opened at [(5)](sarif:/runs/0/results/56/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): [#def422]
LVM2.2.03.36/lib/label/hints.c:1009:13: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(&_hints_file, "w")’
LVM2.2.03.36/lib/label/hints.c:981:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/label/hints.c:985:13: branch_false: ...to here
LVM2.2.03.36/lib/label/hints.c:996:20: branch_false: following ‘false’ branch (when ‘newhints != 4’)...
LVM2.2.03.36/lib/label/hints.c:1000:9: branch_false: ...to here
LVM2.2.03.36/lib/label/hints.c:1002:20: acquire_memory: allocated here
LVM2.2.03.36/lib/label/hints.c:1002:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/label/hints.c:1007:13: branch_false: ...to here
LVM2.2.03.36/lib/label/hints.c:1009:13: danger: ‘fopen(&_hints_file, "w")’ leaks here; was allocated at [(5)](sarif:/runs/0/results/57/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): [#def423]
LVM2.2.03.36/lib/label/hints.c:1009:46: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(&_hints_file, "w")’
LVM2.2.03.36/lib/label/hints.c:981:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/label/hints.c:985:13: branch_false: ...to here
LVM2.2.03.36/lib/label/hints.c:996:20: branch_false: following ‘false’ branch (when ‘newhints != 4’)...
LVM2.2.03.36/lib/label/hints.c:1000:9: branch_false: ...to here
LVM2.2.03.36/lib/label/hints.c:1002:20: acquire_resource: opened here
LVM2.2.03.36/lib/label/hints.c:1002:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/label/hints.c:1007:13: branch_false: ...to here
LVM2.2.03.36/lib/label/hints.c:1009:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/label/hints.c:1009:46: branch_false: ...to here
LVM2.2.03.36/lib/label/hints.c:1009:46: danger: ‘fopen(&_hints_file, "w")’ leaks here; was opened at [(5)](sarif:/runs/0/results/58/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): [#def424]
LVM2.2.03.36/lib/label/hints.c:1009:46: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(&_hints_file, "w")’
LVM2.2.03.36/lib/label/hints.c:981:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/label/hints.c:985:13: branch_false: ...to here
LVM2.2.03.36/lib/label/hints.c:996:20: branch_false: following ‘false’ branch (when ‘newhints != 4’)...
LVM2.2.03.36/lib/label/hints.c:1000:9: branch_false: ...to here
LVM2.2.03.36/lib/label/hints.c:1002:20: acquire_memory: allocated here
LVM2.2.03.36/lib/label/hints.c:1002:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/label/hints.c:1007:13: branch_false: ...to here
LVM2.2.03.36/lib/label/hints.c:1009:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/label/hints.c:1009:46: branch_false: ...to here
LVM2.2.03.36/lib/label/hints.c:1009:46: danger: ‘fopen(&_hints_file, "w")’ leaks here; was allocated at [(5)](sarif:/runs/0/results/59/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): [#def425]
LVM2.2.03.36/lib/label/hints.c:1013:21: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(&_hints_file, "w")’
LVM2.2.03.36/lib/label/hints.c:981:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/label/hints.c:985:13: branch_false: ...to here
LVM2.2.03.36/lib/label/hints.c:996:20: branch_false: following ‘false’ branch (when ‘newhints != 4’)...
LVM2.2.03.36/lib/label/hints.c:1000:9: branch_false: ...to here
LVM2.2.03.36/lib/label/hints.c:1002:20: acquire_resource: opened here
LVM2.2.03.36/lib/label/hints.c:1002:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/label/hints.c:1007:13: branch_false: ...to here
LVM2.2.03.36/lib/label/hints.c:1013:21: danger: ‘fopen(&_hints_file, "w")’ leaks here; was opened at [(5)](sarif:/runs/0/results/60/codeFlows/0/threadFlows/0/locations/4)
# 1011|   
# 1012|   		/* leave a comment about why it's empty in case someone is curious */
# 1013|-> 		if (lvmcache_has_duplicate_devs())
# 1014|   			fprintf(fp, "# info: duplicate_pvs\n");
# 1015|   		if (lvmcache_found_duplicate_vgnames())

Error: GCC_ANALYZER_WARNING (CWE-401): [#def426]
LVM2.2.03.36/lib/label/hints.c:1013:21: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(&_hints_file, "w")’
LVM2.2.03.36/lib/label/hints.c:981:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/label/hints.c:985:13: branch_false: ...to here
LVM2.2.03.36/lib/label/hints.c:996:20: branch_false: following ‘false’ branch (when ‘newhints != 4’)...
LVM2.2.03.36/lib/label/hints.c:1000:9: branch_false: ...to here
LVM2.2.03.36/lib/label/hints.c:1002:20: acquire_memory: allocated here
LVM2.2.03.36/lib/label/hints.c:1002:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/label/hints.c:1007:13: branch_false: ...to here
LVM2.2.03.36/lib/label/hints.c:1013:21: danger: ‘fopen(&_hints_file, "w")’ leaks here; was allocated at [(5)](sarif:/runs/0/results/61/codeFlows/0/threadFlows/0/locations/4)
# 1011|   
# 1012|   		/* leave a comment about why it's empty in case someone is curious */
# 1013|-> 		if (lvmcache_has_duplicate_devs())
# 1014|   			fprintf(fp, "# info: duplicate_pvs\n");
# 1015|   		if (lvmcache_found_duplicate_vgnames())

Error: GCC_ANALYZER_WARNING (CWE-775): [#def427]
LVM2.2.03.36/lib/label/hints.c:1015:21: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(&_hints_file, "w")’
LVM2.2.03.36/lib/label/hints.c:981:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/label/hints.c:985:13: branch_false: ...to here
LVM2.2.03.36/lib/label/hints.c:996:20: branch_false: following ‘false’ branch (when ‘newhints != 4’)...
LVM2.2.03.36/lib/label/hints.c:1000:9: branch_false: ...to here
LVM2.2.03.36/lib/label/hints.c:1002:20: acquire_resource: opened here
LVM2.2.03.36/lib/label/hints.c:1002:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/label/hints.c:1007:13: branch_false: ...to here
LVM2.2.03.36/lib/label/hints.c:1015:21: danger: ‘fopen(&_hints_file, "w")’ leaks here; was opened at [(5)](sarif:/runs/0/results/62/codeFlows/0/threadFlows/0/locations/4)
# 1013|   		if (lvmcache_has_duplicate_devs())
# 1014|   			fprintf(fp, "# info: duplicate_pvs\n");
# 1015|-> 		if (lvmcache_found_duplicate_vgnames())
# 1016|   			fprintf(fp, "# info: duplicate_vgnames\n");
# 1017|   		goto out_flush;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def428]
LVM2.2.03.36/lib/label/hints.c:1015:21: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(&_hints_file, "w")’
LVM2.2.03.36/lib/label/hints.c:981:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/label/hints.c:985:13: branch_false: ...to here
LVM2.2.03.36/lib/label/hints.c:996:20: branch_false: following ‘false’ branch (when ‘newhints != 4’)...
LVM2.2.03.36/lib/label/hints.c:1000:9: branch_false: ...to here
LVM2.2.03.36/lib/label/hints.c:1002:20: acquire_memory: allocated here
LVM2.2.03.36/lib/label/hints.c:1002:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/label/hints.c:1007:13: branch_false: ...to here
LVM2.2.03.36/lib/label/hints.c:1015:21: danger: ‘fopen(&_hints_file, "w")’ leaks here; was allocated at [(5)](sarif:/runs/0/results/63/codeFlows/0/threadFlows/0/locations/4)
# 1013|   		if (lvmcache_has_duplicate_devs())
# 1014|   			fprintf(fp, "# info: duplicate_pvs\n");
# 1015|-> 		if (lvmcache_found_duplicate_vgnames())
# 1016|   			fprintf(fp, "# info: duplicate_vgnames\n");
# 1017|   		goto out_flush;

Error: GCC_ANALYZER_WARNING (CWE-775): [#def429]
LVM2.2.03.36/lib/label/hints.c:1040:31: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(&_hints_file, "w")’
LVM2.2.03.36/lib/label/hints.c:981:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/label/hints.c:985:13: branch_false: ...to here
LVM2.2.03.36/lib/label/hints.c:996:20: branch_false: following ‘false’ branch (when ‘newhints != 4’)...
LVM2.2.03.36/lib/label/hints.c:1000:9: branch_false: ...to here
LVM2.2.03.36/lib/label/hints.c:1002:20: acquire_resource: opened here
LVM2.2.03.36/lib/label/hints.c:1002:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/label/hints.c:1007:13: branch_false: ...to here
LVM2.2.03.36/lib/label/hints.c:1009:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/label/hints.c:1024:9: branch_false: following ‘false’ branch...
 branch_false: ...to here
LVM2.2.03.36/lib/label/hints.c:1028:9: branch_false: following ‘false’ branch...
 branch_false: ...to here
LVM2.2.03.36/lib/label/hints.c:1040:31: danger: ‘fopen(&_hints_file, "w")’ leaks here; was opened at [(5)](sarif:/runs/0/results/64/codeFlows/0/threadFlows/0/locations/4)
# 1038|   	 * shouldn't get here.
# 1039|   	 */
# 1040|-> 	config_devices_file = find_config_tree_str(cmd, devices_devicesfile_CFG, NULL);
# 1041|   	if (cmd->enable_devices_file && !cmd->devicesfile && config_devices_file)
# 1042|   		fprintf(fp, "devices_file:%s\n", config_devices_file);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def430]
LVM2.2.03.36/lib/label/hints.c:1040:31: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(&_hints_file, "w")’
LVM2.2.03.36/lib/label/hints.c:981:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/label/hints.c:985:13: branch_false: ...to here
LVM2.2.03.36/lib/label/hints.c:996:20: branch_false: following ‘false’ branch (when ‘newhints != 4’)...
LVM2.2.03.36/lib/label/hints.c:1000:9: branch_false: ...to here
LVM2.2.03.36/lib/label/hints.c:1002:20: acquire_memory: allocated here
LVM2.2.03.36/lib/label/hints.c:1002:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/label/hints.c:1007:13: branch_false: ...to here
LVM2.2.03.36/lib/label/hints.c:1009:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/label/hints.c:1024:9: branch_false: following ‘false’ branch...
 branch_false: ...to here
LVM2.2.03.36/lib/label/hints.c:1028:9: branch_false: following ‘false’ branch...
 branch_false: ...to here
LVM2.2.03.36/lib/label/hints.c:1040:31: danger: ‘fopen(&_hints_file, "w")’ leaks here; was allocated at [(5)](sarif:/runs/0/results/65/codeFlows/0/threadFlows/0/locations/4)
# 1038|   	 * shouldn't get here.
# 1039|   	 */
# 1040|-> 	config_devices_file = find_config_tree_str(cmd, devices_devicesfile_CFG, NULL);
# 1041|   	if (cmd->enable_devices_file && !cmd->devicesfile && config_devices_file)
# 1042|   		fprintf(fp, "devices_file:%s\n", config_devices_file);

Error: GCC_ANALYZER_WARNING (CWE-775): [#def431]
LVM2.2.03.36/lib/label/hints.c:1051:22: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(&_hints_file, "w")’
LVM2.2.03.36/lib/label/hints.c:981:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/label/hints.c:985:13: branch_false: ...to here
LVM2.2.03.36/lib/label/hints.c:996:20: branch_false: following ‘false’ branch (when ‘newhints != 4’)...
LVM2.2.03.36/lib/label/hints.c:1000:9: branch_false: ...to here
LVM2.2.03.36/lib/label/hints.c:1002:20: acquire_resource: opened here
LVM2.2.03.36/lib/label/hints.c:1002:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/label/hints.c:1007:13: branch_false: ...to here
LVM2.2.03.36/lib/label/hints.c:1009:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/label/hints.c:1024:9: branch_false: following ‘false’ branch...
 branch_false: ...to here
LVM2.2.03.36/lib/label/hints.c:1028:9: branch_false: following ‘false’ branch...
 branch_false: ...to here
LVM2.2.03.36/lib/label/hints.c:1051:22: danger: ‘fopen(&_hints_file, "w")’ leaks here; was opened at [(5)](sarif:/runs/0/results/66/codeFlows/0/threadFlows/0/locations/4)
# 1049|   	 */
# 1050|   
# 1051|-> 	if (!(iter = dev_iter_create(NULL, 0))) {
# 1052|   		ret = 0;
# 1053|   		goto out_close;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def432]
LVM2.2.03.36/lib/label/hints.c:1051:22: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(&_hints_file, "w")’
LVM2.2.03.36/lib/label/hints.c:981:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/label/hints.c:985:13: branch_false: ...to here
LVM2.2.03.36/lib/label/hints.c:996:20: branch_false: following ‘false’ branch (when ‘newhints != 4’)...
LVM2.2.03.36/lib/label/hints.c:1000:9: branch_false: ...to here
LVM2.2.03.36/lib/label/hints.c:1002:20: acquire_memory: allocated here
LVM2.2.03.36/lib/label/hints.c:1002:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/label/hints.c:1007:13: branch_false: ...to here
LVM2.2.03.36/lib/label/hints.c:1009:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/label/hints.c:1024:9: branch_false: following ‘false’ branch...
 branch_false: ...to here
LVM2.2.03.36/lib/label/hints.c:1028:9: branch_false: following ‘false’ branch...
 branch_false: ...to here
LVM2.2.03.36/lib/label/hints.c:1051:22: danger: ‘fopen(&_hints_file, "w")’ leaks here; was allocated at [(5)](sarif:/runs/0/results/67/codeFlows/0/threadFlows/0/locations/4)
# 1049|   	 */
# 1050|   
# 1051|-> 	if (!(iter = dev_iter_create(NULL, 0))) {
# 1052|   		ret = 0;
# 1053|   		goto out_close;

Error: GCC_ANALYZER_WARNING (CWE-775): [#def433]
LVM2.2.03.36/lib/label/hints.c:1062:23: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(&_hints_file, "w")’
LVM2.2.03.36/lib/label/hints.c:981:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/label/hints.c:985:13: branch_false: ...to here
LVM2.2.03.36/lib/label/hints.c:996:20: branch_false: following ‘false’ branch (when ‘newhints != 4’)...
LVM2.2.03.36/lib/label/hints.c:1000:9: branch_false: ...to here
LVM2.2.03.36/lib/label/hints.c:1002:20: acquire_resource: opened here
LVM2.2.03.36/lib/label/hints.c:1002:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/label/hints.c:1007:13: branch_false: ...to here
LVM2.2.03.36/lib/label/hints.c:1009:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/label/hints.c:1024:9: branch_false: following ‘false’ branch...
 branch_false: ...to here
LVM2.2.03.36/lib/label/hints.c:1028:9: branch_false: following ‘false’ branch...
 branch_false: ...to here
LVM2.2.03.36/lib/label/hints.c:1051:12: branch_false: following ‘false’ branch...
 branch_false: ...to here
LVM2.2.03.36/lib/label/hints.c:1062:23: danger: ‘fopen(&_hints_file, "w")’ leaks here; was opened at [(5)](sarif:/runs/0/results/68/codeFlows/0/threadFlows/0/locations/4)
# 1060|   	 * 2. add PVs to the hint file
# 1061|   	 */
# 1062|-> 	while ((dev = dev_iter_get(cmd, iter))) {
# 1063|   		if (cmd->enable_devices_file && !get_du_for_dev(cmd, dev))
# 1064|   			continue;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def434]
LVM2.2.03.36/lib/label/hints.c:1062:23: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(&_hints_file, "w")’
LVM2.2.03.36/lib/label/hints.c:981:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/label/hints.c:985:13: branch_false: ...to here
LVM2.2.03.36/lib/label/hints.c:996:20: branch_false: following ‘false’ branch (when ‘newhints != 4’)...
LVM2.2.03.36/lib/label/hints.c:1000:9: branch_false: ...to here
LVM2.2.03.36/lib/label/hints.c:1002:20: acquire_memory: allocated here
LVM2.2.03.36/lib/label/hints.c:1002:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/label/hints.c:1007:13: branch_false: ...to here
LVM2.2.03.36/lib/label/hints.c:1009:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/label/hints.c:1024:9: branch_false: following ‘false’ branch...
 branch_false: ...to here
LVM2.2.03.36/lib/label/hints.c:1028:9: branch_false: following ‘false’ branch...
 branch_false: ...to here
LVM2.2.03.36/lib/label/hints.c:1051:12: branch_false: following ‘false’ branch...
 branch_false: ...to here
LVM2.2.03.36/lib/label/hints.c:1062:23: danger: ‘fopen(&_hints_file, "w")’ leaks here; was allocated at [(5)](sarif:/runs/0/results/69/codeFlows/0/threadFlows/0/locations/4)
# 1060|   	 * 2. add PVs to the hint file
# 1061|   	 */
# 1062|-> 	while ((dev = dev_iter_get(cmd, iter))) {
# 1063|   		if (cmd->enable_devices_file && !get_du_for_dev(cmd, dev))
# 1064|   			continue;

Error: GCC_ANALYZER_WARNING (CWE-775): [#def435]
LVM2.2.03.36/lib/label/hints.c:1063:50: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(&_hints_file, "w")’
LVM2.2.03.36/lib/label/hints.c:981:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/label/hints.c:985:13: branch_false: ...to here
LVM2.2.03.36/lib/label/hints.c:996:20: branch_false: following ‘false’ branch (when ‘newhints != 4’)...
LVM2.2.03.36/lib/label/hints.c:1000:9: branch_false: ...to here
LVM2.2.03.36/lib/label/hints.c:1002:20: acquire_resource: opened here
LVM2.2.03.36/lib/label/hints.c:1002:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/label/hints.c:1007:13: branch_false: ...to here
LVM2.2.03.36/lib/label/hints.c:1009:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/label/hints.c:1024:9: branch_false: following ‘false’ branch...
 branch_false: ...to here
LVM2.2.03.36/lib/label/hints.c:1028:9: branch_false: following ‘false’ branch...
 branch_false: ...to here
LVM2.2.03.36/lib/label/hints.c:1051:12: branch_false: following ‘false’ branch...
 branch_false: ...to here
LVM2.2.03.36/lib/label/hints.c:1062:16: branch_true: following ‘true’ branch...
LVM2.2.03.36/lib/label/hints.c:1063:21: branch_true: ...to here
LVM2.2.03.36/lib/label/hints.c:1063:20: branch_true: following ‘true’ branch...
LVM2.2.03.36/lib/label/hints.c:1063:50: branch_true: ...to here
LVM2.2.03.36/lib/label/hints.c:1063:50: danger: ‘fopen(&_hints_file, "w")’ leaks here; was opened at [(5)](sarif:/runs/0/results/70/codeFlows/0/threadFlows/0/locations/4)
# 1061|   	 */
# 1062|   	while ((dev = dev_iter_get(cmd, iter))) {
# 1063|-> 		if (cmd->enable_devices_file && !get_du_for_dev(cmd, dev))
# 1064|   			continue;
# 1065|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def436]
LVM2.2.03.36/lib/label/hints.c:1063:50: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(&_hints_file, "w")’
LVM2.2.03.36/lib/label/hints.c:981:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/label/hints.c:985:13: branch_false: ...to here
LVM2.2.03.36/lib/label/hints.c:996:20: branch_false: following ‘false’ branch (when ‘newhints != 4’)...
LVM2.2.03.36/lib/label/hints.c:1000:9: branch_false: ...to here
LVM2.2.03.36/lib/label/hints.c:1002:20: acquire_memory: allocated here
LVM2.2.03.36/lib/label/hints.c:1002:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/label/hints.c:1007:13: branch_false: ...to here
LVM2.2.03.36/lib/label/hints.c:1009:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/label/hints.c:1024:9: branch_false: following ‘false’ branch...
 branch_false: ...to here
LVM2.2.03.36/lib/label/hints.c:1028:9: branch_false: following ‘false’ branch...
 branch_false: ...to here
LVM2.2.03.36/lib/label/hints.c:1051:12: branch_false: following ‘false’ branch...
 branch_false: ...to here
LVM2.2.03.36/lib/label/hints.c:1062:16: branch_true: following ‘true’ branch...
LVM2.2.03.36/lib/label/hints.c:1063:21: branch_true: ...to here
LVM2.2.03.36/lib/label/hints.c:1063:20: branch_true: following ‘true’ branch...
LVM2.2.03.36/lib/label/hints.c:1063:50: branch_true: ...to here
LVM2.2.03.36/lib/label/hints.c:1063:50: danger: ‘fopen(&_hints_file, "w")’ leaks here; was allocated at [(5)](sarif:/runs/0/results/71/codeFlows/0/threadFlows/0/locations/4)
# 1061|   	 */
# 1062|   	while ((dev = dev_iter_get(cmd, iter))) {
# 1063|-> 		if (cmd->enable_devices_file && !get_du_for_dev(cmd, dev))
# 1064|   			continue;
# 1065|   

Error: GCC_ANALYZER_WARNING (CWE-775): [#def437]
LVM2.2.03.36/lib/label/hints.c:1116:9: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(&_hints_file, "w")’
LVM2.2.03.36/lib/label/hints.c:981:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/label/hints.c:985:13: branch_false: ...to here
LVM2.2.03.36/lib/label/hints.c:996:20: branch_false: following ‘false’ branch (when ‘newhints != 4’)...
LVM2.2.03.36/lib/label/hints.c:1000:9: branch_false: ...to here
LVM2.2.03.36/lib/label/hints.c:1002:20: acquire_resource: opened here
LVM2.2.03.36/lib/label/hints.c:1002:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/label/hints.c:1007:13: branch_false: ...to here
LVM2.2.03.36/lib/label/hints.c:1009:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/label/hints.c:1024:9: branch_false: following ‘false’ branch...
 branch_false: ...to here
LVM2.2.03.36/lib/label/hints.c:1028:9: branch_false: following ‘false’ branch...
 branch_false: ...to here
LVM2.2.03.36/lib/label/hints.c:1051:12: branch_false: following ‘false’ branch...
 branch_false: ...to here
LVM2.2.03.36/lib/label/hints.c:1116:9: danger: ‘fopen(&_hints_file, "w")’ leaks here; was opened at [(5)](sarif:/runs/0/results/72/codeFlows/0/threadFlows/0/locations/4)
# 1114|   
# 1115|   	fprintf(fp, "devs_hash: %u %u\n", hash, count);
# 1116|-> 	dev_iter_destroy(iter);
# 1117|   
# 1118|    out_flush:

Error: GCC_ANALYZER_WARNING (CWE-401): [#def438]
LVM2.2.03.36/lib/label/hints.c:1116:9: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(&_hints_file, "w")’
LVM2.2.03.36/lib/label/hints.c:981:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/label/hints.c:985:13: branch_false: ...to here
LVM2.2.03.36/lib/label/hints.c:996:20: branch_false: following ‘false’ branch (when ‘newhints != 4’)...
LVM2.2.03.36/lib/label/hints.c:1000:9: branch_false: ...to here
LVM2.2.03.36/lib/label/hints.c:1002:20: acquire_memory: allocated here
LVM2.2.03.36/lib/label/hints.c:1002:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/label/hints.c:1007:13: branch_false: ...to here
LVM2.2.03.36/lib/label/hints.c:1009:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/label/hints.c:1024:9: branch_false: following ‘false’ branch...
 branch_false: ...to here
LVM2.2.03.36/lib/label/hints.c:1028:9: branch_false: following ‘false’ branch...
 branch_false: ...to here
LVM2.2.03.36/lib/label/hints.c:1051:12: branch_false: following ‘false’ branch...
 branch_false: ...to here
LVM2.2.03.36/lib/label/hints.c:1116:9: danger: ‘fopen(&_hints_file, "w")’ leaks here; was allocated at [(5)](sarif:/runs/0/results/73/codeFlows/0/threadFlows/0/locations/4)
# 1114|   
# 1115|   	fprintf(fp, "devs_hash: %u %u\n", hash, count);
# 1116|-> 	dev_iter_destroy(iter);
# 1117|   
# 1118|    out_flush:

Error: GCC_ANALYZER_WARNING (CWE-775): [#def439]
LVM2.2.03.36/lib/label/hints.c:1119:13: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(&_hints_file, "w")’
LVM2.2.03.36/lib/label/hints.c:981:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/label/hints.c:985:13: branch_false: ...to here
LVM2.2.03.36/lib/label/hints.c:996:20: branch_false: following ‘false’ branch (when ‘newhints != 4’)...
LVM2.2.03.36/lib/label/hints.c:1000:9: branch_false: ...to here
LVM2.2.03.36/lib/label/hints.c:1002:20: acquire_resource: opened here
LVM2.2.03.36/lib/label/hints.c:1002:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/label/hints.c:1007:13: branch_false: ...to here
LVM2.2.03.36/lib/label/hints.c:1119:13: danger: ‘fopen(&_hints_file, "w")’ leaks here; was opened at [(5)](sarif:/runs/0/results/74/codeFlows/0/threadFlows/0/locations/4)
# 1117|   
# 1118|    out_flush:
# 1119|-> 	if (fflush(fp))
# 1120|   		stack;
# 1121|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def440]
LVM2.2.03.36/lib/label/hints.c:1119:13: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(&_hints_file, "w")’
LVM2.2.03.36/lib/label/hints.c:981:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/label/hints.c:985:13: branch_false: ...to here
LVM2.2.03.36/lib/label/hints.c:996:20: branch_false: following ‘false’ branch (when ‘newhints != 4’)...
LVM2.2.03.36/lib/label/hints.c:1000:9: branch_false: ...to here
LVM2.2.03.36/lib/label/hints.c:1002:20: acquire_memory: allocated here
LVM2.2.03.36/lib/label/hints.c:1002:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/label/hints.c:1007:13: branch_false: ...to here
LVM2.2.03.36/lib/label/hints.c:1119:13: danger: ‘fopen(&_hints_file, "w")’ leaks here; was allocated at [(5)](sarif:/runs/0/results/75/codeFlows/0/threadFlows/0/locations/4)
# 1117|   
# 1118|    out_flush:
# 1119|-> 	if (fflush(fp))
# 1120|   		stack;
# 1121|   

Error: GCC_ANALYZER_WARNING (CWE-775): [#def441]
LVM2.2.03.36/lib/label/hints.c:1120:17: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(&_hints_file, "w")’
LVM2.2.03.36/lib/label/hints.c:981:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/label/hints.c:985:13: branch_false: ...to here
LVM2.2.03.36/lib/label/hints.c:996:20: branch_false: following ‘false’ branch (when ‘newhints != 4’)...
LVM2.2.03.36/lib/label/hints.c:1000:9: branch_false: ...to here
LVM2.2.03.36/lib/label/hints.c:1002:20: acquire_resource: opened here
LVM2.2.03.36/lib/label/hints.c:1002:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/label/hints.c:1007:13: branch_false: ...to here
LVM2.2.03.36/lib/label/hints.c:1119:12: branch_true: following ‘true’ branch...
LVM2.2.03.36/lib/label/hints.c:1120:17: branch_true: ...to here
LVM2.2.03.36/lib/label/hints.c:1120:17: danger: ‘fopen(&_hints_file, "w")’ leaks here; was opened at [(5)](sarif:/runs/0/results/76/codeFlows/0/threadFlows/0/locations/4)
# 1118|    out_flush:
# 1119|   	if (fflush(fp))
# 1120|-> 		stack;
# 1121|   
# 1122|   	log_debug("Wrote hint file with devs_hash %u count %u", hash, count);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def442]
LVM2.2.03.36/lib/label/hints.c:1120:17: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(&_hints_file, "w")’
LVM2.2.03.36/lib/label/hints.c:981:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/label/hints.c:985:13: branch_false: ...to here
LVM2.2.03.36/lib/label/hints.c:996:20: branch_false: following ‘false’ branch (when ‘newhints != 4’)...
LVM2.2.03.36/lib/label/hints.c:1000:9: branch_false: ...to here
LVM2.2.03.36/lib/label/hints.c:1002:20: acquire_memory: allocated here
LVM2.2.03.36/lib/label/hints.c:1002:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/label/hints.c:1007:13: branch_false: ...to here
LVM2.2.03.36/lib/label/hints.c:1119:12: branch_true: following ‘true’ branch...
LVM2.2.03.36/lib/label/hints.c:1120:17: branch_true: ...to here
LVM2.2.03.36/lib/label/hints.c:1120:17: danger: ‘fopen(&_hints_file, "w")’ leaks here; was allocated at [(5)](sarif:/runs/0/results/77/codeFlows/0/threadFlows/0/locations/4)
# 1118|    out_flush:
# 1119|   	if (fflush(fp))
# 1120|-> 		stack;
# 1121|   
# 1122|   	log_debug("Wrote hint file with devs_hash %u count %u", hash, count);

Error: GCC_ANALYZER_WARNING (CWE-775): [#def443]
LVM2.2.03.36/lib/label/hints.c:1122:9: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(&_hints_file, "w")’
LVM2.2.03.36/lib/label/hints.c:981:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/label/hints.c:985:13: branch_false: ...to here
LVM2.2.03.36/lib/label/hints.c:996:20: branch_false: following ‘false’ branch (when ‘newhints != 4’)...
LVM2.2.03.36/lib/label/hints.c:1000:9: branch_false: ...to here
LVM2.2.03.36/lib/label/hints.c:1002:20: acquire_resource: opened here
LVM2.2.03.36/lib/label/hints.c:1002:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/label/hints.c:1007:13: branch_false: ...to here
LVM2.2.03.36/lib/label/hints.c:1122:9: danger: ‘fopen(&_hints_file, "w")’ leaks here; was opened at [(5)](sarif:/runs/0/results/78/codeFlows/0/threadFlows/0/locations/4)
# 1120|   		stack;
# 1121|   
# 1122|-> 	log_debug("Wrote hint file with devs_hash %u count %u", hash, count);
# 1123|   
# 1124|   	/*

Error: GCC_ANALYZER_WARNING (CWE-401): [#def444]
LVM2.2.03.36/lib/label/hints.c:1122:9: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(&_hints_file, "w")’
LVM2.2.03.36/lib/label/hints.c:981:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/label/hints.c:985:13: branch_false: ...to here
LVM2.2.03.36/lib/label/hints.c:996:20: branch_false: following ‘false’ branch (when ‘newhints != 4’)...
LVM2.2.03.36/lib/label/hints.c:1000:9: branch_false: ...to here
LVM2.2.03.36/lib/label/hints.c:1002:20: acquire_memory: allocated here
LVM2.2.03.36/lib/label/hints.c:1002:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/label/hints.c:1007:13: branch_false: ...to here
LVM2.2.03.36/lib/label/hints.c:1122:9: danger: ‘fopen(&_hints_file, "w")’ leaks here; was allocated at [(5)](sarif:/runs/0/results/79/codeFlows/0/threadFlows/0/locations/4)
# 1120|   		stack;
# 1121|   
# 1122|-> 	log_debug("Wrote hint file with devs_hash %u count %u", hash, count);
# 1123|   
# 1124|   	/*

Error: GCC_ANALYZER_WARNING (CWE-401): [#def445]
LVM2.2.03.36/lib/label/label.c:1735:9: warning[-Wanalyzer-malloc-leak]: leak of ‘calloc(1, 24)’
LVM2.2.03.36/lib/label/label.c:1725:5: enter_function: entry to ‘label_scan_dev’
LVM2.2.03.36/lib/label/label.c:1732:22: call_function: inlined call to ‘zalloc’ from ‘label_scan_dev’
LVM2.2.03.36/lib/label/label.c:1732:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/label/label.c:1734:9: branch_false: ...to here
LVM2.2.03.36/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): [#def446]
LVM2.2.03.36/lib/label/label.c:1736:9: warning[-Wanalyzer-malloc-leak]: leak of ‘calloc(1, 24)’
LVM2.2.03.36/lib/label/label.c:1725:5: enter_function: entry to ‘label_scan_dev’
LVM2.2.03.36/lib/label/label.c:1732:22: call_function: inlined call to ‘zalloc’ from ‘label_scan_dev’
LVM2.2.03.36/lib/label/label.c:1732:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/label/label.c:1734:9: branch_false: ...to here
LVM2.2.03.36/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): [#def447]
LVM2.2.03.36/lib/locking/lvmlockd.c:226:9: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
LVM2.2.03.36/lib/locking/lvmlockd.c:804:12: enter_function: entry to ‘_init_vg’
LVM2.2.03.36/lib/locking/lvmlockd.c:818:17: call_function: calling ‘_lockd_send_with_pvs’ from ‘_init_vg’
#  224|   
#  225|   	va_start(ap, lock_pvs);
#  226|-> 	daemon_request_extend_v(req, ap);
#  227|   	va_end(ap);
#  228|   

Error: GCC_ANALYZER_WARNING (CWE-404): [#def448]
LVM2.2.03.36/lib/log/log.c:582:17: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
LVM2.2.03.36/lib/log/log.c:799:6: enter_function: entry to ‘print_log’
LVM2.2.03.36/lib/log/log.c:804:9: acquire_resource: ‘va_start’ called here
LVM2.2.03.36/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): [#def449]
LVM2.2.03.36/lib/log/log.c:729:29: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
LVM2.2.03.36/lib/log/log.c:809:6: enter_function: entry to ‘print_log_libdm’
LVM2.2.03.36/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): [#def450]
LVM2.2.03.36/lib/log/log.c:741:40: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
LVM2.2.03.36/lib/log/log.c:809:6: enter_function: entry to ‘print_log_libdm’
LVM2.2.03.36/lib/log/log.c:827:9: call_function: calling ‘_vprint_log’ from ‘print_log_libdm’
#  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): [#def451]
LVM2.2.03.36/lib/log/log.c:791:17: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
LVM2.2.03.36/lib/log/log.c:809:6: enter_function: entry to ‘print_log_libdm’
LVM2.2.03.36/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: GCC_ANALYZER_WARNING (CWE-121): [#def452]
LVM2.2.03.36/lib/metadata/mirror.c:1680:9: warning[-Wanalyzer-out-of-bounds]: stack-based buffer overflow
LVM2.2.03.36/lib/metadata/mirror.c:1817:5: enter_function: entry to ‘add_mirror_log’
LVM2.2.03.36/lib/metadata/mirror.c:1830:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/metadata/mirror.c:1835:18: branch_false: ...to here
LVM2.2.03.36/lib/metadata/mirror.c:1837:12: branch_false: following ‘false’ branch (when ‘old_log_count != log_count’)...
LVM2.2.03.36/lib/metadata/mirror.c:1844:12: branch_false: ...to here
LVM2.2.03.36/lib/metadata/mirror.c:1853:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/metadata/mirror.c:1856:25: branch_false: ...to here
LVM2.2.03.36/lib/metadata/mirror.c:1856:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/metadata/mirror.c:1859:13: branch_false: ...to here
LVM2.2.03.36/lib/metadata/mirror.c:1867:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/metadata/mirror.c:1875:12: branch_false: ...to here
LVM2.2.03.36/lib/metadata/mirror.c:1875:12: branch_true: following ‘true’ branch (when ‘old_log_count != 0’)...
LVM2.2.03.36/lib/metadata/mirror.c:1877:22: branch_true: ...to here
LVM2.2.03.36/lib/metadata/mirror.c:1877:22: call_function: calling ‘_form_mirror’ from ‘add_mirror_log’
# 1678|   	 */
# 1679|   	img_lvs = alloca(sizeof(*img_lvs) * (mirrors + 1));
# 1680|-> 	memset(img_lvs, 0, sizeof(*img_lvs) * mirrors);
# 1681|   
# 1682|   	if (!_create_mimage_lvs(ah, mirrors, stripes, stripe_size, lv, img_lvs, log))

Error: GCC_ANALYZER_WARNING (CWE-401): [#def453]
LVM2.2.03.36/lib/metadata/thin_manip.c:505:16: warning[-Wanalyzer-malloc-leak]: leak of ‘tmpfile()’
LVM2.2.03.36/lib/metadata/thin_manip.c:483:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/metadata/thin_manip.c:490:14: branch_false: ...to here
LVM2.2.03.36/lib/metadata/thin_manip.c:490:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/metadata/thin_manip.c:493:13: branch_false: ...to here
LVM2.2.03.36/lib/metadata/thin_manip.c:493:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/metadata/thin_manip.c:499:19: branch_false: ...to here
LVM2.2.03.36/lib/metadata/thin_manip.c:499:19: acquire_memory: allocated here
LVM2.2.03.36/lib/metadata/thin_manip.c:499:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/metadata/thin_manip.c:505:16: branch_false: ...to here
LVM2.2.03.36/lib/metadata/thin_manip.c:505:16: danger: ‘tmpfile()’ leaks here; was allocated at [(7)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/6)
#  503|   
#  504|   	/* Build path for 'thin_restore' app with this 'hidden/deleted' tmpfile */
#  505|-> 	(void) dm_snprintf(md_path, sizeof(md_path), "%s/%u/fd/%u",
#  506|   			   cmd->proc_dir, getpid(), fileno(f));
#  507|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def454]
LVM2.2.03.36/lib/metadata/thin_manip.c:514:16: warning[-Wanalyzer-malloc-leak]: leak of ‘tmpfile()’
LVM2.2.03.36/lib/metadata/thin_manip.c:483:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/metadata/thin_manip.c:490:14: branch_false: ...to here
LVM2.2.03.36/lib/metadata/thin_manip.c:490:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/metadata/thin_manip.c:493:13: branch_false: ...to here
LVM2.2.03.36/lib/metadata/thin_manip.c:493:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/metadata/thin_manip.c:499:19: branch_false: ...to here
LVM2.2.03.36/lib/metadata/thin_manip.c:499:19: acquire_memory: allocated here
LVM2.2.03.36/lib/metadata/thin_manip.c:499:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/metadata/thin_manip.c:505:16: branch_false: ...to here
LVM2.2.03.36/lib/metadata/thin_manip.c:514:16: danger: ‘tmpfile()’ leaks here; was allocated at [(7)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/6)
#  512|   	argv[++args] = lv_path;
#  513|   
#  514|-> 	(void) dm_snprintf(buffer, sizeof(buffer),
#  515|   			   "<superblock uuid=\"\" time=\"0\" transaction=\"1\" version=\"2\" data_block_size=\"%u\" nr_data_blocks=\"" FMTu64 "\">\n"
#  516|   			   " <device dev_id=\"1\" mapped_blocks=\"" FMTu64 "\" transaction=\"0\" creation_time=\"0\" snap_time=\"0\">\n"

Error: GCC_ANALYZER_WARNING (CWE-401): [#def455]
LVM2.2.03.36/lib/metadata/thin_manip.c:520:9: warning[-Wanalyzer-malloc-leak]: leak of ‘tmpfile()’
LVM2.2.03.36/lib/metadata/thin_manip.c:483:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/metadata/thin_manip.c:490:14: branch_false: ...to here
LVM2.2.03.36/lib/metadata/thin_manip.c:490:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/metadata/thin_manip.c:493:13: branch_false: ...to here
LVM2.2.03.36/lib/metadata/thin_manip.c:493:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/metadata/thin_manip.c:499:19: branch_false: ...to here
LVM2.2.03.36/lib/metadata/thin_manip.c:499:19: acquire_memory: allocated here
LVM2.2.03.36/lib/metadata/thin_manip.c:499:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/metadata/thin_manip.c:505:16: branch_false: ...to here
LVM2.2.03.36/lib/metadata/thin_manip.c:520:9: danger: ‘tmpfile()’ leaks here; was allocated at [(7)](sarif:/runs/0/results/2/codeFlows/0/threadFlows/0/locations/6)
#  518|   			   " </device>\n</superblock>", chunk_size, data_length, data_blocks, data_begin, data_length);
#  519|   
#  520|-> 	log_debug("Preparing thin-pool metadata with thin volume mapping:\n%s", buffer);
#  521|   
#  522|   	if (fputs(buffer, f) < 0)

Error: GCC_ANALYZER_WARNING (CWE-401): [#def456]
LVM2.2.03.36/lib/metadata/thin_manip.c:523:17: warning[-Wanalyzer-malloc-leak]: leak of ‘tmpfile()’
LVM2.2.03.36/lib/metadata/thin_manip.c:483:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/metadata/thin_manip.c:490:14: branch_false: ...to here
LVM2.2.03.36/lib/metadata/thin_manip.c:490:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/metadata/thin_manip.c:493:13: branch_false: ...to here
LVM2.2.03.36/lib/metadata/thin_manip.c:493:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/metadata/thin_manip.c:499:19: branch_false: ...to here
LVM2.2.03.36/lib/metadata/thin_manip.c:499:19: acquire_memory: allocated here
LVM2.2.03.36/lib/metadata/thin_manip.c:499:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/metadata/thin_manip.c:505:16: branch_false: ...to here
LVM2.2.03.36/lib/metadata/thin_manip.c:522:12: branch_true: following ‘true’ branch...
LVM2.2.03.36/lib/metadata/thin_manip.c:523:17: branch_true: ...to here
LVM2.2.03.36/lib/metadata/thin_manip.c:523:17: danger: ‘tmpfile()’ leaks here; was allocated at [(7)](sarif:/runs/0/results/3/codeFlows/0/threadFlows/0/locations/6)
#  521|   
#  522|   	if (fputs(buffer, f) < 0)
#  523|-> 		log_sys_error("fputs", md_path);
#  524|   	else if (fflush(f))
#  525|   		log_sys_error("fflush", md_path);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def457]
LVM2.2.03.36/lib/metadata/thin_manip.c:524:18: warning[-Wanalyzer-malloc-leak]: leak of ‘tmpfile()’
LVM2.2.03.36/lib/metadata/thin_manip.c:483:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/metadata/thin_manip.c:490:14: branch_false: ...to here
LVM2.2.03.36/lib/metadata/thin_manip.c:490:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/metadata/thin_manip.c:493:13: branch_false: ...to here
LVM2.2.03.36/lib/metadata/thin_manip.c:493:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/metadata/thin_manip.c:499:19: branch_false: ...to here
LVM2.2.03.36/lib/metadata/thin_manip.c:499:19: acquire_memory: allocated here
LVM2.2.03.36/lib/metadata/thin_manip.c:499:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/metadata/thin_manip.c:505:16: branch_false: ...to here
LVM2.2.03.36/lib/metadata/thin_manip.c:522:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/metadata/thin_manip.c:524:18: branch_false: ...to here
LVM2.2.03.36/lib/metadata/thin_manip.c:524:18: danger: ‘tmpfile()’ leaks here; was allocated at [(7)](sarif:/runs/0/results/4/codeFlows/0/threadFlows/0/locations/6)
#  522|   	if (fputs(buffer, f) < 0)
#  523|   		log_sys_error("fputs", md_path);
#  524|-> 	else if (fflush(f))
#  525|   		log_sys_error("fflush", md_path);
#  526|   	else if (!(r = exec_cmd(cmd, argv, &status, 1)))

Error: GCC_ANALYZER_WARNING (CWE-401): [#def458]
LVM2.2.03.36/lib/metadata/thin_manip.c:525:17: warning[-Wanalyzer-malloc-leak]: leak of ‘tmpfile()’
LVM2.2.03.36/lib/metadata/thin_manip.c:483:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/metadata/thin_manip.c:490:14: branch_false: ...to here
LVM2.2.03.36/lib/metadata/thin_manip.c:490:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/metadata/thin_manip.c:493:13: branch_false: ...to here
LVM2.2.03.36/lib/metadata/thin_manip.c:493:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/metadata/thin_manip.c:499:19: branch_false: ...to here
LVM2.2.03.36/lib/metadata/thin_manip.c:499:19: acquire_memory: allocated here
LVM2.2.03.36/lib/metadata/thin_manip.c:499:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/metadata/thin_manip.c:505:16: branch_false: ...to here
LVM2.2.03.36/lib/metadata/thin_manip.c:522:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/metadata/thin_manip.c:524:18: branch_false: ...to here
LVM2.2.03.36/lib/metadata/thin_manip.c:524:17: branch_true: following ‘true’ branch...
LVM2.2.03.36/lib/metadata/thin_manip.c:525:17: branch_true: ...to here
LVM2.2.03.36/lib/metadata/thin_manip.c:525:17: danger: ‘tmpfile()’ leaks here; was allocated at [(7)](sarif:/runs/0/results/5/codeFlows/0/threadFlows/0/locations/6)
#  523|   		log_sys_error("fputs", md_path);
#  524|   	else if (fflush(f))
#  525|-> 		log_sys_error("fflush", md_path);
#  526|   	else if (!(r = exec_cmd(cmd, argv, &status, 1)))
#  527|   		stack;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def459]
LVM2.2.03.36/lib/metadata/thin_manip.c:526:24: warning[-Wanalyzer-malloc-leak]: leak of ‘tmpfile()’
LVM2.2.03.36/lib/metadata/thin_manip.c:483:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/metadata/thin_manip.c:490:14: branch_false: ...to here
LVM2.2.03.36/lib/metadata/thin_manip.c:490:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/metadata/thin_manip.c:493:13: branch_false: ...to here
LVM2.2.03.36/lib/metadata/thin_manip.c:493:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/metadata/thin_manip.c:499:19: branch_false: ...to here
LVM2.2.03.36/lib/metadata/thin_manip.c:499:19: acquire_memory: allocated here
LVM2.2.03.36/lib/metadata/thin_manip.c:499:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/metadata/thin_manip.c:505:16: branch_false: ...to here
LVM2.2.03.36/lib/metadata/thin_manip.c:522:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/metadata/thin_manip.c:524:18: branch_false: ...to here
LVM2.2.03.36/lib/metadata/thin_manip.c:524:17: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/metadata/thin_manip.c:526:24: branch_false: ...to here
LVM2.2.03.36/lib/metadata/thin_manip.c:526:24: danger: ‘tmpfile()’ leaks here; was allocated at [(7)](sarif:/runs/0/results/6/codeFlows/0/threadFlows/0/locations/6)
#  524|   	else if (fflush(f))
#  525|   		log_sys_error("fflush", md_path);
#  526|-> 	else if (!(r = exec_cmd(cmd, argv, &status, 1)))
#  527|   		stack;
#  528|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def460]
LVM2.2.03.36/lib/metadata/thin_manip.c:527:17: warning[-Wanalyzer-malloc-leak]: leak of ‘tmpfile()’
LVM2.2.03.36/lib/metadata/thin_manip.c:483:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/metadata/thin_manip.c:490:14: branch_false: ...to here
LVM2.2.03.36/lib/metadata/thin_manip.c:490:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/metadata/thin_manip.c:493:13: branch_false: ...to here
LVM2.2.03.36/lib/metadata/thin_manip.c:493:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/metadata/thin_manip.c:499:19: branch_false: ...to here
LVM2.2.03.36/lib/metadata/thin_manip.c:499:19: acquire_memory: allocated here
LVM2.2.03.36/lib/metadata/thin_manip.c:499:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/metadata/thin_manip.c:505:16: branch_false: ...to here
LVM2.2.03.36/lib/metadata/thin_manip.c:522:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/metadata/thin_manip.c:524:18: branch_false: ...to here
LVM2.2.03.36/lib/metadata/thin_manip.c:524:17: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/metadata/thin_manip.c:526:24: branch_false: ...to here
LVM2.2.03.36/lib/metadata/thin_manip.c:526:17: branch_true: following ‘true’ branch...
LVM2.2.03.36/lib/metadata/thin_manip.c:527:17: branch_true: ...to here
LVM2.2.03.36/lib/metadata/thin_manip.c:527:17: danger: ‘tmpfile()’ leaks here; was allocated at [(7)](sarif:/runs/0/results/7/codeFlows/0/threadFlows/0/locations/6)
#  525|   		log_sys_error("fflush", md_path);
#  526|   	else if (!(r = exec_cmd(cmd, argv, &status, 1)))
#  527|-> 		stack;
#  528|   
#  529|   	if (fclose(f))

Error: GCC_ANALYZER_WARNING (CWE-775): [#def461]
LVM2.2.03.36/lib/metadata/vdo_manip.c:188:17: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘fd’
LVM2.2.03.36/lib/metadata/vdo_manip.c:167:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/metadata/vdo_manip.c:173:19: branch_false: ...to here
LVM2.2.03.36/lib/metadata/vdo_manip.c:173:19: acquire_resource: opened here
LVM2.2.03.36/lib/metadata/vdo_manip.c:173:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/metadata/vdo_manip.c:187:21: branch_false: ...to here
LVM2.2.03.36/lib/metadata/vdo_manip.c:187:12: branch_true: following ‘true’ branch (when ‘size < 0’)...
LVM2.2.03.36/lib/metadata/vdo_manip.c:188:17: branch_true: ...to here
LVM2.2.03.36/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): [#def462]
LVM2.2.03.36/lib/metadata/vdo_manip.c:195:17: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘fd’
LVM2.2.03.36/lib/metadata/vdo_manip.c:167:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/metadata/vdo_manip.c:173:19: branch_false: ...to here
LVM2.2.03.36/lib/metadata/vdo_manip.c:173:19: acquire_resource: opened here
LVM2.2.03.36/lib/metadata/vdo_manip.c:173:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/metadata/vdo_manip.c:187:21: branch_false: ...to here
LVM2.2.03.36/lib/metadata/vdo_manip.c:187:12: branch_false: following ‘false’ branch (when ‘size >= 0’)...
LVM2.2.03.36/lib/metadata/vdo_manip.c:191:9: branch_false: ...to here
LVM2.2.03.36/lib/metadata/vdo_manip.c:194:12: branch_true: following ‘true’ branch...
LVM2.2.03.36/lib/metadata/vdo_manip.c:195:17: branch_true: ...to here
LVM2.2.03.36/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): [#def463]
LVM2.2.03.36/lib/metadata/vdo_manip.c:201:24: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘fd’
LVM2.2.03.36/lib/metadata/vdo_manip.c:167:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/metadata/vdo_manip.c:173:19: branch_false: ...to here
LVM2.2.03.36/lib/metadata/vdo_manip.c:173:19: acquire_resource: opened here
LVM2.2.03.36/lib/metadata/vdo_manip.c:173:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/metadata/vdo_manip.c:187:21: branch_false: ...to here
LVM2.2.03.36/lib/metadata/vdo_manip.c:187:12: branch_false: following ‘false’ branch (when ‘size >= 0’)...
LVM2.2.03.36/lib/metadata/vdo_manip.c:191:9: branch_false: ...to here
LVM2.2.03.36/lib/metadata/vdo_manip.c:194:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/metadata/vdo_manip.c:200:1: branch_false: ...to here
LVM2.2.03.36/lib/metadata/vdo_manip.c:201:12: branch_true: following ‘true’ branch (when ‘fd >= 0’)...
LVM2.2.03.36/lib/metadata/vdo_manip.c:201:24: branch_true: ...to here
LVM2.2.03.36/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): [#def464]
LVM2.2.03.36/lib/metadata/vdo_manip.c:713:17: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(&proc_meminfo, "r")’
LVM2.2.03.36/lib/metadata/vdo_manip.c:701:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/metadata/vdo_manip.c:703:20: branch_false: ...to here
LVM2.2.03.36/lib/metadata/vdo_manip.c:703:20: acquire_resource: opened here
LVM2.2.03.36/lib/metadata/vdo_manip.c:701:13: branch_false: following ‘false’ branch...
 branch_false: ...to here
LVM2.2.03.36/lib/metadata/vdo_manip.c:706:16: branch_true: following ‘true’ branch...
LVM2.2.03.36/lib/metadata/vdo_manip.c:707:27: branch_true: ...to here
LVM2.2.03.36/lib/metadata/vdo_manip.c:707:20: branch_false: following ‘false’ branch (when ‘e’ is non-NULL)...
LVM2.2.03.36/lib/metadata/vdo_manip.c:710:20: branch_false: ...to here
LVM2.2.03.36/lib/metadata/vdo_manip.c:710:20: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/metadata/vdo_manip.c:713:17: branch_false: ...to here
LVM2.2.03.36/lib/metadata/vdo_manip.c:713:17: danger: ‘fopen(&proc_meminfo, "r")’ leaks here; was opened at [(3)](sarif:/runs/0/results/3/codeFlows/0/threadFlows/0/locations/2)
#  711|   			continue; // something too long
#  712|   
#  713|-> 		dm_strncpy((char*)findme.name, line, e - line);
#  714|   
#  715|   		found = bsearch(&findme, mt, DM_ARRAY_SIZE(mt), sizeof(mem_table_t),

Error: GCC_ANALYZER_WARNING (CWE-401): [#def465]
LVM2.2.03.36/lib/metadata/vdo_manip.c:713:17: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(&proc_meminfo, "r")’
LVM2.2.03.36/lib/metadata/vdo_manip.c:701:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/metadata/vdo_manip.c:703:20: branch_false: ...to here
LVM2.2.03.36/lib/metadata/vdo_manip.c:703:20: acquire_memory: allocated here
LVM2.2.03.36/lib/metadata/vdo_manip.c:701:13: branch_false: following ‘false’ branch...
 branch_false: ...to here
LVM2.2.03.36/lib/metadata/vdo_manip.c:706:16: branch_true: following ‘true’ branch...
LVM2.2.03.36/lib/metadata/vdo_manip.c:707:27: branch_true: ...to here
LVM2.2.03.36/lib/metadata/vdo_manip.c:707:20: branch_false: following ‘false’ branch (when ‘e’ is non-NULL)...
LVM2.2.03.36/lib/metadata/vdo_manip.c:710:20: branch_false: ...to here
LVM2.2.03.36/lib/metadata/vdo_manip.c:710:20: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/metadata/vdo_manip.c:713:17: branch_false: ...to here
LVM2.2.03.36/lib/metadata/vdo_manip.c:713:17: danger: ‘fopen(&proc_meminfo, "r")’ leaks here; was allocated at [(3)](sarif:/runs/0/results/4/codeFlows/0/threadFlows/0/locations/2)
#  711|   			continue; // something too long
#  712|   
#  713|-> 		dm_strncpy((char*)findme.name, line, e - line);
#  714|   
#  715|   		found = bsearch(&findme, mt, DM_ARRAY_SIZE(mt), sizeof(mem_table_t),

Error: GCC_ANALYZER_WARNING (CWE-775): [#def466]
LVM2.2.03.36/lib/metadata/vdo_manip.c:724:25: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(&proc_meminfo, "r")’
LVM2.2.03.36/lib/metadata/vdo_manip.c:682:12: enter_function: entry to ‘_get_memory_info’
LVM2.2.03.36/lib/metadata/vdo_manip.c:701:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/metadata/vdo_manip.c:703:20: branch_false: ...to here
LVM2.2.03.36/lib/metadata/vdo_manip.c:703:20: acquire_resource: opened here
LVM2.2.03.36/lib/metadata/vdo_manip.c:701:13: branch_false: following ‘false’ branch...
 branch_false: ...to here
LVM2.2.03.36/lib/metadata/vdo_manip.c:706:16: branch_true: following ‘true’ branch...
LVM2.2.03.36/lib/metadata/vdo_manip.c:707:27: branch_true: ...to here
LVM2.2.03.36/lib/metadata/vdo_manip.c:707:20: branch_false: following ‘false’ branch (when ‘e’ is non-NULL)...
LVM2.2.03.36/lib/metadata/vdo_manip.c:710:20: branch_false: ...to here
LVM2.2.03.36/lib/metadata/vdo_manip.c:710:20: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/metadata/vdo_manip.c:713:17: branch_false: ...to here
LVM2.2.03.36/lib/metadata/vdo_manip.c:715:25: call_function: inlined call to ‘bsearch’ from ‘_get_memory_info’
LVM2.2.03.36/lib/metadata/vdo_manip.c:717:20: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/metadata/vdo_manip.c:720:17: branch_false: ...to here
LVM2.2.03.36/lib/metadata/vdo_manip.c:724:25: danger: ‘fopen(&proc_meminfo, "r")’ leaks here; was opened at [(4)](sarif:/runs/0/results/5/codeFlows/0/threadFlows/0/locations/3)
#  722|   
#  723|   		if ((e == tail) || errno)
#  724|-> 			log_debug("Failing to parse value from %s.", line);
#  725|   		else
#  726|   			log_debug("Parsed %s = " FMTu64 " KiB.", found->name, *(found->value));

Error: GCC_ANALYZER_WARNING (CWE-401): [#def467]
LVM2.2.03.36/lib/metadata/vdo_manip.c:724:25: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(&proc_meminfo, "r")’
LVM2.2.03.36/lib/metadata/vdo_manip.c:682:12: enter_function: entry to ‘_get_memory_info’
LVM2.2.03.36/lib/metadata/vdo_manip.c:701:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/metadata/vdo_manip.c:703:20: branch_false: ...to here
LVM2.2.03.36/lib/metadata/vdo_manip.c:703:20: acquire_memory: allocated here
LVM2.2.03.36/lib/metadata/vdo_manip.c:701:13: branch_false: following ‘false’ branch...
 branch_false: ...to here
LVM2.2.03.36/lib/metadata/vdo_manip.c:706:16: branch_true: following ‘true’ branch...
LVM2.2.03.36/lib/metadata/vdo_manip.c:707:27: branch_true: ...to here
LVM2.2.03.36/lib/metadata/vdo_manip.c:707:20: branch_false: following ‘false’ branch (when ‘e’ is non-NULL)...
LVM2.2.03.36/lib/metadata/vdo_manip.c:710:20: branch_false: ...to here
LVM2.2.03.36/lib/metadata/vdo_manip.c:710:20: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/metadata/vdo_manip.c:713:17: branch_false: ...to here
LVM2.2.03.36/lib/metadata/vdo_manip.c:715:25: call_function: inlined call to ‘bsearch’ from ‘_get_memory_info’
LVM2.2.03.36/lib/metadata/vdo_manip.c:717:20: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/metadata/vdo_manip.c:720:17: branch_false: ...to here
LVM2.2.03.36/lib/metadata/vdo_manip.c:724:25: danger: ‘fopen(&proc_meminfo, "r")’ leaks here; was allocated at [(4)](sarif:/runs/0/results/6/codeFlows/0/threadFlows/0/locations/3)
#  722|   
#  723|   		if ((e == tail) || errno)
#  724|-> 			log_debug("Failing to parse value from %s.", line);
#  725|   		else
#  726|   			log_debug("Parsed %s = " FMTu64 " KiB.", found->name, *(found->value));

Error: GCC_ANALYZER_WARNING (CWE-775): [#def468]
LVM2.2.03.36/lib/metadata/vdo_manip.c:726:25: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(&proc_meminfo, "r")’
LVM2.2.03.36/lib/metadata/vdo_manip.c:682:12: enter_function: entry to ‘_get_memory_info’
LVM2.2.03.36/lib/metadata/vdo_manip.c:701:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/metadata/vdo_manip.c:703:20: branch_false: ...to here
LVM2.2.03.36/lib/metadata/vdo_manip.c:703:20: acquire_resource: opened here
LVM2.2.03.36/lib/metadata/vdo_manip.c:701:13: branch_false: following ‘false’ branch...
 branch_false: ...to here
LVM2.2.03.36/lib/metadata/vdo_manip.c:706:16: branch_true: following ‘true’ branch...
LVM2.2.03.36/lib/metadata/vdo_manip.c:707:27: branch_true: ...to here
LVM2.2.03.36/lib/metadata/vdo_manip.c:707:20: branch_false: following ‘false’ branch (when ‘e’ is non-NULL)...
LVM2.2.03.36/lib/metadata/vdo_manip.c:710:20: branch_false: ...to here
LVM2.2.03.36/lib/metadata/vdo_manip.c:710:20: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/metadata/vdo_manip.c:713:17: branch_false: ...to here
LVM2.2.03.36/lib/metadata/vdo_manip.c:715:25: call_function: inlined call to ‘bsearch’ from ‘_get_memory_info’
LVM2.2.03.36/lib/metadata/vdo_manip.c:717:20: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/metadata/vdo_manip.c:720:17: branch_false: ...to here
LVM2.2.03.36/lib/metadata/vdo_manip.c:723:20: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/metadata/vdo_manip.c:726:25: danger: ‘fopen(&proc_meminfo, "r")’ leaks here; was opened at [(4)](sarif:/runs/0/results/7/codeFlows/0/threadFlows/0/locations/3)
#  724|   			log_debug("Failing to parse value from %s.", line);
#  725|   		else
#  726|-> 			log_debug("Parsed %s = " FMTu64 " KiB.", found->name, *(found->value));
#  727|   	}
#  728|   	(void)fclose(fp);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def469]
LVM2.2.03.36/lib/metadata/vdo_manip.c:726:25: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(&proc_meminfo, "r")’
LVM2.2.03.36/lib/metadata/vdo_manip.c:682:12: enter_function: entry to ‘_get_memory_info’
LVM2.2.03.36/lib/metadata/vdo_manip.c:701:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/metadata/vdo_manip.c:703:20: branch_false: ...to here
LVM2.2.03.36/lib/metadata/vdo_manip.c:703:20: acquire_memory: allocated here
LVM2.2.03.36/lib/metadata/vdo_manip.c:701:13: branch_false: following ‘false’ branch...
 branch_false: ...to here
LVM2.2.03.36/lib/metadata/vdo_manip.c:706:16: branch_true: following ‘true’ branch...
LVM2.2.03.36/lib/metadata/vdo_manip.c:707:27: branch_true: ...to here
LVM2.2.03.36/lib/metadata/vdo_manip.c:707:20: branch_false: following ‘false’ branch (when ‘e’ is non-NULL)...
LVM2.2.03.36/lib/metadata/vdo_manip.c:710:20: branch_false: ...to here
LVM2.2.03.36/lib/metadata/vdo_manip.c:710:20: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/metadata/vdo_manip.c:713:17: branch_false: ...to here
LVM2.2.03.36/lib/metadata/vdo_manip.c:715:25: call_function: inlined call to ‘bsearch’ from ‘_get_memory_info’
LVM2.2.03.36/lib/metadata/vdo_manip.c:717:20: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/metadata/vdo_manip.c:720:17: branch_false: ...to here
LVM2.2.03.36/lib/metadata/vdo_manip.c:723:20: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/metadata/vdo_manip.c:726:25: danger: ‘fopen(&proc_meminfo, "r")’ leaks here; was allocated at [(4)](sarif:/runs/0/results/8/codeFlows/0/threadFlows/0/locations/3)
#  724|   			log_debug("Failing to parse value from %s.", line);
#  725|   		else
#  726|-> 			log_debug("Parsed %s = " FMTu64 " KiB.", found->name, *(found->value));
#  727|   	}
#  728|   	(void)fclose(fp);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def470]
LVM2.2.03.36/lib/mirror/mirrored.c:531:24: warning[-Wanalyzer-malloc-leak]: leak of ‘calloc(1, 72)’
LVM2.2.03.36/lib/mirror/mirrored.c:514:22: enter_function: entry to ‘init_mirrored_segtype’
LVM2.2.03.36/lib/mirror/mirrored.c:520:40: call_function: inlined call to ‘zalloc’ from ‘init_mirrored_segtype’
LVM2.2.03.36/lib/mirror/mirrored.c:522:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/mirror/mirrored.c:525:9: branch_false: ...to here
LVM2.2.03.36/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): [#def471]
LVM2.2.03.36/lib/mirror/mirrored.c:538:9: warning[-Wanalyzer-malloc-leak]: leak of ‘calloc(1, 72)’
LVM2.2.03.36/lib/mirror/mirrored.c:514:22: enter_function: entry to ‘init_mirrored_segtype’
LVM2.2.03.36/lib/mirror/mirrored.c:520:40: call_function: inlined call to ‘zalloc’ from ‘init_mirrored_segtype’
LVM2.2.03.36/lib/mirror/mirrored.c:522:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/mirror/mirrored.c:525:9: branch_false: ...to here
LVM2.2.03.36/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): [#def472]
LVM2.2.03.36/lib/misc/lvm-exec.c:36:28: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘pipefd[0]’
LVM2.2.03.36/lib/misc/lvm-exec.c:147:7: enter_function: entry to ‘pipe_open’
LVM2.2.03.36/lib/misc/lvm-exec.c:160:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/misc/lvm-exec.c:165:9: branch_false: ...to here
LVM2.2.03.36/lib/misc/lvm-exec.c:165: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): [#def473]
LVM2.2.03.36/lib/misc/lvm-exec.c:36:28: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘pipefd[1]’
LVM2.2.03.36/lib/misc/lvm-exec.c:147:7: enter_function: entry to ‘pipe_open’
LVM2.2.03.36/lib/misc/lvm-exec.c:160:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/misc/lvm-exec.c:165:9: branch_false: ...to here
LVM2.2.03.36/lib/misc/lvm-exec.c:165: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): [#def474]
LVM2.2.03.36/lib/misc/lvm-exec.c:122:24: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘pipefd[0]’
LVM2.2.03.36/lib/misc/lvm-exec.c:147:7: enter_function: entry to ‘pipe_open’
LVM2.2.03.36/lib/misc/lvm-exec.c:160:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/misc/lvm-exec.c:165:9: branch_false: ...to here
LVM2.2.03.36/lib/misc/lvm-exec.c:167:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/misc/lvm-exec.c:176:12: branch_false: ...to here
LVM2.2.03.36/lib/misc/lvm-exec.c:176:12: branch_true: following ‘true’ branch...
LVM2.2.03.36/lib/misc/lvm-exec.c:178:22: branch_true: ...to here
LVM2.2.03.36/lib/misc/lvm-exec.c:178:22: call_function: calling ‘_reopen_fd_to_null’ from ‘pipe_open’
#  120|   	int r = 0;
#  121|   
#  122|-> 	if ((null_fd = open("/dev/null", O_RDWR)) == -1) {
#  123|   		log_sys_error("open", "/dev/null");
#  124|   		return 0;

Error: GCC_ANALYZER_WARNING (CWE-775): [#def475]
LVM2.2.03.36/lib/misc/lvm-exec.c:122:24: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘pipefd[1]’
LVM2.2.03.36/lib/misc/lvm-exec.c:147:7: enter_function: entry to ‘pipe_open’
LVM2.2.03.36/lib/misc/lvm-exec.c:160:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/misc/lvm-exec.c:165:9: branch_false: ...to here
LVM2.2.03.36/lib/misc/lvm-exec.c:167:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/misc/lvm-exec.c:176:12: branch_false: ...to here
LVM2.2.03.36/lib/misc/lvm-exec.c:176:12: branch_true: following ‘true’ branch...
LVM2.2.03.36/lib/misc/lvm-exec.c:178:22: branch_true: ...to here
LVM2.2.03.36/lib/misc/lvm-exec.c:178:22: call_function: calling ‘_reopen_fd_to_null’ from ‘pipe_open’
#  120|   	int r = 0;
#  121|   
#  122|-> 	if ((null_fd = open("/dev/null", O_RDWR)) == -1) {
#  123|   		log_sys_error("open", "/dev/null");
#  124|   		return 0;

Error: GCC_ANALYZER_WARNING (CWE-775): [#def476]
LVM2.2.03.36/lib/misc/lvm-exec.c:123:17: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘pipefd[0]’
LVM2.2.03.36/lib/misc/lvm-exec.c:147:7: enter_function: entry to ‘pipe_open’
LVM2.2.03.36/lib/misc/lvm-exec.c:160:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/misc/lvm-exec.c:165:9: branch_false: ...to here
LVM2.2.03.36/lib/misc/lvm-exec.c:167:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/misc/lvm-exec.c:176:12: branch_false: ...to here
LVM2.2.03.36/lib/misc/lvm-exec.c:176:12: branch_true: following ‘true’ branch...
LVM2.2.03.36/lib/misc/lvm-exec.c:178:22: branch_true: ...to here
LVM2.2.03.36/lib/misc/lvm-exec.c:178:22: call_function: calling ‘_reopen_fd_to_null’ from ‘pipe_open’
#  121|   
#  122|   	if ((null_fd = open("/dev/null", O_RDWR)) == -1) {
#  123|-> 		log_sys_error("open", "/dev/null");
#  124|   		return 0;
#  125|   	}

Error: GCC_ANALYZER_WARNING (CWE-775): [#def477]
LVM2.2.03.36/lib/misc/lvm-exec.c:123:17: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘pipefd[1]’
LVM2.2.03.36/lib/misc/lvm-exec.c:147:7: enter_function: entry to ‘pipe_open’
LVM2.2.03.36/lib/misc/lvm-exec.c:160:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/misc/lvm-exec.c:165:9: branch_false: ...to here
LVM2.2.03.36/lib/misc/lvm-exec.c:167:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/misc/lvm-exec.c:176:12: branch_false: ...to here
LVM2.2.03.36/lib/misc/lvm-exec.c:176:12: branch_true: following ‘true’ branch...
LVM2.2.03.36/lib/misc/lvm-exec.c:178:22: branch_true: ...to here
LVM2.2.03.36/lib/misc/lvm-exec.c:178:22: call_function: calling ‘_reopen_fd_to_null’ from ‘pipe_open’
#  121|   
#  122|   	if ((null_fd = open("/dev/null", O_RDWR)) == -1) {
#  123|-> 		log_sys_error("open", "/dev/null");
#  124|   		return 0;
#  125|   	}

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

Error: GCC_ANALYZER_WARNING (CWE-775): [#def479]
LVM2.2.03.36/lib/misc/lvm-exec.c:127:32: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘pipefd[0]’
LVM2.2.03.36/lib/misc/lvm-exec.c:147:7: enter_function: entry to ‘pipe_open’
LVM2.2.03.36/lib/misc/lvm-exec.c:160:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/misc/lvm-exec.c:165:9: branch_false: ...to here
LVM2.2.03.36/lib/misc/lvm-exec.c:167:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/misc/lvm-exec.c:176:12: branch_false: ...to here
LVM2.2.03.36/lib/misc/lvm-exec.c:176:12: branch_true: following ‘true’ branch...
LVM2.2.03.36/lib/misc/lvm-exec.c:178:22: branch_true: ...to here
LVM2.2.03.36/lib/misc/lvm-exec.c:178:22: call_function: calling ‘_reopen_fd_to_null’ from ‘pipe_open’
#  125|   	}
#  126|   
#  127|-> 	if ((null_fd != fd) && close(fd)) {
#  128|   		log_sys_error("close", "");
#  129|   		goto out;

Error: GCC_ANALYZER_WARNING (CWE-775): [#def480]
LVM2.2.03.36/lib/misc/lvm-exec.c:127:32: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘pipefd[1]’
LVM2.2.03.36/lib/misc/lvm-exec.c:147:7: enter_function: entry to ‘pipe_open’
LVM2.2.03.36/lib/misc/lvm-exec.c:160:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/misc/lvm-exec.c:165:9: branch_false: ...to here
LVM2.2.03.36/lib/misc/lvm-exec.c:167:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/misc/lvm-exec.c:176:12: branch_false: ...to here
LVM2.2.03.36/lib/misc/lvm-exec.c:176:12: branch_true: following ‘true’ branch...
LVM2.2.03.36/lib/misc/lvm-exec.c:178:22: branch_true: ...to here
LVM2.2.03.36/lib/misc/lvm-exec.c:178:22: call_function: calling ‘_reopen_fd_to_null’ from ‘pipe_open’
#  125|   	}
#  126|   
#  127|-> 	if ((null_fd != fd) && close(fd)) {
#  128|   		log_sys_error("close", "");
#  129|   		goto out;

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

Error: GCC_ANALYZER_WARNING (CWE-775): [#def482]
LVM2.2.03.36/lib/misc/lvm-exec.c:128:17: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘pipefd[0]’
LVM2.2.03.36/lib/misc/lvm-exec.c:147:7: enter_function: entry to ‘pipe_open’
LVM2.2.03.36/lib/misc/lvm-exec.c:160:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/misc/lvm-exec.c:165:9: branch_false: ...to here
LVM2.2.03.36/lib/misc/lvm-exec.c:167:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/misc/lvm-exec.c:176:12: branch_false: ...to here
LVM2.2.03.36/lib/misc/lvm-exec.c:176:12: branch_true: following ‘true’ branch...
LVM2.2.03.36/lib/misc/lvm-exec.c:178:22: branch_true: ...to here
LVM2.2.03.36/lib/misc/lvm-exec.c:178:22: call_function: calling ‘_reopen_fd_to_null’ from ‘pipe_open’
#  126|   
#  127|   	if ((null_fd != fd) && close(fd)) {
#  128|-> 		log_sys_error("close", "");
#  129|   		goto out;
#  130|   	}

Error: GCC_ANALYZER_WARNING (CWE-775): [#def483]
LVM2.2.03.36/lib/misc/lvm-exec.c:128:17: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘pipefd[1]’
LVM2.2.03.36/lib/misc/lvm-exec.c:147:7: enter_function: entry to ‘pipe_open’
LVM2.2.03.36/lib/misc/lvm-exec.c:160:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/misc/lvm-exec.c:165:9: branch_false: ...to here
LVM2.2.03.36/lib/misc/lvm-exec.c:167:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/misc/lvm-exec.c:176:12: branch_false: ...to here
LVM2.2.03.36/lib/misc/lvm-exec.c:176:12: branch_true: following ‘true’ branch...
LVM2.2.03.36/lib/misc/lvm-exec.c:178:22: branch_true: ...to here
LVM2.2.03.36/lib/misc/lvm-exec.c:178:22: call_function: calling ‘_reopen_fd_to_null’ from ‘pipe_open’
#  126|   
#  127|   	if ((null_fd != fd) && close(fd)) {
#  128|-> 		log_sys_error("close", "");
#  129|   		goto out;
#  130|   	}

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

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

Error: GCC_ANALYZER_WARNING (CWE-775): [#def486]
LVM2.2.03.36/lib/misc/lvm-exec.c:133:17: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘open("/dev/null", 2)’
LVM2.2.03.36/lib/misc/lvm-exec.c:122:24: acquire_resource: opened here
LVM2.2.03.36/lib/misc/lvm-exec.c:122:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/misc/lvm-exec.c:127:12: branch_false: ...to here
LVM2.2.03.36/lib/misc/lvm-exec.c:127:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/misc/lvm-exec.c:132:13: branch_false: ...to here
LVM2.2.03.36/lib/misc/lvm-exec.c:132:12: branch_true: following ‘true’ branch...
LVM2.2.03.36/lib/misc/lvm-exec.c:133:17: branch_true: ...to here
LVM2.2.03.36/lib/misc/lvm-exec.c:133:17: danger: ‘open("/dev/null", 2)’ leaks here; was opened at [(1)](sarif:/runs/0/results/14/codeFlows/0/threadFlows/0/locations/0)
#  131|   
#  132|   	if (dup2(null_fd, fd) == -1) {
#  133|-> 		log_sys_error("dup2", "");
#  134|   		goto out;
#  135|   	}

Error: GCC_ANALYZER_WARNING (CWE-775): [#def487]
LVM2.2.03.36/lib/misc/lvm-exec.c:133:17: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘pipefd[0]’
LVM2.2.03.36/lib/misc/lvm-exec.c:147:7: enter_function: entry to ‘pipe_open’
LVM2.2.03.36/lib/misc/lvm-exec.c:160:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/misc/lvm-exec.c:165:9: branch_false: ...to here
LVM2.2.03.36/lib/misc/lvm-exec.c:167:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/misc/lvm-exec.c:176:12: branch_false: ...to here
LVM2.2.03.36/lib/misc/lvm-exec.c:176:12: branch_true: following ‘true’ branch...
LVM2.2.03.36/lib/misc/lvm-exec.c:178:22: branch_true: ...to here
LVM2.2.03.36/lib/misc/lvm-exec.c:178:22: call_function: calling ‘_reopen_fd_to_null’ from ‘pipe_open’
#  131|   
#  132|   	if (dup2(null_fd, fd) == -1) {
#  133|-> 		log_sys_error("dup2", "");
#  134|   		goto out;
#  135|   	}

Error: GCC_ANALYZER_WARNING (CWE-775): [#def488]
LVM2.2.03.36/lib/misc/lvm-exec.c:133:17: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘pipefd[1]’
LVM2.2.03.36/lib/misc/lvm-exec.c:147:7: enter_function: entry to ‘pipe_open’
LVM2.2.03.36/lib/misc/lvm-exec.c:160:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/misc/lvm-exec.c:165:9: branch_false: ...to here
LVM2.2.03.36/lib/misc/lvm-exec.c:167:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/misc/lvm-exec.c:176:12: branch_false: ...to here
LVM2.2.03.36/lib/misc/lvm-exec.c:176:12: branch_true: following ‘true’ branch...
LVM2.2.03.36/lib/misc/lvm-exec.c:178:22: branch_true: ...to here
LVM2.2.03.36/lib/misc/lvm-exec.c:178:22: call_function: calling ‘_reopen_fd_to_null’ from ‘pipe_open’
#  131|   
#  132|   	if (dup2(null_fd, fd) == -1) {
#  133|-> 		log_sys_error("dup2", "");
#  134|   		goto out;
#  135|   	}

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

Error: GCC_ANALYZER_WARNING (CWE-775): [#def490]
LVM2.2.03.36/lib/misc/lvm-exec.c:139:13: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘pipefd[0]’
LVM2.2.03.36/lib/misc/lvm-exec.c:147:7: enter_function: entry to ‘pipe_open’
LVM2.2.03.36/lib/misc/lvm-exec.c:160:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/misc/lvm-exec.c:165:9: branch_false: ...to here
LVM2.2.03.36/lib/misc/lvm-exec.c:167:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/misc/lvm-exec.c:176:12: branch_false: ...to here
LVM2.2.03.36/lib/misc/lvm-exec.c:176:12: branch_true: following ‘true’ branch...
LVM2.2.03.36/lib/misc/lvm-exec.c:178:22: branch_true: ...to here
LVM2.2.03.36/lib/misc/lvm-exec.c:178:22: call_function: calling ‘_reopen_fd_to_null’ from ‘pipe_open’
#  137|   	r = 1;
#  138|   out:
#  139|-> 	if (close(null_fd)) {
#  140|   		log_sys_error("dup2", "");
#  141|   		return 0;

Error: GCC_ANALYZER_WARNING (CWE-775): [#def491]
LVM2.2.03.36/lib/misc/lvm-exec.c:139:13: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘pipefd[1]’
LVM2.2.03.36/lib/misc/lvm-exec.c:147:7: enter_function: entry to ‘pipe_open’
LVM2.2.03.36/lib/misc/lvm-exec.c:160:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/misc/lvm-exec.c:165:9: branch_false: ...to here
LVM2.2.03.36/lib/misc/lvm-exec.c:167:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/misc/lvm-exec.c:176:12: branch_false: ...to here
LVM2.2.03.36/lib/misc/lvm-exec.c:176:12: branch_true: following ‘true’ branch...
LVM2.2.03.36/lib/misc/lvm-exec.c:178:22: branch_true: ...to here
LVM2.2.03.36/lib/misc/lvm-exec.c:178:22: call_function: calling ‘_reopen_fd_to_null’ from ‘pipe_open’
#  137|   	r = 1;
#  138|   out:
#  139|-> 	if (close(null_fd)) {
#  140|   		log_sys_error("dup2", "");
#  141|   		return 0;

Error: GCC_ANALYZER_WARNING (CWE-775): [#def492]
LVM2.2.03.36/lib/misc/lvm-exec.c:165:9: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘pipefd[0]’
LVM2.2.03.36/lib/misc/lvm-exec.c:160:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/misc/lvm-exec.c:165:9: branch_false: ...to here
LVM2.2.03.36/lib/misc/lvm-exec.c:165:9: danger: ‘pipefd[0]’ leaks here
#  163|   	}
#  164|   
#  165|-> 	log_verbose("Piping:%s", _verbose_args(argv, buf, sizeof(buf)));
#  166|   
#  167|   	if ((pdata->pid = fork()) == -1) {

Error: GCC_ANALYZER_WARNING (CWE-775): [#def493]
LVM2.2.03.36/lib/misc/lvm-exec.c:165:9: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘pipefd[1]’
LVM2.2.03.36/lib/misc/lvm-exec.c:160:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/misc/lvm-exec.c:165:9: branch_false: ...to here
LVM2.2.03.36/lib/misc/lvm-exec.c:165:9: danger: ‘pipefd[1]’ leaks here
#  163|   	}
#  164|   
#  165|-> 	log_verbose("Piping:%s", _verbose_args(argv, buf, sizeof(buf)));
#  166|   
#  167|   	if ((pdata->pid = fork()) == -1) {

Error: GCC_ANALYZER_WARNING (CWE-775): [#def494]
LVM2.2.03.36/lib/misc/lvm-exec.c:168:17: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘pipefd[0]’
LVM2.2.03.36/lib/misc/lvm-exec.c:160:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/misc/lvm-exec.c:165:9: branch_false: ...to here
LVM2.2.03.36/lib/misc/lvm-exec.c:167:12: branch_true: following ‘true’ branch...
LVM2.2.03.36/lib/misc/lvm-exec.c:168:17: branch_true: ...to here
LVM2.2.03.36/lib/misc/lvm-exec.c:168:17: danger: ‘pipefd[0]’ leaks here
#  166|   
#  167|   	if ((pdata->pid = fork()) == -1) {
#  168|-> 		log_sys_error("fork", "");
#  169|   		if (close(pipefd[0]))
#  170|   			log_sys_debug("close", "STDOUT");

Error: GCC_ANALYZER_WARNING (CWE-775): [#def495]
LVM2.2.03.36/lib/misc/lvm-exec.c:168:17: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘pipefd[1]’
LVM2.2.03.36/lib/misc/lvm-exec.c:160:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/misc/lvm-exec.c:165:9: branch_false: ...to here
LVM2.2.03.36/lib/misc/lvm-exec.c:167:12: branch_true: following ‘true’ branch...
LVM2.2.03.36/lib/misc/lvm-exec.c:168:17: branch_true: ...to here
LVM2.2.03.36/lib/misc/lvm-exec.c:168:17: danger: ‘pipefd[1]’ leaks here
#  166|   
#  167|   	if ((pdata->pid = fork()) == -1) {
#  168|-> 		log_sys_error("fork", "");
#  169|   		if (close(pipefd[0]))
#  170|   			log_sys_debug("close", "STDOUT");

Error: GCC_ANALYZER_WARNING (CWE-775): [#def496]
LVM2.2.03.36/lib/misc/lvm-exec.c:169:21: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘pipefd[0]’
LVM2.2.03.36/lib/misc/lvm-exec.c:160:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/misc/lvm-exec.c:165:9: branch_false: ...to here
LVM2.2.03.36/lib/misc/lvm-exec.c:167:12: branch_true: following ‘true’ branch...
LVM2.2.03.36/lib/misc/lvm-exec.c:168:17: branch_true: ...to here
LVM2.2.03.36/lib/misc/lvm-exec.c:169:21: danger: ‘pipefd[0]’ leaks here
#  167|   	if ((pdata->pid = fork()) == -1) {
#  168|   		log_sys_error("fork", "");
#  169|-> 		if (close(pipefd[0]))
#  170|   			log_sys_debug("close", "STDOUT");
#  171|   		if (close(pipefd[1]))

Error: GCC_ANALYZER_WARNING (CWE-775): [#def497]
LVM2.2.03.36/lib/misc/lvm-exec.c:169:21: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘pipefd[1]’
LVM2.2.03.36/lib/misc/lvm-exec.c:160:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/misc/lvm-exec.c:165:9: branch_false: ...to here
LVM2.2.03.36/lib/misc/lvm-exec.c:167:12: branch_true: following ‘true’ branch...
LVM2.2.03.36/lib/misc/lvm-exec.c:168:17: branch_true: ...to here
LVM2.2.03.36/lib/misc/lvm-exec.c:169:21: danger: ‘pipefd[1]’ leaks here
#  167|   	if ((pdata->pid = fork()) == -1) {
#  168|   		log_sys_error("fork", "");
#  169|-> 		if (close(pipefd[0]))
#  170|   			log_sys_debug("close", "STDOUT");
#  171|   		if (close(pipefd[1]))

Error: GCC_ANALYZER_WARNING (CWE-775): [#def498]
LVM2.2.03.36/lib/misc/lvm-exec.c:170:25: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘pipefd[1]’
LVM2.2.03.36/lib/misc/lvm-exec.c:160:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/misc/lvm-exec.c:165:9: branch_false: ...to here
LVM2.2.03.36/lib/misc/lvm-exec.c:167:12: branch_true: following ‘true’ branch...
LVM2.2.03.36/lib/misc/lvm-exec.c:168:17: branch_true: ...to here
LVM2.2.03.36/lib/misc/lvm-exec.c:169:20: branch_true: following ‘true’ branch...
LVM2.2.03.36/lib/misc/lvm-exec.c:170:25: branch_true: ...to here
LVM2.2.03.36/lib/misc/lvm-exec.c:170:25: danger: ‘pipefd[1]’ leaks here
#  168|   		log_sys_error("fork", "");
#  169|   		if (close(pipefd[0]))
#  170|-> 			log_sys_debug("close", "STDOUT");
#  171|   		if (close(pipefd[1]))
#  172|   			log_sys_debug("close", "STDIN");

Error: GCC_ANALYZER_WARNING (CWE-775): [#def499]
LVM2.2.03.36/lib/misc/lvm-exec.c:171:21: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘pipefd[1]’
LVM2.2.03.36/lib/misc/lvm-exec.c:160:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/misc/lvm-exec.c:165:9: branch_false: ...to here
LVM2.2.03.36/lib/misc/lvm-exec.c:167:12: branch_true: following ‘true’ branch...
LVM2.2.03.36/lib/misc/lvm-exec.c:168:17: branch_true: ...to here
LVM2.2.03.36/lib/misc/lvm-exec.c:171:21: danger: ‘pipefd[1]’ leaks here
#  169|   		if (close(pipefd[0]))
#  170|   			log_sys_debug("close", "STDOUT");
#  171|-> 		if (close(pipefd[1]))
#  172|   			log_sys_debug("close", "STDIN");
#  173|   		return 0;

Error: GCC_ANALYZER_WARNING (CWE-775): [#def500]
LVM2.2.03.36/lib/misc/lvm-exec.c:196:13: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘pipefd[0]’
LVM2.2.03.36/lib/misc/lvm-exec.c:160:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/misc/lvm-exec.c:165:9: branch_false: ...to here
LVM2.2.03.36/lib/misc/lvm-exec.c:167:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/misc/lvm-exec.c:176:12: branch_false: ...to here
LVM2.2.03.36/lib/misc/lvm-exec.c:176:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/misc/lvm-exec.c:196:13: branch_false: ...to here
LVM2.2.03.36/lib/misc/lvm-exec.c:196:13: danger: ‘pipefd[0]’ leaks here
#  194|   
#  195|   	/* Parent -> reader */
#  196|-> 	if (close(pipefd[1 /*write*/])) {
#  197|   		log_sys_error("close", "STDOUT");
#  198|   		if (close(pipefd[0 /*read*/]))

Error: GCC_ANALYZER_WARNING (CWE-775): [#def501]
LVM2.2.03.36/lib/misc/lvm-exec.c:196:13: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘pipefd[1]’
LVM2.2.03.36/lib/misc/lvm-exec.c:160:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/misc/lvm-exec.c:165:9: branch_false: ...to here
LVM2.2.03.36/lib/misc/lvm-exec.c:167:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/misc/lvm-exec.c:176:12: branch_false: ...to here
LVM2.2.03.36/lib/misc/lvm-exec.c:176:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/misc/lvm-exec.c:196:13: branch_false: ...to here
LVM2.2.03.36/lib/misc/lvm-exec.c:196:13: danger: ‘pipefd[1]’ leaks here
#  194|   
#  195|   	/* Parent -> reader */
#  196|-> 	if (close(pipefd[1 /*write*/])) {
#  197|   		log_sys_error("close", "STDOUT");
#  198|   		if (close(pipefd[0 /*read*/]))

Error: GCC_ANALYZER_WARNING (CWE-775): [#def502]
LVM2.2.03.36/lib/misc/lvm-exec.c:197:17: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘pipefd[0]’
LVM2.2.03.36/lib/misc/lvm-exec.c:160:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/misc/lvm-exec.c:165:9: branch_false: ...to here
LVM2.2.03.36/lib/misc/lvm-exec.c:167:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/misc/lvm-exec.c:176:12: branch_false: ...to here
LVM2.2.03.36/lib/misc/lvm-exec.c:176:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/misc/lvm-exec.c:196:13: branch_false: ...to here
LVM2.2.03.36/lib/misc/lvm-exec.c:196:12: branch_true: following ‘true’ branch...
LVM2.2.03.36/lib/misc/lvm-exec.c:197:17: branch_true: ...to here
LVM2.2.03.36/lib/misc/lvm-exec.c:197:17: danger: ‘pipefd[0]’ leaks here
#  195|   	/* Parent -> reader */
#  196|   	if (close(pipefd[1 /*write*/])) {
#  197|-> 		log_sys_error("close", "STDOUT");
#  198|   		if (close(pipefd[0 /*read*/]))
#  199|   			log_sys_debug("close", "pipe[0]");

Error: GCC_ANALYZER_WARNING (CWE-775): [#def503]
LVM2.2.03.36/lib/misc/lvm-exec.c:198:21: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘pipefd[0]’
LVM2.2.03.36/lib/misc/lvm-exec.c:160:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/misc/lvm-exec.c:165:9: branch_false: ...to here
LVM2.2.03.36/lib/misc/lvm-exec.c:167:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/misc/lvm-exec.c:176:12: branch_false: ...to here
LVM2.2.03.36/lib/misc/lvm-exec.c:176:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/misc/lvm-exec.c:196:13: branch_false: ...to here
LVM2.2.03.36/lib/misc/lvm-exec.c:196:12: branch_true: following ‘true’ branch...
LVM2.2.03.36/lib/misc/lvm-exec.c:197:17: branch_true: ...to here
LVM2.2.03.36/lib/misc/lvm-exec.c:198:21: danger: ‘pipefd[0]’ leaks here
#  196|   	if (close(pipefd[1 /*write*/])) {
#  197|   		log_sys_error("close", "STDOUT");
#  198|-> 		if (close(pipefd[0 /*read*/]))
#  199|   			log_sys_debug("close", "pipe[0]");
#  200|   		return NULL;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def504]
LVM2.2.03.36/lib/misc/lvm-file.c:147:9: warning[-Wanalyzer-malloc-leak]: leak of ‘s’
LVM2.2.03.36/lib/misc/lvm-file.c:167:5: enter_function: entry to ‘dir_create_recursive’
LVM2.2.03.36/lib/misc/lvm-file.c:172:20: acquire_memory: allocated here
LVM2.2.03.36/lib/misc/lvm-file.c:173:12: branch_false: following ‘false’ branch (when ‘s’ is non-NULL)...
 branch_false: ...to here
LVM2.2.03.36/lib/misc/lvm-file.c:178:16: branch_true: following ‘true’ branch (when ‘s’ is non-NULL)...
LVM2.2.03.36/lib/misc/lvm-file.c:179:17: branch_true: ...to here
LVM2.2.03.36/lib/misc/lvm-file.c:180:20: branch_true: following ‘true’ branch...
LVM2.2.03.36/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): [#def505]
LVM2.2.03.36/lib/misc/lvm-file.c:215:19: warning[-Wanalyzer-malloc-leak]: leak of ‘dir’
LVM2.2.03.36/lib/misc/lvm-file.c:199:21: acquire_memory: allocated here
LVM2.2.03.36/lib/misc/lvm-file.c:199:12: branch_false: following ‘false’ branch (when ‘dir’ is non-NULL)...
LVM2.2.03.36/lib/misc/lvm-file.c:204:14: branch_false: ...to here
LVM2.2.03.36/lib/misc/lvm-file.c:204:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/misc/lvm-file.c:215:19: branch_false: ...to here
LVM2.2.03.36/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): [#def506]
LVM2.2.03.36/lib/misc/lvm-file.c:216:17: warning[-Wanalyzer-malloc-leak]: leak of ‘dir’
LVM2.2.03.36/lib/misc/lvm-file.c:199:21: acquire_memory: allocated here
LVM2.2.03.36/lib/misc/lvm-file.c:199:12: branch_false: following ‘false’ branch (when ‘dir’ is non-NULL)...
LVM2.2.03.36/lib/misc/lvm-file.c:204:14: branch_false: ...to here
LVM2.2.03.36/lib/misc/lvm-file.c:204:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/misc/lvm-file.c:215:19: branch_false: ...to here
LVM2.2.03.36/lib/misc/lvm-file.c:215:12: branch_true: following ‘true’ branch...
LVM2.2.03.36/lib/misc/lvm-file.c:216:17: branch_true: ...to here
LVM2.2.03.36/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): [#def507]
LVM2.2.03.36/lib/misc/lvm-file.c:220:13: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘open(dir, 0)’
LVM2.2.03.36/lib/misc/lvm-file.c:199:12: branch_false: following ‘false’ branch (when ‘dir’ is non-NULL)...
LVM2.2.03.36/lib/misc/lvm-file.c:204:14: branch_false: ...to here
LVM2.2.03.36/lib/misc/lvm-file.c:204:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/misc/lvm-file.c:215:19: branch_false: ...to here
LVM2.2.03.36/lib/misc/lvm-file.c:215:19: acquire_resource: opened here
LVM2.2.03.36/lib/misc/lvm-file.c:215:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/misc/lvm-file.c:220:13: branch_false: ...to here
LVM2.2.03.36/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): [#def508]
LVM2.2.03.36/lib/misc/lvm-file.c:220:13: warning[-Wanalyzer-malloc-leak]: leak of ‘dir’
LVM2.2.03.36/lib/misc/lvm-file.c:199:21: acquire_memory: allocated here
LVM2.2.03.36/lib/misc/lvm-file.c:199:12: branch_false: following ‘false’ branch (when ‘dir’ is non-NULL)...
LVM2.2.03.36/lib/misc/lvm-file.c:204:14: branch_false: ...to here
LVM2.2.03.36/lib/misc/lvm-file.c:204:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/misc/lvm-file.c:215:19: branch_false: ...to here
LVM2.2.03.36/lib/misc/lvm-file.c:215:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/misc/lvm-file.c:220:13: branch_false: ...to here
LVM2.2.03.36/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): [#def509]
LVM2.2.03.36/lib/misc/lvm-file.c:221:17: warning[-Wanalyzer-malloc-leak]: leak of ‘dir’
LVM2.2.03.36/lib/misc/lvm-file.c:199:21: acquire_memory: allocated here
LVM2.2.03.36/lib/misc/lvm-file.c:199:12: branch_false: following ‘false’ branch (when ‘dir’ is non-NULL)...
LVM2.2.03.36/lib/misc/lvm-file.c:204:14: branch_false: ...to here
LVM2.2.03.36/lib/misc/lvm-file.c:204:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/misc/lvm-file.c:215:19: branch_false: ...to here
LVM2.2.03.36/lib/misc/lvm-file.c:215:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/misc/lvm-file.c:220:13: branch_false: ...to here
LVM2.2.03.36/lib/misc/lvm-file.c:220:12: branch_true: following ‘true’ branch...
LVM2.2.03.36/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): [#def510]
LVM2.2.03.36/lib/misc/lvm-file.c:223:13: warning[-Wanalyzer-malloc-leak]: leak of ‘dir’
LVM2.2.03.36/lib/misc/lvm-file.c:199:21: acquire_memory: allocated here
LVM2.2.03.36/lib/misc/lvm-file.c:199:12: branch_false: following ‘false’ branch (when ‘dir’ is non-NULL)...
LVM2.2.03.36/lib/misc/lvm-file.c:204:14: branch_false: ...to here
LVM2.2.03.36/lib/misc/lvm-file.c:204:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/misc/lvm-file.c:215:19: branch_false: ...to here
LVM2.2.03.36/lib/misc/lvm-file.c:215:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/misc/lvm-file.c:220:13: branch_false: ...to here
LVM2.2.03.36/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): [#def511]
LVM2.2.03.36/lib/misc/lvm-file.c:224:17: warning[-Wanalyzer-malloc-leak]: leak of ‘dir’
LVM2.2.03.36/lib/misc/lvm-file.c:199:21: acquire_memory: allocated here
LVM2.2.03.36/lib/misc/lvm-file.c:199:12: branch_false: following ‘false’ branch (when ‘dir’ is non-NULL)...
LVM2.2.03.36/lib/misc/lvm-file.c:204:14: branch_false: ...to here
LVM2.2.03.36/lib/misc/lvm-file.c:204:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/misc/lvm-file.c:215:19: branch_false: ...to here
LVM2.2.03.36/lib/misc/lvm-file.c:215:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/misc/lvm-file.c:220:13: branch_false: ...to here
LVM2.2.03.36/lib/misc/lvm-file.c:223:12: branch_true: following ‘true’ branch...
LVM2.2.03.36/lib/misc/lvm-file.c:224:17: branch_true: ...to here
LVM2.2.03.36/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): [#def512]
LVM2.2.03.36/lib/misc/lvm-file.c:251:14: warning[-Wanalyzer-malloc-leak]: leak of ‘dir’
LVM2.2.03.36/lib/misc/lvm-file.c:243:21: acquire_memory: allocated here
LVM2.2.03.36/lib/misc/lvm-file.c:243:12: branch_false: following ‘false’ branch (when ‘dir’ is non-NULL)...
LVM2.2.03.36/lib/misc/lvm-file.c:248:18: branch_false: ...to here
LVM2.2.03.36/lib/misc/lvm-file.c:248:12: branch_false: following ‘false’ branch (when ‘c’ is NULL)...
LVM2.2.03.36/lib/misc/lvm-file.c:251:14: branch_false: ...to here
LVM2.2.03.36/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): [#def513]
LVM2.2.03.36/lib/misc/lvm-flock.c:113:9: warning[-Wanalyzer-malloc-leak]: leak of ‘ll’
LVM2.2.03.36/lib/misc/lvm-flock.c:179:5: enter_function: entry to ‘lock_file’
LVM2.2.03.36/lib/misc/lvm-flock.c:204:12: branch_false: following ‘false’ branch (when ‘convert == 0’)...
LVM2.2.03.36/lib/misc/lvm-flock.c:218:20: branch_false: ...to here
LVM2.2.03.36/lib/misc/lvm-flock.c:218:20: acquire_memory: allocated here
LVM2.2.03.36/lib/misc/lvm-flock.c:218:12: branch_false: following ‘false’ branch (when ‘ll’ is non-NULL)...
LVM2.2.03.36/lib/misc/lvm-flock.c:221:25: branch_false: ...to here
LVM2.2.03.36/lib/misc/lvm-flock.c:221:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/misc/lvm-flock.c:226:9: branch_false: ...to here
LVM2.2.03.36/lib/misc/lvm-flock.c:232:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/misc/lvm-flock.c:235:21: branch_false: ...to here
LVM2.2.03.36/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): [#def514]
LVM2.2.03.36/lib/misc/lvm-flock.c:116:35: warning[-Wanalyzer-malloc-leak]: leak of ‘ll’
LVM2.2.03.36/lib/misc/lvm-flock.c:179:5: enter_function: entry to ‘lock_file’
LVM2.2.03.36/lib/misc/lvm-flock.c:204:12: branch_false: following ‘false’ branch (when ‘convert == 0’)...
LVM2.2.03.36/lib/misc/lvm-flock.c:218:20: branch_false: ...to here
LVM2.2.03.36/lib/misc/lvm-flock.c:218:20: acquire_memory: allocated here
LVM2.2.03.36/lib/misc/lvm-flock.c:218:12: branch_false: following ‘false’ branch (when ‘ll’ is non-NULL)...
LVM2.2.03.36/lib/misc/lvm-flock.c:221:25: branch_false: ...to here
LVM2.2.03.36/lib/misc/lvm-flock.c:221:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/misc/lvm-flock.c:226:9: branch_false: ...to here
LVM2.2.03.36/lib/misc/lvm-flock.c:232:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/misc/lvm-flock.c:235:21: branch_false: ...to here
LVM2.2.03.36/lib/misc/lvm-flock.c:235:21: call_function: calling ‘_do_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): [#def515]
LVM2.2.03.36/lib/misc/lvm-flock.c:117:25: warning[-Wanalyzer-malloc-leak]: leak of ‘ll’
LVM2.2.03.36/lib/misc/lvm-flock.c:179:5: enter_function: entry to ‘lock_file’
LVM2.2.03.36/lib/misc/lvm-flock.c:204:12: branch_false: following ‘false’ branch (when ‘convert == 0’)...
LVM2.2.03.36/lib/misc/lvm-flock.c:218:20: branch_false: ...to here
LVM2.2.03.36/lib/misc/lvm-flock.c:218:20: acquire_memory: allocated here
LVM2.2.03.36/lib/misc/lvm-flock.c:218:12: branch_false: following ‘false’ branch (when ‘ll’ is non-NULL)...
LVM2.2.03.36/lib/misc/lvm-flock.c:221:25: branch_false: ...to here
LVM2.2.03.36/lib/misc/lvm-flock.c:221:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/misc/lvm-flock.c:226:9: branch_false: ...to here
LVM2.2.03.36/lib/misc/lvm-flock.c:232:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/misc/lvm-flock.c:235:21: branch_false: ...to here
LVM2.2.03.36/lib/misc/lvm-flock.c:235:21: call_function: calling ‘_do_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): [#def516]
LVM2.2.03.36/lib/misc/lvm-flock.c:119:28: warning[-Wanalyzer-malloc-leak]: leak of ‘ll’
LVM2.2.03.36/lib/misc/lvm-flock.c:179:5: enter_function: entry to ‘lock_file’
LVM2.2.03.36/lib/misc/lvm-flock.c:204:12: branch_false: following ‘false’ branch (when ‘convert == 0’)...
LVM2.2.03.36/lib/misc/lvm-flock.c:218:20: branch_false: ...to here
LVM2.2.03.36/lib/misc/lvm-flock.c:218:20: acquire_memory: allocated here
LVM2.2.03.36/lib/misc/lvm-flock.c:218:12: branch_false: following ‘false’ branch (when ‘ll’ is non-NULL)...
LVM2.2.03.36/lib/misc/lvm-flock.c:221:25: branch_false: ...to here
LVM2.2.03.36/lib/misc/lvm-flock.c:221:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/misc/lvm-flock.c:226:9: branch_false: ...to here
LVM2.2.03.36/lib/misc/lvm-flock.c:232:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/misc/lvm-flock.c:235:21: branch_false: ...to here
LVM2.2.03.36/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): [#def517]
LVM2.2.03.36/lib/misc/lvm-flock.c:132:25: warning[-Wanalyzer-malloc-leak]: leak of ‘ll’
LVM2.2.03.36/lib/misc/lvm-flock.c:179:5: enter_function: entry to ‘lock_file’
LVM2.2.03.36/lib/misc/lvm-flock.c:204:12: branch_false: following ‘false’ branch (when ‘convert == 0’)...
LVM2.2.03.36/lib/misc/lvm-flock.c:218:20: branch_false: ...to here
LVM2.2.03.36/lib/misc/lvm-flock.c:218:20: acquire_memory: allocated here
LVM2.2.03.36/lib/misc/lvm-flock.c:218:12: branch_false: following ‘false’ branch (when ‘ll’ is non-NULL)...
LVM2.2.03.36/lib/misc/lvm-flock.c:221:25: branch_false: ...to here
LVM2.2.03.36/lib/misc/lvm-flock.c:221:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/misc/lvm-flock.c:226:9: branch_false: ...to here
LVM2.2.03.36/lib/misc/lvm-flock.c:232:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/misc/lvm-flock.c:235:21: branch_false: ...to here
LVM2.2.03.36/lib/misc/lvm-flock.c:235:21: call_function: calling ‘_do_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): [#def518]
LVM2.2.03.36/lib/misc/lvm-flock.c:133:29: warning[-Wanalyzer-malloc-leak]: leak of ‘ll’
LVM2.2.03.36/lib/misc/lvm-flock.c:179:5: enter_function: entry to ‘lock_file’
LVM2.2.03.36/lib/misc/lvm-flock.c:204:12: branch_false: following ‘false’ branch (when ‘convert == 0’)...
LVM2.2.03.36/lib/misc/lvm-flock.c:218:20: branch_false: ...to here
LVM2.2.03.36/lib/misc/lvm-flock.c:218:20: acquire_memory: allocated here
LVM2.2.03.36/lib/misc/lvm-flock.c:218:12: branch_false: following ‘false’ branch (when ‘ll’ is non-NULL)...
LVM2.2.03.36/lib/misc/lvm-flock.c:221:25: branch_false: ...to here
LVM2.2.03.36/lib/misc/lvm-flock.c:221:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/misc/lvm-flock.c:226:9: branch_false: ...to here
LVM2.2.03.36/lib/misc/lvm-flock.c:232:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/misc/lvm-flock.c:235:21: branch_false: ...to here
LVM2.2.03.36/lib/misc/lvm-flock.c:235:21: call_function: calling ‘_do_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): [#def519]
LVM2.2.03.36/lib/misc/lvm-flock.c:228:9: warning[-Wanalyzer-malloc-leak]: leak of ‘<unknown>’
LVM2.2.03.36/lib/misc/lvm-flock.c:204:12: branch_false: following ‘false’ branch (when ‘convert == 0’)...
LVM2.2.03.36/lib/misc/lvm-flock.c:218:20: branch_false: ...to here
LVM2.2.03.36/lib/misc/lvm-flock.c:218:12: branch_false: following ‘false’ branch (when ‘ll’ is non-NULL)...
LVM2.2.03.36/lib/misc/lvm-flock.c:221:25: branch_false: ...to here
LVM2.2.03.36/lib/misc/lvm-flock.c:221:25: acquire_memory: allocated here
LVM2.2.03.36/lib/misc/lvm-flock.c:221:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/misc/lvm-flock.c:226:9: branch_false: ...to here
LVM2.2.03.36/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): [#def520]
LVM2.2.03.36/lib/misc/lvm-flock.c:228:9: warning[-Wanalyzer-malloc-leak]: leak of ‘ll’
LVM2.2.03.36/lib/misc/lvm-flock.c:204:12: branch_false: following ‘false’ branch (when ‘convert == 0’)...
LVM2.2.03.36/lib/misc/lvm-flock.c:218:20: branch_false: ...to here
LVM2.2.03.36/lib/misc/lvm-flock.c:218:20: acquire_memory: allocated here
LVM2.2.03.36/lib/misc/lvm-flock.c:218:12: branch_false: following ‘false’ branch (when ‘ll’ is non-NULL)...
LVM2.2.03.36/lib/misc/lvm-flock.c:221:25: branch_false: ...to here
LVM2.2.03.36/lib/misc/lvm-flock.c:221:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/misc/lvm-flock.c:226:9: branch_false: ...to here
LVM2.2.03.36/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): [#def521]
LVM2.2.03.36/lib/misc/lvm-flock.c:231:16: warning[-Wanalyzer-malloc-leak]: leak of ‘ll’
LVM2.2.03.36/lib/misc/lvm-flock.c:204:12: branch_false: following ‘false’ branch (when ‘convert == 0’)...
LVM2.2.03.36/lib/misc/lvm-flock.c:218:20: branch_false: ...to here
LVM2.2.03.36/lib/misc/lvm-flock.c:218:20: acquire_memory: allocated here
LVM2.2.03.36/lib/misc/lvm-flock.c:218:12: branch_false: following ‘false’ branch (when ‘ll’ is non-NULL)...
LVM2.2.03.36/lib/misc/lvm-flock.c:221:25: branch_false: ...to here
LVM2.2.03.36/lib/misc/lvm-flock.c:221:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/misc/lvm-flock.c:226:9: branch_false: ...to here
LVM2.2.03.36/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): [#def522]
LVM2.2.03.36/lib/misc/lvm-wrappers.c:124:17: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘open("/dev/urandom", 0)’
LVM2.2.03.36/lib/misc/lvm-wrappers.c:118:19: acquire_resource: opened here
LVM2.2.03.36/lib/misc/lvm-wrappers.c:118:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/misc/lvm-wrappers.c:123:13: branch_false: ...to here
LVM2.2.03.36/lib/misc/lvm-wrappers.c:123:12: branch_true: following ‘true’ branch...
LVM2.2.03.36/lib/misc/lvm-wrappers.c:124:17: branch_true: ...to here
LVM2.2.03.36/lib/misc/lvm-wrappers.c:124:17: danger: ‘open("/dev/urandom", 0)’ leaks here; was opened at [(1)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/0)
#  122|   
#  123|   	if (read(fd, buf, len) != (ssize_t) len) {
#  124|-> 		log_sys_error("read", "read_urandom: /dev/urandom");
#  125|   		if (close(fd))
#  126|   			stack;

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

Error: GCC_ANALYZER_WARNING (CWE-775): [#def524]
LVM2.2.03.36/lib/misc/lvm-wrappers.c:130:12: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘open("/dev/urandom", 0)’
LVM2.2.03.36/lib/misc/lvm-wrappers.c:118:19: acquire_resource: opened here
LVM2.2.03.36/lib/misc/lvm-wrappers.c:118:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/misc/lvm-wrappers.c:123:13: branch_false: ...to here
LVM2.2.03.36/lib/misc/lvm-wrappers.c:123:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/misc/lvm-wrappers.c:130:13: branch_false: ...to here
LVM2.2.03.36/lib/misc/lvm-wrappers.c:130:12: danger: ‘open("/dev/urandom", 0)’ leaks here; was opened at [(1)](sarif:/runs/0/results/2/codeFlows/0/threadFlows/0/locations/0)
#  128|   	}
#  129|   
#  130|-> 	if (close(fd))
#  131|   		stack;
#  132|   

Error: GCC_ANALYZER_WARNING (CWE-775): [#def525]
LVM2.2.03.36/lib/misc/util.h:42:16: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘socket(1, 1, 0)’
LVM2.2.03.36/libdaemon/client/daemon-client.c:24:15: enter_function: entry to ‘daemon_open’
LVM2.2.03.36/libdaemon/client/daemon-client.c:33:28: acquire_resource: stream socket created here
LVM2.2.03.36/libdaemon/client/daemon-client.c:33:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/libdaemon/client/daemon-client.c:39: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-775): [#def526]
LVM2.2.03.36/lib/misc/util.h:42:16: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(&_hints_file, "r")’
LVM2.2.03.36/lib/label/hints.c:691:12: enter_function: entry to ‘_read_hint_file’
LVM2.2.03.36/lib/label/hints.c:713:20: acquire_resource: opened here
LVM2.2.03.36/lib/label/hints.c:713:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/label/hints.c:716:9: branch_false: ...to here
LVM2.2.03.36/lib/label/hints.c:718:21: branch_true: following ‘true’ branch (when ‘i != 4’)...
LVM2.2.03.36/lib/label/hints.c:719:17: branch_true: ...to here
LVM2.2.03.36/lib/label/hints.c:721:16: branch_true: following ‘true’ branch...
LVM2.2.03.36/lib/label/hints.c:722:17: branch_true: ...to here
LVM2.2.03.36/lib/label/hints.c:723:20: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/label/hints.c:726:26: branch_false: ...to here
LVM2.2.03.36/lib/label/hints.c:726:20: branch_false: following ‘false’ branch (when ‘p’ is NULL)...
LVM2.2.03.36/lib/label/hints.c:740:22: branch_false: ...to here
LVM2.2.03.36/lib/label/hints.c:740:20: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/label/hints.c:757:22: branch_false: ...to here
LVM2.2.03.36/lib/label/hints.c:757:20: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/label/hints.c:770:22: branch_false: ...to here
LVM2.2.03.36/lib/label/hints.c:770:20: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/label/hints.c:783:22: branch_false: ...to here
LVM2.2.03.36/lib/label/hints.c:783:20: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/label/hints.c:795:22: branch_false: ...to here
LVM2.2.03.36/lib/label/hints.c:795:20: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/label/hints.c:814:22: branch_false: ...to here
LVM2.2.03.36/lib/label/hints.c:814:20: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/label/hints.c:827:21: branch_false: ...to here
LVM2.2.03.36/lib/label/hints.c:827:20: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/label/hints.c:830:21: branch_false: ...to here
LVM2.2.03.36/lib/label/hints.c:830:20: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/label/hints.c:833:17: branch_false: ...to here
LVM2.2.03.36/lib/label/hints.c:838:20: branch_true: following ‘true’ branch...
LVM2.2.03.36/lib/label/hints.c:839:30: call_function: inlined call to ‘_dm_strncpy’ from ‘_read_hint_file’
#   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): [#def527]
LVM2.2.03.36/lib/misc/util.h:42:16: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(&_hints_file, "r")’
LVM2.2.03.36/lib/label/hints.c:691:12: enter_function: entry to ‘_read_hint_file’
LVM2.2.03.36/lib/label/hints.c:713:20: acquire_memory: allocated here
LVM2.2.03.36/lib/label/hints.c:713:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/label/hints.c:716:9: branch_false: ...to here
LVM2.2.03.36/lib/label/hints.c:718:21: branch_true: following ‘true’ branch (when ‘i != 4’)...
LVM2.2.03.36/lib/label/hints.c:719:17: branch_true: ...to here
LVM2.2.03.36/lib/label/hints.c:721:16: branch_true: following ‘true’ branch...
LVM2.2.03.36/lib/label/hints.c:722:17: branch_true: ...to here
LVM2.2.03.36/lib/label/hints.c:723:20: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/label/hints.c:726:26: branch_false: ...to here
LVM2.2.03.36/lib/label/hints.c:726:20: branch_false: following ‘false’ branch (when ‘p’ is NULL)...
LVM2.2.03.36/lib/label/hints.c:740:22: branch_false: ...to here
LVM2.2.03.36/lib/label/hints.c:740:20: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/label/hints.c:757:22: branch_false: ...to here
LVM2.2.03.36/lib/label/hints.c:757:20: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/label/hints.c:770:22: branch_false: ...to here
LVM2.2.03.36/lib/label/hints.c:770:20: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/label/hints.c:783:22: branch_false: ...to here
LVM2.2.03.36/lib/label/hints.c:783:20: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/label/hints.c:795:22: branch_false: ...to here
LVM2.2.03.36/lib/label/hints.c:795:20: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/label/hints.c:814:22: branch_false: ...to here
LVM2.2.03.36/lib/label/hints.c:814:20: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/label/hints.c:827:21: branch_false: ...to here
LVM2.2.03.36/lib/label/hints.c:827:20: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/label/hints.c:830:21: branch_false: ...to here
LVM2.2.03.36/lib/label/hints.c:830:20: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/label/hints.c:833:17: branch_false: ...to here
LVM2.2.03.36/lib/label/hints.c:838:20: branch_true: following ‘true’ branch...
LVM2.2.03.36/lib/label/hints.c:839:30: call_function: inlined call to ‘_dm_strncpy’ from ‘_read_hint_file’
#   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): [#def528]
LVM2.2.03.36/lib/mm/memlock.c:152:27: warning[-Wanalyzer-malloc-leak]: leak of ‘malloc(_size_malloc_tmp)’
LVM2.2.03.36/lib/mm/memlock.c:607:13: enter_function: entry to ‘_lock_mem_if_needed’
LVM2.2.03.36/lib/mm/memlock.c:611:13: branch_true: following ‘true’ branch...
LVM2.2.03.36/lib/mm/memlock.c:613:17: branch_true: ...to here
LVM2.2.03.36/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): [#def529]
LVM2.2.03.36/lib/notify/lvmnotify.c:71:14: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘open(lockfile, 2)’
LVM2.2.03.36/lib/notify/lvmnotify.c:57:14: acquire_resource: opened here
LVM2.2.03.36/lib/notify/lvmnotify.c:58:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/notify/lvmnotify.c:70:9: branch_false: ...to here
LVM2.2.03.36/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): [#def530]
LVM2.2.03.36/lib/raid/raid.c:693:9: warning[-Wanalyzer-malloc-leak]: leak of ‘calloc(1, 72)’
LVM2.2.03.36/lib/raid/raid.c:667:29: enter_function: entry to ‘_init_raid_segtype’
LVM2.2.03.36/lib/raid/raid.c:672:40: call_function: inlined call to ‘zalloc’ from ‘_init_raid_segtype’
LVM2.2.03.36/lib/raid/raid.c:674:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/raid/raid.c:680:9: branch_false: ...to here
LVM2.2.03.36/lib/raid/raid.c:693:9: danger: ‘calloc(1, 72)’ leaks here; was allocated at [(3)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/2)
#  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): [#def531]
LVM2.2.03.36/lib/raid/raid.c:693:9: warning[-Wanalyzer-malloc-leak]: leak of ‘dso’
LVM2.2.03.36/lib/raid/raid.c:674:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/raid/raid.c:680:9: branch_false: ...to here
LVM2.2.03.36/lib/raid/raid.c:685:12: branch_true: following ‘true’ branch...
LVM2.2.03.36/lib/raid/raid.c:686:27: acquire_memory: allocated here
LVM2.2.03.36/lib/raid/raid.c:685:13: branch_true: following ‘true’ branch (when ‘dso’ is non-NULL)...
LVM2.2.03.36/lib/raid/raid.c:687:17: branch_true: ...to here
LVM2.2.03.36/lib/raid/raid.c:693:9: danger: ‘dso’ leaks here; was allocated at [(5)](sarif:/runs/0/results/0/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): [#def532]
LVM2.2.03.36/lib/raid/raid.c:722:21: warning[-Wanalyzer-malloc-leak]: leak of ‘_init_raid_segtype(cmd, & _raid_types[i], get_monitor_dso_path(cmd, 285), monitored)’
LVM2.2.03.36/lib/raid/raid.c:699:5: enter_function: entry to ‘init_raid_segtypes’
LVM2.2.03.36/lib/raid/raid.c:721:21: branch_true: following ‘true’ branch (when ‘i != 21’)...
LVM2.2.03.36/lib/raid/raid.c:722:32: branch_true: ...to here
LVM2.2.03.36/lib/raid/raid.c:722:32: call_function: calling ‘_init_raid_segtype’ from ‘init_raid_segtypes’
LVM2.2.03.36/lib/raid/raid.c:722:32: return_function: returning to ‘init_raid_segtypes’ from ‘_init_raid_segtype’
LVM2.2.03.36/lib/raid/raid.c:722:20: branch_true: following ‘true’ branch...
LVM2.2.03.36/lib/raid/raid.c:723:22: branch_true: ...to here
LVM2.2.03.36/lib/raid/raid.c:722:21: 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/2/codeFlows/0/threadFlows/0/locations/6)
#  720|   
#  721|   	for (i = 0; i < DM_ARRAY_SIZE(_raid_types); ++i)
#  722|-> 		if ((segtype = _init_raid_segtype(cmd, &_raid_types[i], dso, monitored)) &&
#  723|   		    !lvm_register_segtype(seglib, segtype)) {
#  724|   			/* segtype is already destroyed */

Error: GCC_ANALYZER_WARNING (CWE-401): [#def533]
LVM2.2.03.36/lib/snapshot/snapshot.c:266:24: warning[-Wanalyzer-malloc-leak]: leak of ‘calloc(1, 72)’
LVM2.2.03.36/lib/snapshot/snapshot.c:249:22: enter_function: entry to ‘init_snapshot_segtype’
LVM2.2.03.36/lib/snapshot/snapshot.c:255:40: call_function: inlined call to ‘zalloc’ from ‘init_snapshot_segtype’
LVM2.2.03.36/lib/snapshot/snapshot.c:257:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/snapshot/snapshot.c:260:9: branch_false: ...to here
LVM2.2.03.36/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): [#def534]
LVM2.2.03.36/lib/snapshot/snapshot.c:272:9: warning[-Wanalyzer-malloc-leak]: leak of ‘calloc(1, 72)’
LVM2.2.03.36/lib/snapshot/snapshot.c:249:22: enter_function: entry to ‘init_snapshot_segtype’
LVM2.2.03.36/lib/snapshot/snapshot.c:255:40: call_function: inlined call to ‘zalloc’ from ‘init_snapshot_segtype’
LVM2.2.03.36/lib/snapshot/snapshot.c:257:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/snapshot/snapshot.c:260:9: branch_false: ...to here
LVM2.2.03.36/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): [#def535]
LVM2.2.03.36/lib/striped/striped.c:244:9: warning[-Wanalyzer-malloc-leak]: leak of ‘calloc(1, 72)’
LVM2.2.03.36/lib/striped/striped.c:233:29: enter_function: entry to ‘_init_segtype’
LVM2.2.03.36/lib/striped/striped.c:235:40: call_function: inlined call to ‘zalloc’ from ‘_init_segtype’
LVM2.2.03.36/lib/striped/striped.c:237:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/striped/striped.c:240:9: branch_false: ...to here
LVM2.2.03.36/lib/striped/striped.c:244:9: danger: ‘calloc(1, 72)’ leaks here; was allocated at [(3)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/2)
#  242|   	segtype->flags = target | SEG_CAN_SPLIT | SEG_AREAS_STRIPED;
#  243|   
#  244|-> 	log_very_verbose("Initialised segtype: %s", segtype->name);
#  245|   	return segtype;
#  246|   }

Error: GCC_ANALYZER_WARNING (CWE-401): [#def536]
LVM2.2.03.36/lib/thin/thin.c:812:32: warning[-Wanalyzer-malloc-leak]: leak of ‘calloc(1, 72)’
LVM2.2.03.36/lib/thin/thin.c:777:5: enter_function: entry to ‘init_thin_segtypes’
LVM2.2.03.36/lib/thin/thin.c:797:21: branch_true: following ‘true’ branch (when ‘i != 2’)...
LVM2.2.03.36/lib/thin/thin.c:798:27: call_function: inlined call to ‘zalloc’ from ‘init_thin_segtypes’
LVM2.2.03.36/lib/thin/thin.c:800:20: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/thin/thin.c:806:32: branch_false: ...to here
LVM2.2.03.36/lib/thin/thin.c:812:32: danger: ‘calloc(1, 72)’ leaks here; was allocated at [(5)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/4)
#  810|   #ifdef DEVMAPPER_SUPPORT
#  811|   #  ifdef DMEVENTD
#  812|-> 		segtype->dso = get_monitor_dso_path(cmd, dmeventd_thin_library_CFG);
#  813|   
#  814|   		if ((_reg_segtypes[i].flags & SEG_THIN_POOL) &&

Error: GCC_ANALYZER_WARNING (CWE-401): [#def537]
LVM2.2.03.36/lib/thin/thin.c:819:22: warning[-Wanalyzer-malloc-leak]: leak of ‘calloc(1, 72)’
LVM2.2.03.36/lib/thin/thin.c:777:5: enter_function: entry to ‘init_thin_segtypes’
LVM2.2.03.36/lib/thin/thin.c:797:21: branch_true: following ‘true’ branch (when ‘i != 2’)...
LVM2.2.03.36/lib/thin/thin.c:798:27: call_function: inlined call to ‘zalloc’ from ‘init_thin_segtypes’
LVM2.2.03.36/lib/thin/thin.c:800:20: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/thin/thin.c:806:32: branch_false: ...to here
LVM2.2.03.36/lib/thin/thin.c:814:20: branch_true: following ‘true’ branch...
LVM2.2.03.36/lib/thin/thin.c:814:21: branch_true: ...to here
LVM2.2.03.36/lib/thin/thin.c:819:22: danger: ‘calloc(1, 72)’ leaks here; was allocated at [(5)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/4)
#  817|   #  endif /* DMEVENTD */
#  818|   #endif
#  819|-> 		if (!lvm_register_segtype(seglib, segtype))
#  820|   			/* segtype is already destroyed */
#  821|   			return_0;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def538]
LVM2.2.03.36/lib/unknown/unknown.c:72:17: warning[-Wanalyzer-malloc-leak]: leak of ‘calloc(1, 72)’
LVM2.2.03.36/lib/unknown/unknown.c:61:22: enter_function: entry to ‘init_unknown_segtype’
LVM2.2.03.36/lib/unknown/unknown.c:63:40: call_function: inlined call to ‘zalloc’ from ‘init_unknown_segtype’
LVM2.2.03.36/lib/unknown/unknown.c:65:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/unknown/unknown.c:70:9: branch_false: ...to here
LVM2.2.03.36/lib/unknown/unknown.c:71:12: branch_true: following ‘true’ branch...
LVM2.2.03.36/lib/unknown/unknown.c:72:17: branch_true: ...to here
LVM2.2.03.36/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): [#def539]
LVM2.2.03.36/lib/unknown/unknown.c:79:9: warning[-Wanalyzer-malloc-leak]: leak of ‘calloc(1, 72)’
LVM2.2.03.36/lib/unknown/unknown.c:61:22: enter_function: entry to ‘init_unknown_segtype’
LVM2.2.03.36/lib/unknown/unknown.c:63:40: call_function: inlined call to ‘zalloc’ from ‘init_unknown_segtype’
LVM2.2.03.36/lib/unknown/unknown.c:65:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/unknown/unknown.c:70:9: branch_false: ...to here
LVM2.2.03.36/lib/unknown/unknown.c:71:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/unknown/unknown.c:77:9: branch_false: ...to here
LVM2.2.03.36/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): [#def540]
LVM2.2.03.36/lib/unknown/unknown.c:79:9: warning[-Wanalyzer-malloc-leak]: leak of ‘strdup(name)’
LVM2.2.03.36/lib/unknown/unknown.c:65:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/unknown/unknown.c:70:9: branch_false: ...to here
LVM2.2.03.36/lib/unknown/unknown.c:71:31: acquire_memory: allocated here
LVM2.2.03.36/lib/unknown/unknown.c:71:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/unknown/unknown.c:77:9: branch_false: ...to here
LVM2.2.03.36/lib/unknown/unknown.c:79:9: danger: ‘strdup(name)’ 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): [#def541]
LVM2.2.03.36/lib/vdo/vdo.c:610:17: warning[-Wanalyzer-malloc-leak]: leak of ‘calloc(1, 72)’
LVM2.2.03.36/lib/vdo/vdo.c:603:5: enter_function: entry to ‘init_vdo_segtypes’
LVM2.2.03.36/lib/vdo/vdo.c:608:25: call_function: inlined call to ‘zalloc’ from ‘init_vdo_segtypes’
LVM2.2.03.36/lib/vdo/vdo.c:608:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/vdo/vdo.c:609:30: call_function: inlined call to ‘zalloc’ from ‘init_vdo_segtypes’
LVM2.2.03.36/lib/vdo/vdo.c:608:13: branch_true: following ‘true’ branch...
LVM2.2.03.36/lib/vdo/vdo.c:610:17: branch_true: ...to here
LVM2.2.03.36/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): [#def542]
LVM2.2.03.36/lib/vdo/vdo.c:619:14: warning[-Wanalyzer-malloc-leak]: leak of ‘calloc(1, 72)’
LVM2.2.03.36/lib/vdo/vdo.c:603:5: enter_function: entry to ‘init_vdo_segtypes’
LVM2.2.03.36/lib/vdo/vdo.c:608:25: call_function: inlined call to ‘zalloc’ from ‘init_vdo_segtypes’
LVM2.2.03.36/lib/vdo/vdo.c:608:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/vdo/vdo.c:609:30: call_function: inlined call to ‘zalloc’ from ‘init_vdo_segtypes’
LVM2.2.03.36/lib/vdo/vdo.c:608:13: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/vdo/vdo.c:615:9: branch_false: ...to here
LVM2.2.03.36/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): [#def543]
LVM2.2.03.36/lib/vdo/vdo.c:629:29: warning[-Wanalyzer-malloc-leak]: leak of ‘calloc(1, 72)’
LVM2.2.03.36/lib/vdo/vdo.c:603:5: enter_function: entry to ‘init_vdo_segtypes’
LVM2.2.03.36/lib/vdo/vdo.c:608:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/vdo/vdo.c:609:30: call_function: inlined call to ‘zalloc’ from ‘init_vdo_segtypes’
LVM2.2.03.36/lib/vdo/vdo.c:608:13: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/vdo/vdo.c:615:9: branch_false: ...to here
LVM2.2.03.36/lib/vdo/vdo.c:619:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/vdo/vdo.c:624:9: branch_false: ...to here
LVM2.2.03.36/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): [#def544]
LVM2.2.03.36/lib/vdo/vdo.c:635:14: warning[-Wanalyzer-malloc-leak]: leak of ‘calloc(1, 72)’
LVM2.2.03.36/lib/vdo/vdo.c:603:5: enter_function: entry to ‘init_vdo_segtypes’
LVM2.2.03.36/lib/vdo/vdo.c:608:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/vdo/vdo.c:609:30: call_function: inlined call to ‘zalloc’ from ‘init_vdo_segtypes’
LVM2.2.03.36/lib/vdo/vdo.c:608:13: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/vdo/vdo.c:615:9: branch_false: ...to here
LVM2.2.03.36/lib/vdo/vdo.c:619:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/vdo/vdo.c:624:9: branch_false: ...to here
LVM2.2.03.36/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): [#def545]
LVM2.2.03.36/lib/writecache/writecache.c:386:14: warning[-Wanalyzer-malloc-leak]: leak of ‘calloc(1, 72)’
LVM2.2.03.36/lib/writecache/writecache.c:372:5: enter_function: entry to ‘init_writecache_segtypes’
LVM2.2.03.36/lib/writecache/writecache.c:375:40: call_function: inlined call to ‘zalloc’ from ‘init_writecache_segtypes’
LVM2.2.03.36/lib/writecache/writecache.c:377:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/writecache/writecache.c:382:9: branch_false: ...to here
LVM2.2.03.36/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): [#def546]
LVM2.2.03.36/lib/zero/zero.c:99:9: warning[-Wanalyzer-malloc-leak]: leak of ‘calloc(1, 72)’
LVM2.2.03.36/lib/zero/zero.c:88:22: enter_function: entry to ‘init_zero_segtype’
LVM2.2.03.36/lib/zero/zero.c:90:40: call_function: inlined call to ‘zalloc’ from ‘init_zero_segtype’
LVM2.2.03.36/lib/zero/zero.c:92:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/lib/zero/zero.c:95:9: branch_false: ...to here
LVM2.2.03.36/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-404): [#def547]
LVM2.2.03.36/libdaemon/client/config-util.c:249:25: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
LVM2.2.03.36/libdaemon/client/config-util.c:289:24: enter_function: entry to ‘config_make_nodes’
LVM2.2.03.36/libdaemon/client/config-util.c:297:9: acquire_resource: ‘va_start’ called here
LVM2.2.03.36/libdaemon/client/config-util.c:298:15: call_function: calling ‘config_make_nodes_v’ from ‘config_make_nodes’
#  247|   
#  248|   		if (!fmt) {
#  249|-> 			log_error(INTERNAL_ERROR "Bad format string '%s'", fmt);
#  250|   			return NULL;
#  251|   		}

Error: GCC_ANALYZER_WARNING (CWE-404): [#def548]
LVM2.2.03.36/libdaemon/client/config-util.c:253:29: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
LVM2.2.03.36/libdaemon/client/config-util.c:289:24: enter_function: entry to ‘config_make_nodes’
LVM2.2.03.36/libdaemon/client/config-util.c:297:9: acquire_resource: ‘va_start’ called here
LVM2.2.03.36/libdaemon/client/config-util.c:298:15: call_function: calling ‘config_make_nodes_v’ from ‘config_make_nodes’
#  251|   		}
#  252|   
#  253|-> 		if (!(key = dm_pool_strdup(cft->mem, next))) {
#  254|   			log_error("Failed to duplicate node key.");
#  255|   			return NULL;

Error: GCC_ANALYZER_WARNING (CWE-404): [#def549]
LVM2.2.03.36/libdaemon/client/config-util.c:254:25: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
LVM2.2.03.36/libdaemon/client/config-util.c:289:24: enter_function: entry to ‘config_make_nodes’
LVM2.2.03.36/libdaemon/client/config-util.c:297:9: acquire_resource: ‘va_start’ called here
LVM2.2.03.36/libdaemon/client/config-util.c:298:15: call_function: calling ‘config_make_nodes_v’ from ‘config_make_nodes’
#  252|   
#  253|   		if (!(key = dm_pool_strdup(cft->mem, next))) {
#  254|-> 			log_error("Failed to duplicate node key.");
#  255|   			return NULL;
#  256|   		}

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

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

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

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

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

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

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

Error: GCC_ANALYZER_WARNING (CWE-775): [#def557]
LVM2.2.03.36/libdaemon/server/daemon-server.c:117:12: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(oom_adj_path, "w")’
LVM2.2.03.36/libdaemon/server/daemon-server.c:110:20: acquire_resource: opened here
LVM2.2.03.36/libdaemon/server/daemon-server.c:110:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/libdaemon/server/daemon-server.c:115:9: branch_false: ...to here
LVM2.2.03.36/libdaemon/server/daemon-server.c:117:12: 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): [#def558]
LVM2.2.03.36/libdaemon/server/daemon-server.c:117:12: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(oom_adj_path, "w")’
LVM2.2.03.36/libdaemon/server/daemon-server.c:110:20: acquire_memory: allocated here
LVM2.2.03.36/libdaemon/server/daemon-server.c:110:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/libdaemon/server/daemon-server.c:115:9: branch_false: ...to here
LVM2.2.03.36/libdaemon/server/daemon-server.c:117:12: 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): [#def559]
LVM2.2.03.36/libdaemon/server/daemon-server.c:248:32: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘fd’
LVM2.2.03.36/libdaemon/server/daemon-server.c:241:14: acquire_resource: stream socket created here
LVM2.2.03.36/libdaemon/server/daemon-server.c:242:12: branch_false: following ‘false’ branch (when ‘fd >= 0’)...
LVM2.2.03.36/libdaemon/server/daemon-server.c:248:32: branch_false: ...to here
LVM2.2.03.36/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): [#def560]
LVM2.2.03.36/libdaemon/server/daemon-server.c:300:17: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘fd’
LVM2.2.03.36/libdaemon/server/daemon-server.c:241:14: acquire_resource: stream socket created here
LVM2.2.03.36/libdaemon/server/daemon-server.c:242:12: branch_false: following ‘false’ branch (when ‘fd >= 0’)...
LVM2.2.03.36/libdaemon/server/daemon-server.c:248:32: branch_false: ...to here
LVM2.2.03.36/libdaemon/server/daemon-server.c:252:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/libdaemon/server/daemon-server.c:257:13: branch_false: ...to here
LVM2.2.03.36/libdaemon/server/daemon-server.c:299:12: branch_true: following ‘true’ branch...
LVM2.2.03.36/libdaemon/server/daemon-server.c:300:17: branch_true: ...to here
LVM2.2.03.36/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): [#def561]
LVM2.2.03.36/libdaemon/server/daemon-server.c:306:16: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘fd’
LVM2.2.03.36/libdaemon/server/daemon-server.c:241:14: acquire_resource: stream socket created here
LVM2.2.03.36/libdaemon/server/daemon-server.c:242:12: branch_false: following ‘false’ branch (when ‘fd >= 0’)...
LVM2.2.03.36/libdaemon/server/daemon-server.c:248:32: branch_false: ...to here
LVM2.2.03.36/libdaemon/server/daemon-server.c:252:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/libdaemon/server/daemon-server.c:257:13: branch_false: ...to here
LVM2.2.03.36/libdaemon/server/daemon-server.c:299:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/libdaemon/server/daemon-server.c:304:1: branch_false: ...to here
LVM2.2.03.36/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): [#def562]
LVM2.2.03.36/libdaemon/server/daemon-server.c:311:21: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘fd’
LVM2.2.03.36/libdaemon/server/daemon-server.c:241:14: acquire_resource: stream socket created here
LVM2.2.03.36/libdaemon/server/daemon-server.c:242:12: branch_false: following ‘false’ branch (when ‘fd >= 0’)...
LVM2.2.03.36/libdaemon/server/daemon-server.c:248:32: branch_false: ...to here
LVM2.2.03.36/libdaemon/server/daemon-server.c:252:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/libdaemon/server/daemon-server.c:257:13: branch_false: ...to here
LVM2.2.03.36/libdaemon/server/daemon-server.c:299:12: branch_true: following ‘true’ branch...
LVM2.2.03.36/libdaemon/server/daemon-server.c:300:17: branch_true: ...to here
LVM2.2.03.36/libdaemon/server/daemon-server.c:310:12: branch_true: following ‘true’ branch (when ‘fd >= 0’)...
LVM2.2.03.36/libdaemon/server/daemon-server.c:311:21: branch_true: ...to here
LVM2.2.03.36/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): [#def563]
LVM2.2.03.36/libdaemon/server/daemon-server.c:344:12: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘open("/dev/null", 2)’
LVM2.2.03.36/libdaemon/server/daemon-server.c:338:19: acquire_resource: opened here
LVM2.2.03.36/libdaemon/server/daemon-server.c:338:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/libdaemon/server/daemon-server.c:343:9: branch_false: ...to here
LVM2.2.03.36/libdaemon/server/daemon-server.c:344:12: danger: ‘open("/dev/null", 2)’ leaks here; was opened at [(1)](sarif:/runs/0/results/8/codeFlows/0/threadFlows/0/locations/0)
#  342|   
#  343|   	sigemptyset(&my_sigset);
#  344|-> 	if (sigprocmask(SIG_SETMASK, &my_sigset, NULL) < 0) {
#  345|   		fprintf(stderr, "Unable to restore signals.\n");
#  346|   		exit(EXIT_FAILURE);

Error: GCC_ANALYZER_WARNING (CWE-775): [#def564]
LVM2.2.03.36/libdaemon/server/daemon-server.c:350:9: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘open("/dev/null", 2)’
LVM2.2.03.36/libdaemon/server/daemon-server.c:338:19: acquire_resource: opened here
LVM2.2.03.36/libdaemon/server/daemon-server.c:338:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/libdaemon/server/daemon-server.c:343:9: branch_false: ...to here
LVM2.2.03.36/libdaemon/server/daemon-server.c:344:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/libdaemon/server/daemon-server.c:348:9: branch_false: ...to here
LVM2.2.03.36/libdaemon/server/daemon-server.c:350:9: danger: ‘open("/dev/null", 2)’ leaks here; was opened at [(1)](sarif:/runs/0/results/9/codeFlows/0/threadFlows/0/locations/0)
#  348|   	signal(SIGTERM, &_exit_handler);
#  349|   
#  350|-> 	switch (pid = fork()) {
#  351|   	case -1:
#  352|   		perror("fork failed:");

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

Error: GCC_ANALYZER_WARNING (CWE-775): [#def566]
LVM2.2.03.36/libdaemon/server/daemon-server.c:381:12: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘open("/dev/null", 2)’
LVM2.2.03.36/libdaemon/server/daemon-server.c:338:19: acquire_resource: opened here
LVM2.2.03.36/libdaemon/server/daemon-server.c:338:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/libdaemon/server/daemon-server.c:343:9: branch_false: ...to here
LVM2.2.03.36/libdaemon/server/daemon-server.c:344:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/libdaemon/server/daemon-server.c:348:9: branch_false: ...to here
LVM2.2.03.36/libdaemon/server/daemon-server.c:381:12: danger: ‘open("/dev/null", 2)’ leaks here; was opened at [(1)](sarif:/runs/0/results/11/codeFlows/0/threadFlows/0/locations/0)
#  379|   	}
#  380|   
#  381|-> 	if (chdir("/")) {
#  382|   		perror("Cannot chdir to /");
#  383|   		exit(1);

Error: GCC_ANALYZER_WARNING (CWE-775): [#def567]
LVM2.2.03.36/libdaemon/server/daemon-server.c:386:12: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘dup2(open("/dev/null", 2), 0)’
LVM2.2.03.36/libdaemon/server/daemon-server.c:338:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/libdaemon/server/daemon-server.c:343:9: branch_false: ...to here
LVM2.2.03.36/libdaemon/server/daemon-server.c:344:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/libdaemon/server/daemon-server.c:348:9: branch_false: ...to here
LVM2.2.03.36/libdaemon/server/daemon-server.c:381:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/libdaemon/server/daemon-server.c:386:14: branch_false: ...to here
LVM2.2.03.36/libdaemon/server/daemon-server.c:386:14: acquire_resource: opened here
LVM2.2.03.36/libdaemon/server/daemon-server.c:386:12: danger: ‘dup2(open("/dev/null", 2), 0)’ leaks here; was opened at [(9)](sarif:/runs/0/results/13/codeFlows/0/threadFlows/0/locations/8)
#  384|   	}
#  385|   
#  386|-> 	if ((dup2(fd, STDIN_FILENO) == -1) ||
#  387|   	    (dup2(fd, STDOUT_FILENO) == -1) ||
#  388|   	    (dup2(fd, STDERR_FILENO) == -1)) {

Error: GCC_ANALYZER_WARNING (CWE-775): [#def568]
LVM2.2.03.36/libdaemon/server/daemon-server.c:386:12: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘open("/dev/null", 2)’
LVM2.2.03.36/libdaemon/server/daemon-server.c:338:19: acquire_resource: opened here
LVM2.2.03.36/libdaemon/server/daemon-server.c:338:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/libdaemon/server/daemon-server.c:343:9: branch_false: ...to here
LVM2.2.03.36/libdaemon/server/daemon-server.c:344:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/libdaemon/server/daemon-server.c:348:9: branch_false: ...to here
LVM2.2.03.36/libdaemon/server/daemon-server.c:381:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/libdaemon/server/daemon-server.c:386:14: branch_false: ...to here
LVM2.2.03.36/libdaemon/server/daemon-server.c:386:12: danger: ‘open("/dev/null", 2)’ leaks here; was opened at [(1)](sarif:/runs/0/results/12/codeFlows/0/threadFlows/0/locations/0)
#  384|   	}
#  385|   
#  386|-> 	if ((dup2(fd, STDIN_FILENO) == -1) ||
#  387|   	    (dup2(fd, STDOUT_FILENO) == -1) ||
#  388|   	    (dup2(fd, STDERR_FILENO) == -1)) {

Error: GCC_ANALYZER_WARNING (CWE-775): [#def569]
LVM2.2.03.36/libdaemon/server/daemon-server.c:386:13: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘dup2(open("/dev/null", 2), 1)’
LVM2.2.03.36/libdaemon/server/daemon-server.c:338:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/libdaemon/server/daemon-server.c:343:9: branch_false: ...to here
LVM2.2.03.36/libdaemon/server/daemon-server.c:344:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/libdaemon/server/daemon-server.c:348:9: branch_false: ...to here
LVM2.2.03.36/libdaemon/server/daemon-server.c:381:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/libdaemon/server/daemon-server.c:386:14: branch_false: ...to here
LVM2.2.03.36/libdaemon/server/daemon-server.c:386:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/libdaemon/server/daemon-server.c:387:14: branch_false: ...to here
LVM2.2.03.36/libdaemon/server/daemon-server.c:387:14: acquire_resource: opened here
LVM2.2.03.36/libdaemon/server/daemon-server.c:386:13: danger: ‘dup2(open("/dev/null", 2), 1)’ leaks here; was opened at [(11)](sarif:/runs/0/results/14/codeFlows/0/threadFlows/0/locations/10)
#  384|   	}
#  385|   
#  386|-> 	if ((dup2(fd, STDIN_FILENO) == -1) ||
#  387|   	    (dup2(fd, STDOUT_FILENO) == -1) ||
#  388|   	    (dup2(fd, STDERR_FILENO) == -1)) {

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

Error: GCC_ANALYZER_WARNING (CWE-775): [#def571]
LVM2.2.03.36/libdaemon/server/daemon-server.c:386:13: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘open("/dev/null", 2)’
LVM2.2.03.36/libdaemon/server/daemon-server.c:338:19: acquire_resource: opened here
LVM2.2.03.36/libdaemon/server/daemon-server.c:338:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/libdaemon/server/daemon-server.c:343:9: branch_false: ...to here
LVM2.2.03.36/libdaemon/server/daemon-server.c:344:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/libdaemon/server/daemon-server.c:348:9: branch_false: ...to here
LVM2.2.03.36/libdaemon/server/daemon-server.c:381:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/libdaemon/server/daemon-server.c:386:14: branch_false: ...to here
LVM2.2.03.36/libdaemon/server/daemon-server.c:386:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/libdaemon/server/daemon-server.c:387:14: branch_false: ...to here
LVM2.2.03.36/libdaemon/server/daemon-server.c:386:13: danger: ‘open("/dev/null", 2)’ leaks here; was opened at [(1)](sarif:/runs/0/results/15/codeFlows/0/threadFlows/0/locations/0)
#  384|   	}
#  385|   
#  386|-> 	if ((dup2(fd, STDIN_FILENO) == -1) ||
#  387|   	    (dup2(fd, STDOUT_FILENO) == -1) ||
#  388|   	    (dup2(fd, STDERR_FILENO) == -1)) {

Error: GCC_ANALYZER_WARNING (CWE-775): [#def572]
LVM2.2.03.36/libdaemon/server/daemon-server.c:386:13: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘open("/dev/null", 2)’
LVM2.2.03.36/libdaemon/server/daemon-server.c:338:19: acquire_resource: opened here
LVM2.2.03.36/libdaemon/server/daemon-server.c:338:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/libdaemon/server/daemon-server.c:343:9: branch_false: ...to here
LVM2.2.03.36/libdaemon/server/daemon-server.c:344:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/libdaemon/server/daemon-server.c:348:9: branch_false: ...to here
LVM2.2.03.36/libdaemon/server/daemon-server.c:381:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/libdaemon/server/daemon-server.c:386:14: branch_false: ...to here
LVM2.2.03.36/libdaemon/server/daemon-server.c:386:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/libdaemon/server/daemon-server.c:387:14: branch_false: ...to here
LVM2.2.03.36/libdaemon/server/daemon-server.c:386:13: branch_false: following ‘false’ branch...
LVM2.2.03.36/libdaemon/server/daemon-server.c:388:14: branch_false: ...to here
LVM2.2.03.36/libdaemon/server/daemon-server.c:386:13: danger: ‘open("/dev/null", 2)’ leaks here; was opened at [(1)](sarif:/runs/0/results/17/codeFlows/0/threadFlows/0/locations/0)
#  384|   	}
#  385|   
#  386|-> 	if ((dup2(fd, STDIN_FILENO) == -1) ||
#  387|   	    (dup2(fd, STDOUT_FILENO) == -1) ||
#  388|   	    (dup2(fd, STDERR_FILENO) == -1)) {

Error: GCC_ANALYZER_WARNING (CWE-775): [#def573]
LVM2.2.03.36/libdaemon/server/daemon-server.c:393:12: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘open("/dev/null", 2)’
LVM2.2.03.36/libdaemon/server/daemon-server.c:338:19: acquire_resource: opened here
LVM2.2.03.36/libdaemon/server/daemon-server.c:338:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/libdaemon/server/daemon-server.c:343:9: branch_false: ...to here
LVM2.2.03.36/libdaemon/server/daemon-server.c:344:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/libdaemon/server/daemon-server.c:348:9: branch_false: ...to here
LVM2.2.03.36/libdaemon/server/daemon-server.c:381:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/libdaemon/server/daemon-server.c:386:14: branch_false: ...to here
LVM2.2.03.36/libdaemon/server/daemon-server.c:386:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/libdaemon/server/daemon-server.c:387:14: branch_false: ...to here
LVM2.2.03.36/libdaemon/server/daemon-server.c:386:13: branch_false: following ‘false’ branch...
LVM2.2.03.36/libdaemon/server/daemon-server.c:388:14: branch_false: ...to here
LVM2.2.03.36/libdaemon/server/daemon-server.c:386:13: branch_false: following ‘false’ branch...
LVM2.2.03.36/libdaemon/server/daemon-server.c:393:12: branch_false: ...to here
LVM2.2.03.36/libdaemon/server/daemon-server.c:393:12: danger: ‘open("/dev/null", 2)’ leaks here; was opened at [(1)](sarif:/runs/0/results/18/codeFlows/0/threadFlows/0/locations/0)
#  391|   	}
#  392|   
#  393|-> 	if ((fd > STDERR_FILENO) && close(fd)) {
#  394|   		perror("Failed to close /dev/null descriptor");
#  395|   		exit(3);

Error: GCC_ANALYZER_WARNING (CWE-775): [#def574]
LVM2.2.03.36/libdaemon/server/daemon-server.c:393:13: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘open("/dev/null", 2)’
LVM2.2.03.36/libdaemon/server/daemon-server.c:338:19: acquire_resource: opened here
LVM2.2.03.36/libdaemon/server/daemon-server.c:338:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/libdaemon/server/daemon-server.c:343:9: branch_false: ...to here
LVM2.2.03.36/libdaemon/server/daemon-server.c:344:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/libdaemon/server/daemon-server.c:348:9: branch_false: ...to here
LVM2.2.03.36/libdaemon/server/daemon-server.c:381:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/libdaemon/server/daemon-server.c:386:14: branch_false: ...to here
LVM2.2.03.36/libdaemon/server/daemon-server.c:386:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/libdaemon/server/daemon-server.c:387:14: branch_false: ...to here
LVM2.2.03.36/libdaemon/server/daemon-server.c:386:13: branch_false: following ‘false’ branch...
LVM2.2.03.36/libdaemon/server/daemon-server.c:388:14: branch_false: ...to here
LVM2.2.03.36/libdaemon/server/daemon-server.c:386:13: branch_false: following ‘false’ branch...
LVM2.2.03.36/libdaemon/server/daemon-server.c:393:12: branch_false: ...to here
LVM2.2.03.36/libdaemon/server/daemon-server.c:393:12: branch_true: following ‘true’ branch...
LVM2.2.03.36/libdaemon/server/daemon-server.c:393:37: branch_true: ...to here
LVM2.2.03.36/libdaemon/server/daemon-server.c:393:13: danger: ‘open("/dev/null", 2)’ leaks here; was opened at [(1)](sarif:/runs/0/results/19/codeFlows/0/threadFlows/0/locations/0)
#  391|   	}
#  392|   
#  393|-> 	if ((fd > STDERR_FILENO) && close(fd)) {
#  394|   		perror("Failed to close /dev/null descriptor");
#  395|   		exit(3);

Error: GCC_ANALYZER_WARNING (CWE-404): [#def575]
LVM2.2.03.36/libdaemon/server/daemon-server.c:412:9: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
LVM2.2.03.36/libdaemon/server/daemon-server.c:410:9: acquire_resource: ‘va_start’ called here
LVM2.2.03.36/libdaemon/server/daemon-server.c:412:9: danger: missing call to ‘va_end’ to match ‘va_start’ at [(1)](sarif:/runs/0/results/20/codeFlows/0/threadFlows/0/locations/0)
#  410|   	va_start(ap, id);
#  411|   
#  412|-> 	buffer_init(&res.buffer);
#  413|   	if (!buffer_append_f(&res.buffer, "response = %s", id, NULL)) {
#  414|   		res.error = ENOMEM;

Error: GCC_ANALYZER_WARNING (CWE-404): [#def576]
LVM2.2.03.36/libdaemon/server/daemon-server.c:413:14: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
LVM2.2.03.36/libdaemon/server/daemon-server.c:410:9: acquire_resource: ‘va_start’ called here
LVM2.2.03.36/libdaemon/server/daemon-server.c:413:14: danger: missing call to ‘va_end’ to match ‘va_start’ at [(1)](sarif:/runs/0/results/21/codeFlows/0/threadFlows/0/locations/0)
#  411|   
#  412|   	buffer_init(&res.buffer);
#  413|-> 	if (!buffer_append_f(&res.buffer, "response = %s", id, NULL)) {
#  414|   		res.error = ENOMEM;
#  415|   		goto end;

Error: GCC_ANALYZER_WARNING (CWE-404): [#def577]
LVM2.2.03.36/libdaemon/server/daemon-server.c:417:14: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
LVM2.2.03.36/libdaemon/server/daemon-server.c:410:9: acquire_resource: ‘va_start’ called here
LVM2.2.03.36/libdaemon/server/daemon-server.c:413:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/libdaemon/server/daemon-server.c:417:14: branch_false: ...to here
LVM2.2.03.36/libdaemon/server/daemon-server.c:417:14: danger: missing call to ‘va_end’ to match ‘va_start’ at [(1)](sarif:/runs/0/results/22/codeFlows/0/threadFlows/0/locations/0)
#  415|   		goto end;
#  416|   	}
#  417|-> 	if (!buffer_append_vf(&res.buffer, ap)) {
#  418|   		res.error = ENOMEM;
#  419|   		goto end;

Error: GCC_ANALYZER_WARNING (CWE-775): [#def578]
LVM2.2.03.36/libdaemon/server/daemon-stray.h:56:24: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘open(&buf, 0)’
LVM2.2.03.36/daemons/dmeventd/dmeventd.c:2218:13: enter_function: entry to ‘_daemonize’
LVM2.2.03.36/daemons/dmeventd/dmeventd.c:2232:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/daemons/dmeventd/dmeventd.c:2236:9: branch_false: ...to here
LVM2.2.03.36/daemons/dmeventd/dmeventd.c:2270:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/daemons/dmeventd/dmeventd.c:2273:9: branch_false: ...to here
LVM2.2.03.36/daemons/dmeventd/dmeventd.c:2273:9: call_function: calling ‘daemon_close_stray_fds’ from ‘_daemonize’
#   54|   			n = 0;
#   55|   		}
#   56|-> 		(void) close(fd);
#   57|   	}
#   58|   	cmdline[n] = '\0';

Error: GCC_ANALYZER_WARNING (CWE-401): [#def579]
LVM2.2.03.36/libdaemon/server/daemon-stray.h:132:34: warning[-Wanalyzer-malloc-leak]: leak of ‘opendir(&_fd_dir)’
LVM2.2.03.36/daemons/dmeventd/dmeventd.c:2218:13: enter_function: entry to ‘_daemonize’
LVM2.2.03.36/daemons/dmeventd/dmeventd.c:2232:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/daemons/dmeventd/dmeventd.c:2236:9: branch_false: ...to here
LVM2.2.03.36/daemons/dmeventd/dmeventd.c:2270:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/daemons/dmeventd/dmeventd.c:2273:9: branch_false: ...to here
LVM2.2.03.36/daemons/dmeventd/dmeventd.c:2273: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): [#def580]
LVM2.2.03.36/libdm/dm-tools/dmfilemapd.c:127:9: warning[-Wanalyzer-malloc-leak]: leak of ‘fm.path’
LVM2.2.03.36/libdm/dm-tools/dmfilemapd.c:815:5: enter_function: entry to ‘main’
LVM2.2.03.36/libdm/dm-tools/dmfilemapd.c:819:14: call_function: calling ‘_parse_args’ from ‘main’
LVM2.2.03.36/libdm/dm-tools/dmfilemapd.c:819:14: return_function: returning to ‘main’ from ‘_parse_args’
LVM2.2.03.36/libdm/dm-tools/dmfilemapd.c:819:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/libdm/dm-tools/dmfilemapd.c:824:9: branch_false: ...to here
LVM2.2.03.36/libdm/dm-tools/dmfilemapd.c:824:9: call_function: calling ‘_setup_logging’ from ‘main’
#  125|   static void _setup_logging(void)
#  126|   {
#  127|-> 	dm_log_init_verbose(_verbose - 1);
#  128|   	dm_log_with_errno_init(_dmfilemapd_log_with_errno);
#  129|   }

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

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

Error: GCC_ANALYZER_WARNING (CWE-775): [#def583]
LVM2.2.03.36/libdm/dm-tools/dmfilemapd.c:552:17: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘open(&link_buf, 0)’
LVM2.2.03.36/libdm/dm-tools/dmfilemapd.c:564:12: enter_function: entry to ‘_filemap_monitor_check_file_unlinked’
LVM2.2.03.36/libdm/dm-tools/dmfilemapd.c:594:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/libdm/dm-tools/dmfilemapd.c:599:20: branch_false: ...to here
LVM2.2.03.36/libdm/dm-tools/dmfilemapd.c:599:12: branch_false: following ‘false’ branch (when ‘len >= 0’)...
LVM2.2.03.36/libdm/dm-tools/dmfilemapd.c:604:9: branch_false: ...to here
LVM2.2.03.36/libdm/dm-tools/dmfilemapd.c:609:19: acquire_resource: opened here
LVM2.2.03.36/libdm/dm-tools/dmfilemapd.c:609:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/libdm/dm-tools/dmfilemapd.c:612:24: branch_false: ...to here
LVM2.2.03.36/libdm/dm-tools/dmfilemapd.c:612:24: call_function: calling ‘_filemap_monitor_check_same_file’ from ‘_filemap_monitor_check_file_unlinked’
#  550|   
#  551|   	if (fstat(fd1, &buf1)) {
#  552|-> 		log_error("Failed to fstat file descriptor %d", fd1);
#  553|   		return -1;
#  554|   	}

Error: GCC_ANALYZER_WARNING (CWE-775): [#def584]
LVM2.2.03.36/libdm/dm-tools/dmfilemapd.c:552:17: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘open(*fm.path, 0)’
LVM2.2.03.36/libdm/dm-tools/dmfilemapd.c:564:12: enter_function: entry to ‘_filemap_monitor_check_file_unlinked’
LVM2.2.03.36/libdm/dm-tools/dmfilemapd.c:574:19: acquire_resource: opened here
LVM2.2.03.36/libdm/dm-tools/dmfilemapd.c:574:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/libdm/dm-tools/dmfilemapd.c:577:16: branch_false: ...to here
LVM2.2.03.36/libdm/dm-tools/dmfilemapd.c:577:16: call_function: calling ‘_filemap_monitor_check_same_file’ from ‘_filemap_monitor_check_file_unlinked’
#  550|   
#  551|   	if (fstat(fd1, &buf1)) {
#  552|-> 		log_error("Failed to fstat file descriptor %d", fd1);
#  553|   		return -1;
#  554|   	}

Error: GCC_ANALYZER_WARNING (CWE-775): [#def585]
LVM2.2.03.36/libdm/dm-tools/dmfilemapd.c:579:13: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘open(*fm.path, 0)’
LVM2.2.03.36/libdm/dm-tools/dmfilemapd.c:574:19: acquire_resource: opened here
LVM2.2.03.36/libdm/dm-tools/dmfilemapd.c:574:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/libdm/dm-tools/dmfilemapd.c:577:16: branch_false: ...to here
LVM2.2.03.36/libdm/dm-tools/dmfilemapd.c:579:13: danger: ‘open(*fm.path, 0)’ leaks here; was opened at [(1)](sarif:/runs/0/results/5/codeFlows/0/threadFlows/0/locations/0)
#  577|   	same = _filemap_monitor_check_same_file(fm->fd, fd);
#  578|   
#  579|-> 	if (close(fd))
#  580|   		log_error("Error closing fd %d", fd);
#  581|   

Error: GCC_ANALYZER_WARNING (CWE-775): [#def586]
LVM2.2.03.36/libdm/dm-tools/dmfilemapd.c:614:26: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘open(&link_buf, 0)’
LVM2.2.03.36/libdm/dm-tools/dmfilemapd.c:594:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/libdm/dm-tools/dmfilemapd.c:599:20: branch_false: ...to here
LVM2.2.03.36/libdm/dm-tools/dmfilemapd.c:599:12: branch_false: following ‘false’ branch (when ‘len >= 0’)...
LVM2.2.03.36/libdm/dm-tools/dmfilemapd.c:604:9: branch_false: ...to here
LVM2.2.03.36/libdm/dm-tools/dmfilemapd.c:609:19: acquire_resource: opened here
LVM2.2.03.36/libdm/dm-tools/dmfilemapd.c:609:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/libdm/dm-tools/dmfilemapd.c:612:24: branch_false: ...to here
LVM2.2.03.36/libdm/dm-tools/dmfilemapd.c:614:26: danger: ‘open(&link_buf, 0)’ leaks here; was opened at [(5)](sarif:/runs/0/results/6/codeFlows/0/threadFlows/0/locations/4)
#  612|   		same = _filemap_monitor_check_same_file(fm->fd, fd);
#  613|   
#  614|-> 	if ((fd >= 0) && close(fd))
#  615|   		log_error("Error closing fd %d", fd);
#  616|   

Error: GCC_ANALYZER_WARNING (CWE-775): [#def587]
LVM2.2.03.36/libdm/dm-tools/dmfilemapd.c:661:20: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘dup2(open("/dev/null", 2), 0)’
LVM2.2.03.36/libdm/dm-tools/dmfilemapd.c:634:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/libdm/dm-tools/dmfilemapd.c:639:20: branch_false: ...to here
LVM2.2.03.36/libdm/dm-tools/dmfilemapd.c:639:12: branch_false: following ‘false’ branch (when ‘pid >= 0’)...
LVM2.2.03.36/libdm/dm-tools/dmfilemapd.c:644:12: branch_false: ...to here
LVM2.2.03.36/libdm/dm-tools/dmfilemapd.c:644:12: branch_false: following ‘false’ branch (when ‘pid == 0’)...
LVM2.2.03.36/libdm/dm-tools/dmfilemapd.c:650:13: branch_false: ...to here
LVM2.2.03.36/libdm/dm-tools/dmfilemapd.c:650:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/libdm/dm-tools/dmfilemapd.c:655:13: branch_false: ...to here
LVM2.2.03.36/libdm/dm-tools/dmfilemapd.c:655:12: branch_true: following ‘true’ branch...
LVM2.2.03.36/libdm/dm-tools/dmfilemapd.c:656:27: branch_true: ...to here
LVM2.2.03.36/libdm/dm-tools/dmfilemapd.c:656:20: branch_false: following ‘false’ branch...
LVM2.2.03.36/libdm/dm-tools/dmfilemapd.c:661:22: branch_false: ...to here
LVM2.2.03.36/libdm/dm-tools/dmfilemapd.c:661:22: acquire_resource: opened here
LVM2.2.03.36/libdm/dm-tools/dmfilemapd.c:661:20: danger: ‘dup2(open("/dev/null", 2), 0)’ leaks here; was opened at [(13)](sarif:/runs/0/results/7/codeFlows/0/threadFlows/0/locations/12)
#  659|   		}
#  660|   
#  661|-> 		if ((dup2(fd, STDIN_FILENO) == -1) ||
#  662|   		    (dup2(fd, STDOUT_FILENO) == -1) ||
#  663|   		    (dup2(fd, STDERR_FILENO) == -1)) {

Error: GCC_ANALYZER_WARNING (CWE-775): [#def588]
LVM2.2.03.36/libdm/dm-tools/dmfilemapd.c:661:21: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘dup2(open("/dev/null", 2), 1)’
LVM2.2.03.36/libdm/dm-tools/dmfilemapd.c:634:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/libdm/dm-tools/dmfilemapd.c:639:20: branch_false: ...to here
LVM2.2.03.36/libdm/dm-tools/dmfilemapd.c:639:12: branch_false: following ‘false’ branch (when ‘pid >= 0’)...
LVM2.2.03.36/libdm/dm-tools/dmfilemapd.c:644:12: branch_false: ...to here
LVM2.2.03.36/libdm/dm-tools/dmfilemapd.c:644:12: branch_false: following ‘false’ branch (when ‘pid == 0’)...
LVM2.2.03.36/libdm/dm-tools/dmfilemapd.c:650:13: branch_false: ...to here
LVM2.2.03.36/libdm/dm-tools/dmfilemapd.c:650:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/libdm/dm-tools/dmfilemapd.c:655:13: branch_false: ...to here
LVM2.2.03.36/libdm/dm-tools/dmfilemapd.c:655:12: branch_true: following ‘true’ branch...
LVM2.2.03.36/libdm/dm-tools/dmfilemapd.c:656:27: branch_true: ...to here
LVM2.2.03.36/libdm/dm-tools/dmfilemapd.c:656:20: branch_false: following ‘false’ branch...
LVM2.2.03.36/libdm/dm-tools/dmfilemapd.c:661:22: branch_false: ...to here
LVM2.2.03.36/libdm/dm-tools/dmfilemapd.c:661:20: branch_false: following ‘false’ branch...
LVM2.2.03.36/libdm/dm-tools/dmfilemapd.c:662:22: branch_false: ...to here
LVM2.2.03.36/libdm/dm-tools/dmfilemapd.c:662:22: acquire_resource: opened here
LVM2.2.03.36/libdm/dm-tools/dmfilemapd.c:661:21: danger: ‘dup2(open("/dev/null", 2), 1)’ leaks here; was opened at [(15)](sarif:/runs/0/results/8/codeFlows/0/threadFlows/0/locations/14)
#  659|   		}
#  660|   
#  661|-> 		if ((dup2(fd, STDIN_FILENO) == -1) ||
#  662|   		    (dup2(fd, STDOUT_FILENO) == -1) ||
#  663|   		    (dup2(fd, STDERR_FILENO) == -1)) {

Error: GCC_ANALYZER_WARNING (CWE-775): [#def589]
LVM2.2.03.36/libdm/dm-tools/dmfilemapd.c:661:21: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘dup2(open("/dev/null", 2), 2)’
LVM2.2.03.36/libdm/dm-tools/dmfilemapd.c:634:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/libdm/dm-tools/dmfilemapd.c:639:20: branch_false: ...to here
LVM2.2.03.36/libdm/dm-tools/dmfilemapd.c:639:12: branch_false: following ‘false’ branch (when ‘pid >= 0’)...
LVM2.2.03.36/libdm/dm-tools/dmfilemapd.c:644:12: branch_false: ...to here
LVM2.2.03.36/libdm/dm-tools/dmfilemapd.c:644:12: branch_false: following ‘false’ branch (when ‘pid == 0’)...
LVM2.2.03.36/libdm/dm-tools/dmfilemapd.c:650:13: branch_false: ...to here
LVM2.2.03.36/libdm/dm-tools/dmfilemapd.c:650:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/libdm/dm-tools/dmfilemapd.c:655:13: branch_false: ...to here
LVM2.2.03.36/libdm/dm-tools/dmfilemapd.c:655:12: branch_true: following ‘true’ branch...
LVM2.2.03.36/libdm/dm-tools/dmfilemapd.c:656:27: branch_true: ...to here
LVM2.2.03.36/libdm/dm-tools/dmfilemapd.c:656:20: branch_false: following ‘false’ branch...
LVM2.2.03.36/libdm/dm-tools/dmfilemapd.c:661:22: branch_false: ...to here
LVM2.2.03.36/libdm/dm-tools/dmfilemapd.c:661:20: branch_false: following ‘false’ branch...
LVM2.2.03.36/libdm/dm-tools/dmfilemapd.c:662:22: branch_false: ...to here
LVM2.2.03.36/libdm/dm-tools/dmfilemapd.c:661:21: branch_false: following ‘false’ branch...
LVM2.2.03.36/libdm/dm-tools/dmfilemapd.c:663:22: branch_false: ...to here
LVM2.2.03.36/libdm/dm-tools/dmfilemapd.c:663:22: acquire_resource: opened here
LVM2.2.03.36/libdm/dm-tools/dmfilemapd.c:661:21: danger: ‘dup2(open("/dev/null", 2), 2)’ leaks here; was opened at [(17)](sarif:/runs/0/results/9/codeFlows/0/threadFlows/0/locations/16)
#  659|   		}
#  660|   
#  661|-> 		if ((dup2(fd, STDIN_FILENO) == -1) ||
#  662|   		    (dup2(fd, STDOUT_FILENO) == -1) ||
#  663|   		    (dup2(fd, STDERR_FILENO) == -1)) {

Error: GCC_ANALYZER_WARNING (CWE-775): [#def590]
LVM2.2.03.36/libdm/dm-tools/dmfilemapd.c:664:28: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘open("/dev/null", 2)’
LVM2.2.03.36/libdm/dm-tools/dmfilemapd.c:634:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/libdm/dm-tools/dmfilemapd.c:639:20: branch_false: ...to here
LVM2.2.03.36/libdm/dm-tools/dmfilemapd.c:639:12: branch_false: following ‘false’ branch (when ‘pid >= 0’)...
LVM2.2.03.36/libdm/dm-tools/dmfilemapd.c:644:12: branch_false: ...to here
LVM2.2.03.36/libdm/dm-tools/dmfilemapd.c:644:12: branch_false: following ‘false’ branch (when ‘pid == 0’)...
LVM2.2.03.36/libdm/dm-tools/dmfilemapd.c:650:13: branch_false: ...to here
LVM2.2.03.36/libdm/dm-tools/dmfilemapd.c:650:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/libdm/dm-tools/dmfilemapd.c:655:13: branch_false: ...to here
LVM2.2.03.36/libdm/dm-tools/dmfilemapd.c:655:12: branch_true: following ‘true’ branch...
LVM2.2.03.36/libdm/dm-tools/dmfilemapd.c:656:27: branch_true: ...to here
LVM2.2.03.36/libdm/dm-tools/dmfilemapd.c:656:27: acquire_resource: opened here
LVM2.2.03.36/libdm/dm-tools/dmfilemapd.c:656:20: branch_false: following ‘false’ branch...
LVM2.2.03.36/libdm/dm-tools/dmfilemapd.c:661:22: branch_false: ...to here
LVM2.2.03.36/libdm/dm-tools/dmfilemapd.c:664:28: danger: ‘open("/dev/null", 2)’ leaks here; was opened at [(11)](sarif:/runs/0/results/10/codeFlows/0/threadFlows/0/locations/10)
#  662|   		    (dup2(fd, STDOUT_FILENO) == -1) ||
#  663|   		    (dup2(fd, STDERR_FILENO) == -1)) {
#  664|-> 			if (fd > STDERR_FILENO)
#  665|   				(void) close(fd);
#  666|   			_early_log("Error redirecting stdin/out/err to null.");

Error: GCC_ANALYZER_WARNING (CWE-775): [#def591]
LVM2.2.03.36/libdm/dm-tools/dmfilemapd.c:665:40: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘open("/dev/null", 2)’
LVM2.2.03.36/libdm/dm-tools/dmfilemapd.c:634:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/libdm/dm-tools/dmfilemapd.c:639:20: branch_false: ...to here
LVM2.2.03.36/libdm/dm-tools/dmfilemapd.c:639:12: branch_false: following ‘false’ branch (when ‘pid >= 0’)...
LVM2.2.03.36/libdm/dm-tools/dmfilemapd.c:644:12: branch_false: ...to here
LVM2.2.03.36/libdm/dm-tools/dmfilemapd.c:644:12: branch_false: following ‘false’ branch (when ‘pid == 0’)...
LVM2.2.03.36/libdm/dm-tools/dmfilemapd.c:650:13: branch_false: ...to here
LVM2.2.03.36/libdm/dm-tools/dmfilemapd.c:650:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/libdm/dm-tools/dmfilemapd.c:655:13: branch_false: ...to here
LVM2.2.03.36/libdm/dm-tools/dmfilemapd.c:655:12: branch_true: following ‘true’ branch...
LVM2.2.03.36/libdm/dm-tools/dmfilemapd.c:656:27: branch_true: ...to here
LVM2.2.03.36/libdm/dm-tools/dmfilemapd.c:656:27: acquire_resource: opened here
LVM2.2.03.36/libdm/dm-tools/dmfilemapd.c:656:20: branch_false: following ‘false’ branch...
LVM2.2.03.36/libdm/dm-tools/dmfilemapd.c:661:22: branch_false: ...to here
LVM2.2.03.36/libdm/dm-tools/dmfilemapd.c:664:28: branch_true: following ‘true’ branch...
LVM2.2.03.36/libdm/dm-tools/dmfilemapd.c:665:40: branch_true: ...to here
LVM2.2.03.36/libdm/dm-tools/dmfilemapd.c:665:40: danger: ‘open("/dev/null", 2)’ leaks here; was opened at [(11)](sarif:/runs/0/results/11/codeFlows/0/threadFlows/0/locations/10)
#  663|   		    (dup2(fd, STDERR_FILENO) == -1)) {
#  664|   			if (fd > STDERR_FILENO)
#  665|-> 				(void) close(fd);
#  666|   			_early_log("Error redirecting stdin/out/err to null.");
#  667|   			/* coverity[leaked_handle] no leak */

Error: GCC_ANALYZER_WARNING (CWE-775): [#def592]
LVM2.2.03.36/libdm/dm-tools/dmfilemapd.c:670:20: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘open("/dev/null", 2)’
LVM2.2.03.36/libdm/dm-tools/dmfilemapd.c:634:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/libdm/dm-tools/dmfilemapd.c:639:20: branch_false: ...to here
LVM2.2.03.36/libdm/dm-tools/dmfilemapd.c:639:12: branch_false: following ‘false’ branch (when ‘pid >= 0’)...
LVM2.2.03.36/libdm/dm-tools/dmfilemapd.c:644:12: branch_false: ...to here
LVM2.2.03.36/libdm/dm-tools/dmfilemapd.c:644:12: branch_false: following ‘false’ branch (when ‘pid == 0’)...
LVM2.2.03.36/libdm/dm-tools/dmfilemapd.c:650:13: branch_false: ...to here
LVM2.2.03.36/libdm/dm-tools/dmfilemapd.c:650:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/libdm/dm-tools/dmfilemapd.c:655:13: branch_false: ...to here
LVM2.2.03.36/libdm/dm-tools/dmfilemapd.c:655:12: branch_true: following ‘true’ branch...
LVM2.2.03.36/libdm/dm-tools/dmfilemapd.c:656:27: branch_true: ...to here
LVM2.2.03.36/libdm/dm-tools/dmfilemapd.c:656:27: acquire_resource: opened here
LVM2.2.03.36/libdm/dm-tools/dmfilemapd.c:656:20: branch_false: following ‘false’ branch...
LVM2.2.03.36/libdm/dm-tools/dmfilemapd.c:661:22: branch_false: ...to here
LVM2.2.03.36/libdm/dm-tools/dmfilemapd.c:661:20: branch_false: following ‘false’ branch...
LVM2.2.03.36/libdm/dm-tools/dmfilemapd.c:662:22: branch_false: ...to here
LVM2.2.03.36/libdm/dm-tools/dmfilemapd.c:661:21: branch_false: following ‘false’ branch...
LVM2.2.03.36/libdm/dm-tools/dmfilemapd.c:663:22: branch_false: ...to here
LVM2.2.03.36/libdm/dm-tools/dmfilemapd.c:661:21: branch_false: following ‘false’ branch...
LVM2.2.03.36/libdm/dm-tools/dmfilemapd.c:670:20: branch_false: ...to here
LVM2.2.03.36/libdm/dm-tools/dmfilemapd.c:670:20: danger: ‘open("/dev/null", 2)’ leaks here; was opened at [(11)](sarif:/runs/0/results/12/codeFlows/0/threadFlows/0/locations/10)
#  668|   			return 0;
#  669|   		}
#  670|-> 		if (fd > STDERR_FILENO)
#  671|   			(void) close(fd);
#  672|   	}

Error: GCC_ANALYZER_WARNING (CWE-775): [#def593]
LVM2.2.03.36/libdm/dm-tools/dmfilemapd.c:671:32: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘open("/dev/null", 2)’
LVM2.2.03.36/libdm/dm-tools/dmfilemapd.c:634:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/libdm/dm-tools/dmfilemapd.c:639:20: branch_false: ...to here
LVM2.2.03.36/libdm/dm-tools/dmfilemapd.c:639:12: branch_false: following ‘false’ branch (when ‘pid >= 0’)...
LVM2.2.03.36/libdm/dm-tools/dmfilemapd.c:644:12: branch_false: ...to here
LVM2.2.03.36/libdm/dm-tools/dmfilemapd.c:644:12: branch_false: following ‘false’ branch (when ‘pid == 0’)...
LVM2.2.03.36/libdm/dm-tools/dmfilemapd.c:650:13: branch_false: ...to here
LVM2.2.03.36/libdm/dm-tools/dmfilemapd.c:650:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/libdm/dm-tools/dmfilemapd.c:655:13: branch_false: ...to here
LVM2.2.03.36/libdm/dm-tools/dmfilemapd.c:655:12: branch_true: following ‘true’ branch...
LVM2.2.03.36/libdm/dm-tools/dmfilemapd.c:656:27: branch_true: ...to here
LVM2.2.03.36/libdm/dm-tools/dmfilemapd.c:656:27: acquire_resource: opened here
LVM2.2.03.36/libdm/dm-tools/dmfilemapd.c:656:20: branch_false: following ‘false’ branch...
LVM2.2.03.36/libdm/dm-tools/dmfilemapd.c:661:22: branch_false: ...to here
LVM2.2.03.36/libdm/dm-tools/dmfilemapd.c:661:20: branch_false: following ‘false’ branch...
LVM2.2.03.36/libdm/dm-tools/dmfilemapd.c:662:22: branch_false: ...to here
LVM2.2.03.36/libdm/dm-tools/dmfilemapd.c:661:21: branch_false: following ‘false’ branch...
LVM2.2.03.36/libdm/dm-tools/dmfilemapd.c:663:22: branch_false: ...to here
LVM2.2.03.36/libdm/dm-tools/dmfilemapd.c:661:21: branch_false: following ‘false’ branch...
LVM2.2.03.36/libdm/dm-tools/dmfilemapd.c:670:20: branch_false: ...to here
LVM2.2.03.36/libdm/dm-tools/dmfilemapd.c:670:20: branch_true: following ‘true’ branch...
LVM2.2.03.36/libdm/dm-tools/dmfilemapd.c:671:32: branch_true: ...to here
LVM2.2.03.36/libdm/dm-tools/dmfilemapd.c:671:32: danger: ‘open("/dev/null", 2)’ leaks here; was opened at [(11)](sarif:/runs/0/results/13/codeFlows/0/threadFlows/0/locations/10)
#  669|   		}
#  670|   		if (fd > STDERR_FILENO)
#  671|-> 			(void) close(fd);
#  672|   	}
#  673|   	/* TODO: Use libdaemon/server/daemon-server.c _daemonize() */

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

Error: GCC_ANALYZER_WARNING (CWE-401): [#def595]
LVM2.2.03.36/libdm/ioctl/libdm-iface.c:1383:26: warning[-Wanalyzer-malloc-leak]: leak of ‘opendir(dm_dir())’
LVM2.2.03.36/libdm/ioctl/libdm-iface.c:1378:19: acquire_memory: allocated here
LVM2.2.03.36/libdm/ioctl/libdm-iface.c:1378:12: branch_false: following ‘false’ branch...
 branch_false: ...to here
LVM2.2.03.36/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-775): [#def596]
LVM2.2.03.36/libdm/libdm-common.c:310:31: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(&_mountinfo, "r")’
LVM2.2.03.36/libdm/libdm-common.c:1800:5: enter_function: entry to ‘dm_mountinfo_read’
LVM2.2.03.36/libdm/libdm-common.c:1808:23: acquire_resource: opened here
LVM2.2.03.36/libdm/libdm-common.c:1808:12: branch_false: following ‘false’ branch...
 branch_false: ...to here
LVM2.2.03.36/libdm/libdm-common.c:1816:16: branch_true: following ‘true’ branch...
LVM2.2.03.36/libdm/libdm-common.c:1818:22: call_function: calling ‘_mountinfo_parse_line’ from ‘dm_mountinfo_read’
#  308|   struct dm_task *dm_task_create(int type)
#  309|   {
#  310|-> 	struct dm_task *dmt = dm_zalloc(sizeof(*dmt));
#  311|   
#  312|   	if (!dmt) {

Error: GCC_ANALYZER_WARNING (CWE-401): [#def597]
LVM2.2.03.36/libdm/libdm-common.c:310:31: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(&_mountinfo, "r")’
LVM2.2.03.36/libdm/libdm-common.c:1800:5: enter_function: entry to ‘dm_mountinfo_read’
LVM2.2.03.36/libdm/libdm-common.c:1808:23: acquire_memory: allocated here
LVM2.2.03.36/libdm/libdm-common.c:1808:12: branch_false: following ‘false’ branch...
 branch_false: ...to here
LVM2.2.03.36/libdm/libdm-common.c:1816:16: branch_true: following ‘true’ branch...
LVM2.2.03.36/libdm/libdm-common.c:1818:22: call_function: calling ‘_mountinfo_parse_line’ from ‘dm_mountinfo_read’
#  308|   struct dm_task *dm_task_create(int type)
#  309|   {
#  310|-> 	struct dm_task *dmt = dm_zalloc(sizeof(*dmt));
#  311|   
#  312|   	if (!dmt) {

Error: GCC_ANALYZER_WARNING (CWE-775): [#def598]
LVM2.2.03.36/libdm/libdm-common.c:313:17: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(&_mountinfo, "r")’
LVM2.2.03.36/libdm/libdm-common.c:1800:5: enter_function: entry to ‘dm_mountinfo_read’
LVM2.2.03.36/libdm/libdm-common.c:1808:23: acquire_resource: opened here
LVM2.2.03.36/libdm/libdm-common.c:1808:12: branch_false: following ‘false’ branch...
 branch_false: ...to here
LVM2.2.03.36/libdm/libdm-common.c:1816:16: branch_true: following ‘true’ branch...
LVM2.2.03.36/libdm/libdm-common.c:1818:22: call_function: calling ‘_mountinfo_parse_line’ from ‘dm_mountinfo_read’
#  311|   
#  312|   	if (!dmt) {
#  313|-> 		log_error("dm_task_create: malloc(%" PRIsize_t ") failed",
#  314|   			  sizeof(*dmt));
#  315|   		return NULL;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def599]
LVM2.2.03.36/libdm/libdm-common.c:313:17: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(&_mountinfo, "r")’
LVM2.2.03.36/libdm/libdm-common.c:1800:5: enter_function: entry to ‘dm_mountinfo_read’
LVM2.2.03.36/libdm/libdm-common.c:1808:23: acquire_memory: allocated here
LVM2.2.03.36/libdm/libdm-common.c:1808:12: branch_false: following ‘false’ branch...
 branch_false: ...to here
LVM2.2.03.36/libdm/libdm-common.c:1816:16: branch_true: following ‘true’ branch...
LVM2.2.03.36/libdm/libdm-common.c:1818:22: call_function: calling ‘_mountinfo_parse_line’ from ‘dm_mountinfo_read’
#  311|   
#  312|   	if (!dmt) {
#  313|-> 		log_error("dm_task_create: malloc(%" PRIsize_t ") failed",
#  314|   			  sizeof(*dmt));
#  315|   		return NULL;

Error: GCC_ANALYZER_WARNING (CWE-775): [#def600]
LVM2.2.03.36/libdm/libdm-common.c:318:14: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(&_mountinfo, "r")’
LVM2.2.03.36/libdm/libdm-common.c:1800:5: enter_function: entry to ‘dm_mountinfo_read’
LVM2.2.03.36/libdm/libdm-common.c:1808:23: acquire_resource: opened here
LVM2.2.03.36/libdm/libdm-common.c:1808:12: branch_false: following ‘false’ branch...
 branch_false: ...to here
LVM2.2.03.36/libdm/libdm-common.c:1816:16: branch_true: following ‘true’ branch...
LVM2.2.03.36/libdm/libdm-common.c:1818:22: call_function: calling ‘_mountinfo_parse_line’ from ‘dm_mountinfo_read’
#  316|   	}
#  317|   
#  318|-> 	if (!dm_check_version()) {
#  319|   		dm_free(dmt);
#  320|   		return_NULL;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def601]
LVM2.2.03.36/libdm/libdm-common.c:318:14: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(&_mountinfo, "r")’
LVM2.2.03.36/libdm/libdm-common.c:1800:5: enter_function: entry to ‘dm_mountinfo_read’
LVM2.2.03.36/libdm/libdm-common.c:1808:23: acquire_memory: allocated here
LVM2.2.03.36/libdm/libdm-common.c:1808:12: branch_false: following ‘false’ branch...
 branch_false: ...to here
LVM2.2.03.36/libdm/libdm-common.c:1816:16: branch_true: following ‘true’ branch...
LVM2.2.03.36/libdm/libdm-common.c:1818:22: call_function: calling ‘_mountinfo_parse_line’ from ‘dm_mountinfo_read’
#  316|   	}
#  317|   
#  318|-> 	if (!dm_check_version()) {
#  319|   		dm_free(dmt);
#  320|   		return_NULL;

Error: GCC_ANALYZER_WARNING (CWE-775): [#def602]
LVM2.2.03.36/libdm/libdm-common.c:319:17: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(&_mountinfo, "r")’
LVM2.2.03.36/libdm/libdm-common.c:1800:5: enter_function: entry to ‘dm_mountinfo_read’
LVM2.2.03.36/libdm/libdm-common.c:1808:23: acquire_resource: opened here
LVM2.2.03.36/libdm/libdm-common.c:1808:12: branch_false: following ‘false’ branch...
 branch_false: ...to here
LVM2.2.03.36/libdm/libdm-common.c:1816:16: branch_true: following ‘true’ branch...
LVM2.2.03.36/libdm/libdm-common.c:1818:22: call_function: calling ‘_mountinfo_parse_line’ from ‘dm_mountinfo_read’
#  317|   
#  318|   	if (!dm_check_version()) {
#  319|-> 		dm_free(dmt);
#  320|   		return_NULL;
#  321|   	}

Error: GCC_ANALYZER_WARNING (CWE-401): [#def603]
LVM2.2.03.36/libdm/libdm-common.c:319:17: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(&_mountinfo, "r")’
LVM2.2.03.36/libdm/libdm-common.c:1800:5: enter_function: entry to ‘dm_mountinfo_read’
LVM2.2.03.36/libdm/libdm-common.c:1808:23: acquire_memory: allocated here
LVM2.2.03.36/libdm/libdm-common.c:1808:12: branch_false: following ‘false’ branch...
 branch_false: ...to here
LVM2.2.03.36/libdm/libdm-common.c:1816:16: branch_true: following ‘true’ branch...
LVM2.2.03.36/libdm/libdm-common.c:1818:22: call_function: calling ‘_mountinfo_parse_line’ from ‘dm_mountinfo_read’
#  317|   
#  318|   	if (!dm_check_version()) {
#  319|-> 		dm_free(dmt);
#  320|   		return_NULL;
#  321|   	}

Error: GCC_ANALYZER_WARNING (CWE-775): [#def604]
LVM2.2.03.36/libdm/libdm-common.c:320:17: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(&_mountinfo, "r")’
LVM2.2.03.36/libdm/libdm-common.c:1800:5: enter_function: entry to ‘dm_mountinfo_read’
LVM2.2.03.36/libdm/libdm-common.c:1808:23: acquire_resource: opened here
LVM2.2.03.36/libdm/libdm-common.c:1808:12: branch_false: following ‘false’ branch...
 branch_false: ...to here
LVM2.2.03.36/libdm/libdm-common.c:1816:16: branch_true: following ‘true’ branch...
LVM2.2.03.36/libdm/libdm-common.c:1818:22: call_function: calling ‘_mountinfo_parse_line’ from ‘dm_mountinfo_read’
#  318|   	if (!dm_check_version()) {
#  319|   		dm_free(dmt);
#  320|-> 		return_NULL;
#  321|   	}
#  322|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def605]
LVM2.2.03.36/libdm/libdm-common.c:320:17: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(&_mountinfo, "r")’
LVM2.2.03.36/libdm/libdm-common.c:1800:5: enter_function: entry to ‘dm_mountinfo_read’
LVM2.2.03.36/libdm/libdm-common.c:1808:23: acquire_memory: allocated here
LVM2.2.03.36/libdm/libdm-common.c:1808:12: branch_false: following ‘false’ branch...
 branch_false: ...to here
LVM2.2.03.36/libdm/libdm-common.c:1816:16: branch_true: following ‘true’ branch...
LVM2.2.03.36/libdm/libdm-common.c:1818:22: call_function: calling ‘_mountinfo_parse_line’ from ‘dm_mountinfo_read’
#  318|   	if (!dm_check_version()) {
#  319|   		dm_free(dmt);
#  320|-> 		return_NULL;
#  321|   	}
#  322|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def606]
LVM2.2.03.36/libdm/libdm-common.c:361:26: warning[-Wanalyzer-malloc-leak]: leak of ‘opendir(&_dm_dir)’
LVM2.2.03.36/libdm/libdm-common.c:2181:5: enter_function: entry to ‘dm_mknodes’
LVM2.2.03.36/libdm/libdm-common.c:2186:21: call_function: calling ‘dm_task_create’ from ‘dm_mknodes’
LVM2.2.03.36/libdm/libdm-common.c:2186:21: return_function: returning to ‘dm_mknodes’ from ‘dm_task_create’
LVM2.2.03.36/libdm/libdm-common.c:2186:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/libdm/libdm-common.c:2189:12: branch_false: ...to here
LVM2.2.03.36/libdm/libdm-common.c:2189:12: branch_true: following ‘true’ branch (when ‘name’ is non-NULL)...
LVM2.2.03.36/libdm/libdm-common.c:2189:22: branch_true: ...to here
LVM2.2.03.36/libdm/libdm-common.c:2189: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): [#def607]
LVM2.2.03.36/libdm/libdm-common.c:614:17: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(&_mountinfo, "r")’
LVM2.2.03.36/libdm/libdm-common.c:1800:5: enter_function: entry to ‘dm_mountinfo_read’
LVM2.2.03.36/libdm/libdm-common.c:1808:23: acquire_resource: opened here
LVM2.2.03.36/libdm/libdm-common.c:1808:12: branch_false: following ‘false’ branch...
 branch_false: ...to here
LVM2.2.03.36/libdm/libdm-common.c:1816:16: branch_true: following ‘true’ branch...
LVM2.2.03.36/libdm/libdm-common.c:1818:22: call_function: calling ‘_mountinfo_parse_line’ from ‘dm_mountinfo_read’
#  612|   
#  613|   	if (dmt->type == DM_DEVICE_CREATE) {
#  614|-> 		log_error("Name \"%s\" invalid. It contains \"/\".", path);
#  615|   		return 0;
#  616|   	}

Error: GCC_ANALYZER_WARNING (CWE-401): [#def608]
LVM2.2.03.36/libdm/libdm-common.c:614:17: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(&_mountinfo, "r")’
LVM2.2.03.36/libdm/libdm-common.c:1800:5: enter_function: entry to ‘dm_mountinfo_read’
LVM2.2.03.36/libdm/libdm-common.c:1808:23: acquire_memory: allocated here
LVM2.2.03.36/libdm/libdm-common.c:1808:12: branch_false: following ‘false’ branch...
 branch_false: ...to here
LVM2.2.03.36/libdm/libdm-common.c:1816:16: branch_true: following ‘true’ branch...
LVM2.2.03.36/libdm/libdm-common.c:1818:22: call_function: calling ‘_mountinfo_parse_line’ from ‘dm_mountinfo_read’
#  612|   
#  613|   	if (dmt->type == DM_DEVICE_CREATE) {
#  614|-> 		log_error("Name \"%s\" invalid. It contains \"/\".", path);
#  615|   		return 0;
#  616|   	}

Error: GCC_ANALYZER_WARNING (CWE-775): [#def609]
LVM2.2.03.36/libdm/libdm-common.c:1761:17: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(&_mountinfo, "r")’
LVM2.2.03.36/libdm/libdm-common.c:1800:5: enter_function: entry to ‘dm_mountinfo_read’
LVM2.2.03.36/libdm/libdm-common.c:1808:23: acquire_resource: opened here
LVM2.2.03.36/libdm/libdm-common.c:1808:12: branch_false: following ‘false’ branch...
 branch_false: ...to here
LVM2.2.03.36/libdm/libdm-common.c:1816:16: branch_true: following ‘true’ branch...
LVM2.2.03.36/libdm/libdm-common.c:1818:22: call_function: calling ‘_mountinfo_parse_line’ from ‘dm_mountinfo_read’
# 1759|   		   "s %" DM_TO_STRING(PATH_MAX) "s",
# 1760|   		   maj, min, root, target) < 4) {
# 1761|-> 		log_error("Failed to parse mountinfo line.");
# 1762|   		return 0;
# 1763|   	}

Error: GCC_ANALYZER_WARNING (CWE-401): [#def610]
LVM2.2.03.36/libdm/libdm-common.c:1761:17: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(&_mountinfo, "r")’
LVM2.2.03.36/libdm/libdm-common.c:1800:5: enter_function: entry to ‘dm_mountinfo_read’
LVM2.2.03.36/libdm/libdm-common.c:1808:23: acquire_memory: allocated here
LVM2.2.03.36/libdm/libdm-common.c:1808:12: branch_false: following ‘false’ branch...
 branch_false: ...to here
LVM2.2.03.36/libdm/libdm-common.c:1816:16: branch_true: following ‘true’ branch...
LVM2.2.03.36/libdm/libdm-common.c:1818:22: call_function: calling ‘_mountinfo_parse_line’ from ‘dm_mountinfo_read’
# 1759|   		   "s %" DM_TO_STRING(PATH_MAX) "s",
# 1760|   		   maj, min, root, target) < 4) {
# 1761|-> 		log_error("Failed to parse mountinfo line.");
# 1762|   		return 0;
# 1763|   	}

Error: GCC_ANALYZER_WARNING (CWE-775): [#def611]
LVM2.2.03.36/libdm/libdm-common.c:1769:25: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(&_mountinfo, "r")’
LVM2.2.03.36/libdm/libdm-common.c:1800:5: enter_function: entry to ‘dm_mountinfo_read’
LVM2.2.03.36/libdm/libdm-common.c:1808:23: acquire_resource: opened here
LVM2.2.03.36/libdm/libdm-common.c:1808:12: branch_false: following ‘false’ branch...
 branch_false: ...to here
LVM2.2.03.36/libdm/libdm-common.c:1816:16: branch_true: following ‘true’ branch...
LVM2.2.03.36/libdm/libdm-common.c:1818:22: call_function: calling ‘_mountinfo_parse_line’ from ‘dm_mountinfo_read’
# 1767|   	if (*maj == 0 && (devmapper = strstr(line, "/dev/mapper/"))) {
# 1768|   		if (!(dmt = dm_task_create(DM_DEVICE_INFO))) {
# 1769|-> 			log_error("Mount info task creation failed.");
# 1770|   			return 0;
# 1771|   		}

Error: GCC_ANALYZER_WARNING (CWE-401): [#def612]
LVM2.2.03.36/libdm/libdm-common.c:1769:25: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(&_mountinfo, "r")’
LVM2.2.03.36/libdm/libdm-common.c:1800:5: enter_function: entry to ‘dm_mountinfo_read’
LVM2.2.03.36/libdm/libdm-common.c:1808:23: acquire_memory: allocated here
LVM2.2.03.36/libdm/libdm-common.c:1808:12: branch_false: following ‘false’ branch...
 branch_false: ...to here
LVM2.2.03.36/libdm/libdm-common.c:1816:16: branch_true: following ‘true’ branch...
LVM2.2.03.36/libdm/libdm-common.c:1818:22: call_function: calling ‘_mountinfo_parse_line’ from ‘dm_mountinfo_read’
# 1767|   	if (*maj == 0 && (devmapper = strstr(line, "/dev/mapper/"))) {
# 1768|   		if (!(dmt = dm_task_create(DM_DEVICE_INFO))) {
# 1769|-> 			log_error("Mount info task creation failed.");
# 1770|   			return 0;
# 1771|   		}

Error: GCC_ANALYZER_WARNING (CWE-775): [#def613]
LVM2.2.03.36/libdm/libdm-common.c:1854:17: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(&sysfs_path, "r")’
LVM2.2.03.36/libdm/libdm-common.c:1838:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/libdm/libdm-common.c:1845:20: branch_false: ...to here
LVM2.2.03.36/libdm/libdm-common.c:1845:20: acquire_resource: opened here
LVM2.2.03.36/libdm/libdm-common.c:1845:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/libdm/libdm-common.c:1853:14: branch_false: ...to here
LVM2.2.03.36/libdm/libdm-common.c:1853:12: branch_true: following ‘true’ branch...
LVM2.2.03.36/libdm/libdm-common.c:1854:17: branch_true: ...to here
LVM2.2.03.36/libdm/libdm-common.c:1854:17: danger: ‘fopen(&sysfs_path, "r")’ leaks here; was opened at [(3)](sarif:/runs/0/results/17/codeFlows/0/threadFlows/0/locations/2)
# 1852|   
# 1853|   	if (!fgets(temp_buf, sizeof(temp_buf), fp)) {
# 1854|-> 		log_sys_error("fgets", sysfs_path);
# 1855|   		goto bad;
# 1856|   	}

Error: GCC_ANALYZER_WARNING (CWE-401): [#def614]
LVM2.2.03.36/libdm/libdm-common.c:1854:17: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(&sysfs_path, "r")’
LVM2.2.03.36/libdm/libdm-common.c:1838:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/libdm/libdm-common.c:1845:20: branch_false: ...to here
LVM2.2.03.36/libdm/libdm-common.c:1845:20: acquire_memory: allocated here
LVM2.2.03.36/libdm/libdm-common.c:1845:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/libdm/libdm-common.c:1853:14: branch_false: ...to here
LVM2.2.03.36/libdm/libdm-common.c:1853:12: branch_true: following ‘true’ branch...
LVM2.2.03.36/libdm/libdm-common.c:1854:17: branch_true: ...to here
LVM2.2.03.36/libdm/libdm-common.c:1854:17: danger: ‘fopen(&sysfs_path, "r")’ leaks here; was allocated at [(3)](sarif:/runs/0/results/18/codeFlows/0/threadFlows/0/locations/2)
# 1852|   
# 1853|   	if (!fgets(temp_buf, sizeof(temp_buf), fp)) {
# 1854|-> 		log_sys_error("fgets", sysfs_path);
# 1855|   		goto bad;
# 1856|   	}

Error: GCC_ANALYZER_WARNING (CWE-775): [#def615]
LVM2.2.03.36/libdm/libdm-common.c:1861:17: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(&sysfs_path, "r")’
LVM2.2.03.36/libdm/libdm-common.c:1838:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/libdm/libdm-common.c:1845:20: branch_false: ...to here
LVM2.2.03.36/libdm/libdm-common.c:1845:20: acquire_resource: opened here
LVM2.2.03.36/libdm/libdm-common.c:1845:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/libdm/libdm-common.c:1853:14: branch_false: ...to here
LVM2.2.03.36/libdm/libdm-common.c:1853:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/libdm/libdm-common.c:1858:15: branch_false: ...to here
LVM2.2.03.36/libdm/libdm-common.c:1860:12: branch_true: following ‘true’ branch (when ‘len > buf_size’)...
LVM2.2.03.36/libdm/libdm-common.c:1861:17: branch_true: ...to here
LVM2.2.03.36/libdm/libdm-common.c:1861:17: danger: ‘fopen(&sysfs_path, "r")’ leaks here; was opened at [(3)](sarif:/runs/0/results/19/codeFlows/0/threadFlows/0/locations/2)
# 1859|   
# 1860|   	if (len > buf_size) {
# 1861|-> 		log_error("_sysfs_get_dm_name: supplied buffer too small.");
# 1862|   		goto bad;
# 1863|   	}

Error: GCC_ANALYZER_WARNING (CWE-401): [#def616]
LVM2.2.03.36/libdm/libdm-common.c:1861:17: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(&sysfs_path, "r")’
LVM2.2.03.36/libdm/libdm-common.c:1838:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/libdm/libdm-common.c:1845:20: branch_false: ...to here
LVM2.2.03.36/libdm/libdm-common.c:1845:20: acquire_memory: allocated here
LVM2.2.03.36/libdm/libdm-common.c:1845:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/libdm/libdm-common.c:1853:14: branch_false: ...to here
LVM2.2.03.36/libdm/libdm-common.c:1853:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/libdm/libdm-common.c:1858:15: branch_false: ...to here
LVM2.2.03.36/libdm/libdm-common.c:1860:12: branch_true: following ‘true’ branch (when ‘len > buf_size’)...
LVM2.2.03.36/libdm/libdm-common.c:1861:17: branch_true: ...to here
LVM2.2.03.36/libdm/libdm-common.c:1861:17: danger: ‘fopen(&sysfs_path, "r")’ leaks here; was allocated at [(3)](sarif:/runs/0/results/20/codeFlows/0/threadFlows/0/locations/2)
# 1859|   
# 1860|   	if (len > buf_size) {
# 1861|-> 		log_error("_sysfs_get_dm_name: supplied buffer too small.");
# 1862|   		goto bad;
# 1863|   	}

Error: GCC_ANALYZER_WARNING (CWE-401): [#def617]
LVM2.2.03.36/libdm/libdm-common.c:1919:32: warning[-Wanalyzer-malloc-leak]: leak of ‘opendir(&path)’
LVM2.2.03.36/libdm/libdm-common.c:1908:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/libdm/libdm-common.c:1909:13: branch_false: ...to here
LVM2.2.03.36/libdm/libdm-common.c:1908:13: branch_false: following ‘false’ branch...
LVM2.2.03.36/libdm/libdm-common.c:1914:19: branch_false: ...to here
LVM2.2.03.36/libdm/libdm-common.c:1914:19: acquire_memory: allocated here
LVM2.2.03.36/libdm/libdm-common.c:1914:12: branch_false: following ‘false’ branch...
 branch_false: ...to here
LVM2.2.03.36/libdm/libdm-common.c:1919:16: branch_true: following ‘true’ branch (when ‘r == 0’)...
LVM2.2.03.36/libdm/libdm-common.c:1919:32: branch_true: ...to here
LVM2.2.03.36/libdm/libdm-common.c:1919:32: danger: ‘opendir(&path)’ leaks here; was allocated at [(5)](sarif:/runs/0/results/21/codeFlows/0/threadFlows/0/locations/4)
# 1917|   	}
# 1918|   
# 1919|-> 	while (!r && (dirent = readdir(d))) {
# 1920|   		name = dirent->d_name;
# 1921|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def618]
LVM2.2.03.36/libdm/libdm-common.c:1948:46: warning[-Wanalyzer-malloc-leak]: leak of ‘opendir(&path)’
LVM2.2.03.36/libdm/libdm-common.c:1908:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/libdm/libdm-common.c:1909:13: branch_false: ...to here
LVM2.2.03.36/libdm/libdm-common.c:1908:13: branch_false: following ‘false’ branch...
LVM2.2.03.36/libdm/libdm-common.c:1914:19: branch_false: ...to here
LVM2.2.03.36/libdm/libdm-common.c:1914:12: branch_false: following ‘false’ branch...
 branch_false: ...to here
LVM2.2.03.36/libdm/libdm-common.c:1919:16: branch_true: following ‘true’ branch...
LVM2.2.03.36/libdm/libdm-common.c:1931:20: branch_false: following ‘false’ branch...
LVM2.2.03.36/libdm/libdm-common.c:1936:22: branch_false: ...to here
LVM2.2.03.36/libdm/libdm-common.c:1943:39: acquire_memory: allocated here
LVM2.2.03.36/libdm/libdm-common.c:1948:46: danger: ‘opendir(&path)’ leaks here; was allocated at [(11)](sarif:/runs/0/results/22/codeFlows/0/threadFlows/0/locations/10)
# 1946|   			}
# 1947|   
# 1948|-> 			while ((dirent_dev = readdir(d_dev))) {
# 1949|   				name_dev = dirent_dev->d_name;
# 1950|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def619]
LVM2.2.03.36/libdm/libdm-common.c:2103:26: warning[-Wanalyzer-malloc-leak]: leak of ‘opendir(&sysfs_path)’
LVM2.2.03.36/libdm/libdm-common.c:2092:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/libdm/libdm-common.c:2097:19: branch_false: ...to here
LVM2.2.03.36/libdm/libdm-common.c:2097:19: acquire_memory: allocated here
LVM2.2.03.36/libdm/libdm-common.c:2097:12: branch_false: following ‘false’ branch...
 branch_false: ...to here
LVM2.2.03.36/libdm/libdm-common.c:2103:26: danger: ‘opendir(&sysfs_path)’ leaks here; was allocated at [(3)](sarif:/runs/0/results/23/codeFlows/0/threadFlows/0/locations/2)
# 2101|   	}
# 2102|   
# 2103|-> 	while ((dirent = readdir(d))) {
# 2104|   		if (!strcmp(dirent->d_name, ".") || !strcmp(dirent->d_name, ".."))
# 2105|   			continue;

Error: GCC_ANALYZER_WARNING (CWE-775): [#def620]
LVM2.2.03.36/libdm/libdm-common.c:2481:17: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘open("/dev/urandom", 0)’
LVM2.2.03.36/libdm/libdm-common.c:2493:12: enter_function: entry to ‘_udev_notify_sem_create’
LVM2.2.03.36/libdm/libdm-common.c:2502:19: acquire_resource: opened here
LVM2.2.03.36/libdm/libdm-common.c:2502:12: branch_false: following ‘false’ branch...
 branch_false: ...to here
LVM2.2.03.36/libdm/libdm-common.c:2512:20: branch_false: following ‘false’ branch...
LVM2.2.03.36/libdm/libdm-common.c:2517:30: branch_false: ...to here
LVM2.2.03.36/libdm/libdm-common.c:2550:12: branch_true: following ‘true’ branch...
LVM2.2.03.36/libdm/libdm-common.c:2551:17: branch_true: ...to here
LVM2.2.03.36/libdm/libdm-common.c:2554:24: call_function: calling ‘_udev_notify_sem_destroy’ from ‘_udev_notify_sem_create’
# 2479|   {
# 2480|   	if (semctl(semid, 0, IPC_RMID, 0) < 0) {
# 2481|-> 		log_error("Could not cleanup notification semaphore "
# 2482|   			  "identified by cookie value %" PRIu32 " (0x%x): %s",
# 2483|   			  cookie, cookie, strerror(errno));

Error: GCC_ANALYZER_WARNING (CWE-775): [#def621]
LVM2.2.03.36/libdm/libdm-common.c:2487:9: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘open("/dev/urandom", 0)’
LVM2.2.03.36/libdm/libdm-common.c:2493:12: enter_function: entry to ‘_udev_notify_sem_create’
LVM2.2.03.36/libdm/libdm-common.c:2502:19: acquire_resource: opened here
LVM2.2.03.36/libdm/libdm-common.c:2502:12: branch_false: following ‘false’ branch...
 branch_false: ...to here
LVM2.2.03.36/libdm/libdm-common.c:2512:20: branch_false: following ‘false’ branch...
LVM2.2.03.36/libdm/libdm-common.c:2517:30: branch_false: ...to here
LVM2.2.03.36/libdm/libdm-common.c:2550:12: branch_true: following ‘true’ branch...
LVM2.2.03.36/libdm/libdm-common.c:2551:17: branch_true: ...to here
LVM2.2.03.36/libdm/libdm-common.c:2554:24: call_function: calling ‘_udev_notify_sem_destroy’ from ‘_udev_notify_sem_create’
# 2485|   	}
# 2486|   
# 2487|-> 	log_debug_activation("Udev cookie 0x%" PRIx32 " (semid %d) destroyed", cookie,
# 2488|   			     semid);
# 2489|   

Error: GCC_ANALYZER_WARNING (CWE-775): [#def622]
LVM2.2.03.36/libdm/libdm-common.c:2513:25: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘open("/dev/urandom", 0)’
LVM2.2.03.36/libdm/libdm-common.c:2502:19: acquire_resource: opened here
LVM2.2.03.36/libdm/libdm-common.c:2502:12: branch_false: following ‘false’ branch...
 branch_false: ...to here
LVM2.2.03.36/libdm/libdm-common.c:2513:25: danger: ‘open("/dev/urandom", 0)’ leaks here; was opened at [(1)](sarif:/runs/0/results/26/codeFlows/0/threadFlows/0/locations/0)
# 2511|   		/* FIXME Handle non-error returns from read(). Move _io() into libdm? */
# 2512|   		if (read(fd, &base_cookie, sizeof(base_cookie)) != sizeof(base_cookie)) {
# 2513|-> 			log_error("Failed to initialize notification cookie");
# 2514|   			goto bad;
# 2515|   		}

Error: GCC_ANALYZER_WARNING (CWE-775): [#def623]
LVM2.2.03.36/libdm/libdm-common.c:2528:41: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘open("/dev/urandom", 0)’
LVM2.2.03.36/libdm/libdm-common.c:2502:19: acquire_resource: opened here
LVM2.2.03.36/libdm/libdm-common.c:2502:12: branch_false: following ‘false’ branch...
 branch_false: ...to here
LVM2.2.03.36/libdm/libdm-common.c:2512:20: branch_false: following ‘false’ branch...
LVM2.2.03.36/libdm/libdm-common.c:2517:30: branch_false: ...to here
LVM2.2.03.36/libdm/libdm-common.c:2528:41: danger: ‘open("/dev/urandom", 0)’ leaks here; was opened at [(1)](sarif:/runs/0/results/27/codeFlows/0/threadFlows/0/locations/0)
# 2526|   					break;
# 2527|   				case ENOMEM:
# 2528|-> 					log_error("Not enough memory to create "
# 2529|   						  "notification semaphore");
# 2530|   					goto bad;

Error: GCC_ANALYZER_WARNING (CWE-775): [#def624]
LVM2.2.03.36/libdm/libdm-common.c:2532:41: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘open("/dev/urandom", 0)’
LVM2.2.03.36/libdm/libdm-common.c:2502:19: acquire_resource: opened here
LVM2.2.03.36/libdm/libdm-common.c:2502:12: branch_false: following ‘false’ branch...
 branch_false: ...to here
LVM2.2.03.36/libdm/libdm-common.c:2512:20: branch_false: following ‘false’ branch...
LVM2.2.03.36/libdm/libdm-common.c:2517:30: branch_false: ...to here
LVM2.2.03.36/libdm/libdm-common.c:2532:41: danger: ‘open("/dev/urandom", 0)’ leaks here; was opened at [(1)](sarif:/runs/0/results/28/codeFlows/0/threadFlows/0/locations/0)
# 2530|   					goto bad;
# 2531|   				case ENOSPC:
# 2532|-> 					log_error("Limit for the maximum number "
# 2533|   						  "of semaphores reached. You can "
# 2534|   						  "check and set the limits in "

Error: GCC_ANALYZER_WARNING (CWE-775): [#def625]
LVM2.2.03.36/libdm/libdm-common.c:2538:41: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘open("/dev/urandom", 0)’
LVM2.2.03.36/libdm/libdm-common.c:2502:19: acquire_resource: opened here
LVM2.2.03.36/libdm/libdm-common.c:2502:12: branch_false: following ‘false’ branch...
 branch_false: ...to here
LVM2.2.03.36/libdm/libdm-common.c:2512:20: branch_false: following ‘false’ branch...
LVM2.2.03.36/libdm/libdm-common.c:2517:30: branch_false: ...to here
LVM2.2.03.36/libdm/libdm-common.c:2538:41: danger: ‘open("/dev/urandom", 0)’ leaks here; was opened at [(1)](sarif:/runs/0/results/29/codeFlows/0/threadFlows/0/locations/0)
# 2536|   					goto bad;
# 2537|   				default:
# 2538|-> 					log_error("Failed to create notification "
# 2539|   						  "semaphore: %s", strerror(errno));
# 2540|   					goto bad;

Error: GCC_ANALYZER_WARNING (CWE-775): [#def626]
LVM2.2.03.36/libdm/libdm-common.c:2545:9: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘open("/dev/urandom", 0)’
LVM2.2.03.36/libdm/libdm-common.c:2502:19: acquire_resource: opened here
LVM2.2.03.36/libdm/libdm-common.c:2502:12: branch_false: following ‘false’ branch...
 branch_false: ...to here
LVM2.2.03.36/libdm/libdm-common.c:2512:20: branch_false: following ‘false’ branch...
LVM2.2.03.36/libdm/libdm-common.c:2517:30: branch_false: ...to here
LVM2.2.03.36/libdm/libdm-common.c:2545:9: danger: ‘open("/dev/urandom", 0)’ leaks here; was opened at [(1)](sarif:/runs/0/results/30/codeFlows/0/threadFlows/0/locations/0)
# 2543|   	} while (!base_cookie);
# 2544|   
# 2545|-> 	log_debug_activation("Udev cookie 0x%" PRIx32 " (semid %d) created",
# 2546|   			     gen_cookie, gen_semid);
# 2547|   

Error: GCC_ANALYZER_WARNING (CWE-775): [#def627]
LVM2.2.03.36/libdm/libdm-common.c:2551:17: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘open("/dev/urandom", 0)’
LVM2.2.03.36/libdm/libdm-common.c:2502:19: acquire_resource: opened here
LVM2.2.03.36/libdm/libdm-common.c:2502:12: branch_false: following ‘false’ branch...
 branch_false: ...to here
LVM2.2.03.36/libdm/libdm-common.c:2512:20: branch_false: following ‘false’ branch...
LVM2.2.03.36/libdm/libdm-common.c:2517:30: branch_false: ...to here
LVM2.2.03.36/libdm/libdm-common.c:2550:12: branch_true: following ‘true’ branch...
LVM2.2.03.36/libdm/libdm-common.c:2551:17: branch_true: ...to here
LVM2.2.03.36/libdm/libdm-common.c:2551:17: danger: ‘open("/dev/urandom", 0)’ leaks here; was opened at [(1)](sarif:/runs/0/results/31/codeFlows/0/threadFlows/0/locations/0)
# 2549|   
# 2550|   	if (semctl(gen_semid, 0, SETVAL, sem_arg) < 0) {
# 2551|-> 		log_error("cookie create: semid %d: semctl failed: %s", gen_semid, strerror(errno));
# 2552|   		/* We have to destroy just created semaphore
# 2553|   		 * so it won't stay in the system. */

Error: GCC_ANALYZER_WARNING (CWE-775): [#def628]
LVM2.2.03.36/libdm/libdm-common.c:2559:17: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘open("/dev/urandom", 0)’
LVM2.2.03.36/libdm/libdm-common.c:2502:19: acquire_resource: opened here
LVM2.2.03.36/libdm/libdm-common.c:2502:12: branch_false: following ‘false’ branch...
 branch_false: ...to here
LVM2.2.03.36/libdm/libdm-common.c:2512:20: branch_false: following ‘false’ branch...
LVM2.2.03.36/libdm/libdm-common.c:2517:30: branch_false: ...to here
LVM2.2.03.36/libdm/libdm-common.c:2550:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/libdm/libdm-common.c:2558:20: branch_false: ...to here
LVM2.2.03.36/libdm/libdm-common.c:2558:12: branch_true: following ‘true’ branch (when ‘val < 0’)...
LVM2.2.03.36/libdm/libdm-common.c:2559:17: branch_true: ...to here
LVM2.2.03.36/libdm/libdm-common.c:2559:17: danger: ‘open("/dev/urandom", 0)’ leaks here; was opened at [(1)](sarif:/runs/0/results/32/codeFlows/0/threadFlows/0/locations/0)
# 2557|   
# 2558|    	if ((val = semctl(gen_semid, 0, GETVAL)) < 0) {
# 2559|-> 		log_error("cookie create: semid %d: sem_ctl GETVAL failed for "
# 2560|   			  "cookie 0x%" PRIx32 ": %s",
# 2561|   			  gen_semid, gen_cookie, strerror(errno));

Error: GCC_ANALYZER_WARNING (CWE-775): [#def629]
LVM2.2.03.36/libdm/libdm-common.c:2566:9: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘open("/dev/urandom", 0)’
LVM2.2.03.36/libdm/libdm-common.c:2502:19: acquire_resource: opened here
LVM2.2.03.36/libdm/libdm-common.c:2502:12: branch_false: following ‘false’ branch...
 branch_false: ...to here
LVM2.2.03.36/libdm/libdm-common.c:2512:20: branch_false: following ‘false’ branch...
LVM2.2.03.36/libdm/libdm-common.c:2517:30: branch_false: ...to here
LVM2.2.03.36/libdm/libdm-common.c:2550:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/libdm/libdm-common.c:2558:20: branch_false: ...to here
LVM2.2.03.36/libdm/libdm-common.c:2558:12: branch_false: following ‘false’ branch (when ‘val >= 0’)...
LVM2.2.03.36/libdm/libdm-common.c:2566:9: branch_false: ...to here
LVM2.2.03.36/libdm/libdm-common.c:2566:9: danger: ‘open("/dev/urandom", 0)’ leaks here; was opened at [(1)](sarif:/runs/0/results/33/codeFlows/0/threadFlows/0/locations/0)
# 2564|   	}
# 2565|   
# 2566|-> 	log_debug_activation("Udev cookie 0x%" PRIx32 " (semid %d) incremented to %d",
# 2567|   			     gen_cookie, gen_semid, val);
# 2568|   

Error: GCC_ANALYZER_WARNING (CWE-775): [#def630]
LVM2.2.03.36/libdm/libdm-common.c:2569:12: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘open("/dev/urandom", 0)’
LVM2.2.03.36/libdm/libdm-common.c:2502:19: acquire_resource: opened here
LVM2.2.03.36/libdm/libdm-common.c:2502:12: branch_false: following ‘false’ branch...
 branch_false: ...to here
LVM2.2.03.36/libdm/libdm-common.c:2512:20: branch_false: following ‘false’ branch...
LVM2.2.03.36/libdm/libdm-common.c:2517:30: branch_false: ...to here
LVM2.2.03.36/libdm/libdm-common.c:2550:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/libdm/libdm-common.c:2558:20: branch_false: ...to here
LVM2.2.03.36/libdm/libdm-common.c:2558:12: branch_false: following ‘false’ branch (when ‘val >= 0’)...
LVM2.2.03.36/libdm/libdm-common.c:2566:9: branch_false: ...to here
LVM2.2.03.36/libdm/libdm-common.c:2569:12: danger: ‘open("/dev/urandom", 0)’ leaks here; was opened at [(1)](sarif:/runs/0/results/34/codeFlows/0/threadFlows/0/locations/0)
# 2567|   			     gen_cookie, gen_semid, val);
# 2568|   
# 2569|-> 	if (close(fd))
# 2570|   		stack;
# 2571|   

Error: GCC_ANALYZER_WARNING (CWE-775): [#def631]
LVM2.2.03.36/libdm/libdm-common.c:2578:12: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘open("/dev/urandom", 0)’
LVM2.2.03.36/libdm/libdm-common.c:2502:19: acquire_resource: opened here
LVM2.2.03.36/libdm/libdm-common.c:2502:12: branch_false: following ‘false’ branch...
 branch_false: ...to here
LVM2.2.03.36/libdm/libdm-common.c:2578:12: danger: ‘open("/dev/urandom", 0)’ leaks here; was opened at [(1)](sarif:/runs/0/results/35/codeFlows/0/threadFlows/0/locations/0)
# 2576|   
# 2577|   bad:
# 2578|-> 	if (close(fd))
# 2579|   		stack;
# 2580|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def632]
LVM2.2.03.36/libdm/libdm-file.c:116:26: warning[-Wanalyzer-malloc-leak]: leak of ‘opendir(dir)’
LVM2.2.03.36/libdm/libdm-file.c:111:19: acquire_memory: allocated here
LVM2.2.03.36/libdm/libdm-file.c:111:12: branch_false: following ‘false’ branch...
 branch_false: ...to here
LVM2.2.03.36/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): [#def633]
LVM2.2.03.36/libdm/libdm-file.c:249:12: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘open(lockfile, 0)’
LVM2.2.03.36/libdm/libdm-file.c:242:17: acquire_resource: opened here
LVM2.2.03.36/libdm/libdm-file.c:242:10: branch_false: following ‘false’ branch...
LVM2.2.03.36/libdm/libdm-file.c:245:8: branch_false: ...to here
LVM2.2.03.36/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: GCC_ANALYZER_WARNING (CWE-404): [#def634]
LVM2.2.03.36/libdm/libdm-string.c:149:21: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
LVM2.2.03.36/libdm/libdm-string.c:184:5: enter_function: entry to ‘dm_asprintf’
LVM2.2.03.36/libdm/libdm-string.c:188:9: acquire_resource: ‘va_start’ called here
LVM2.2.03.36/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): [#def635]
LVM2.2.03.36/test/unit/bcache_t.c:85:9: warning[-Wanalyzer-malloc-leak]: leak of ‘f’
LVM2.2.03.36/test/unit/bcache_t.c:334:24: enter_function: entry to ‘_fixture_init’
LVM2.2.03.36/test/unit/bcache_t.c:336:29: acquire_memory: allocated here
LVM2.2.03.36/test/unit/bcache_t.c:338:9: branch_false: following ‘false’ branch (when ‘f’ is non-NULL)...
LVM2.2.03.36/test/unit/bcache_t.c:340:17: branch_false: ...to here
LVM2.2.03.36/test/unit/bcache_t.c:340:17: call_function: calling ‘_mock_create’ from ‘_fixture_init’
LVM2.2.03.36/test/unit/bcache_t.c:340:17: return_function: returning to ‘_fixture_init’ from ‘_mock_create’
LVM2.2.03.36/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): [#def636]
LVM2.2.03.36/test/unit/bcache_t.c:88:9: warning[-Wanalyzer-malloc-leak]: leak of ‘f’
LVM2.2.03.36/test/unit/bcache_t.c:334:24: enter_function: entry to ‘_fixture_init’
LVM2.2.03.36/test/unit/bcache_t.c:336:29: acquire_memory: allocated here
LVM2.2.03.36/test/unit/bcache_t.c:338:9: branch_false: following ‘false’ branch (when ‘f’ is non-NULL)...
LVM2.2.03.36/test/unit/bcache_t.c:340:17: branch_false: ...to here
LVM2.2.03.36/test/unit/bcache_t.c:340:17: call_function: calling ‘_mock_create’ from ‘_fixture_init’
LVM2.2.03.36/test/unit/bcache_t.c:340:17: return_function: returning to ‘_fixture_init’ from ‘_mock_create’
LVM2.2.03.36/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): [#def637]
LVM2.2.03.36/test/unit/bcache_t.c:88:9: warning[-Wanalyzer-malloc-leak]: leak of ‘mc’
LVM2.2.03.36/test/unit/bcache_t.c:83:32: acquire_memory: allocated here
LVM2.2.03.36/test/unit/bcache_t.c:85:9: branch_false: following ‘false’ branch (when ‘mc’ is non-NULL)...
LVM2.2.03.36/test/unit/bcache_t.c:86:9: branch_false: ...to here
LVM2.2.03.36/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): [#def638]
LVM2.2.03.36/test/unit/bcache_t.c:103:9: warning[-Wanalyzer-malloc-leak]: leak of ‘mc’
LVM2.2.03.36/test/unit/bcache_t.c:93:32: acquire_memory: allocated here
LVM2.2.03.36/test/unit/bcache_t.c:95:9: branch_false: following ‘false’ branch (when ‘mc’ is non-NULL)...
LVM2.2.03.36/test/unit/bcache_t.c:96:9: branch_false: ...to here
LVM2.2.03.36/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): [#def639]
LVM2.2.03.36/test/unit/bcache_t.c:115:9: warning[-Wanalyzer-malloc-leak]: leak of ‘mc’
LVM2.2.03.36/test/unit/bcache_t.c:108:32: acquire_memory: allocated here
LVM2.2.03.36/test/unit/bcache_t.c:110:9: branch_false: following ‘false’ branch (when ‘mc’ is non-NULL)...
LVM2.2.03.36/test/unit/bcache_t.c:111:9: branch_false: ...to here
LVM2.2.03.36/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): [#def640]
LVM2.2.03.36/test/unit/bcache_t.c:130:9: warning[-Wanalyzer-malloc-leak]: leak of ‘mc’
LVM2.2.03.36/test/unit/bcache_t.c:120:32: acquire_memory: allocated here
LVM2.2.03.36/test/unit/bcache_t.c:122:9: branch_false: following ‘false’ branch (when ‘mc’ is non-NULL)...
LVM2.2.03.36/test/unit/bcache_t.c:123:9: branch_false: ...to here
LVM2.2.03.36/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): [#def641]
LVM2.2.03.36/test/unit/bcache_t.c:145:9: warning[-Wanalyzer-malloc-leak]: leak of ‘mc’
LVM2.2.03.36/test/unit/bcache_t.c:135:32: acquire_memory: allocated here
LVM2.2.03.36/test/unit/bcache_t.c:137:9: branch_false: following ‘false’ branch (when ‘mc’ is non-NULL)...
LVM2.2.03.36/test/unit/bcache_t.c:138:9: branch_false: ...to here
LVM2.2.03.36/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): [#def642]
LVM2.2.03.36/test/unit/bcache_t.c:160:9: warning[-Wanalyzer-malloc-leak]: leak of ‘mc’
LVM2.2.03.36/test/unit/bcache_t.c:150:32: acquire_memory: allocated here
LVM2.2.03.36/test/unit/bcache_t.c:152:9: branch_false: following ‘false’ branch (when ‘mc’ is non-NULL)...
LVM2.2.03.36/test/unit/bcache_t.c:153:9: branch_false: ...to here
LVM2.2.03.36/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): [#def643]
LVM2.2.03.36/test/unit/bcache_t.c:175:9: warning[-Wanalyzer-malloc-leak]: leak of ‘mc’
LVM2.2.03.36/test/unit/bcache_t.c:165:32: acquire_memory: allocated here
LVM2.2.03.36/test/unit/bcache_t.c:167:9: branch_false: following ‘false’ branch (when ‘mc’ is non-NULL)...
LVM2.2.03.36/test/unit/bcache_t.c:168:9: branch_false: ...to here
LVM2.2.03.36/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): [#def644]
LVM2.2.03.36/test/unit/bcache_t.c:190:9: warning[-Wanalyzer-malloc-leak]: leak of ‘mc’
LVM2.2.03.36/test/unit/bcache_t.c:180:32: acquire_memory: allocated here
LVM2.2.03.36/test/unit/bcache_t.c:182:9: branch_false: following ‘false’ branch (when ‘mc’ is non-NULL)...
LVM2.2.03.36/test/unit/bcache_t.c:183:9: branch_false: ...to here
LVM2.2.03.36/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): [#def645]
LVM2.2.03.36/test/unit/bcache_t.c:277:17: warning[-Wanalyzer-malloc-leak]: leak of ‘io’
LVM2.2.03.36/test/unit/bcache_t.c:246:13: enter_function: entry to ‘_mock_issue’
LVM2.2.03.36/test/unit/bcache_t.c:254:14: call_function: calling ‘_match_pop’ from ‘_mock_issue’
LVM2.2.03.36/test/unit/bcache_t.c:254:14: return_function: returning to ‘_mock_issue’ from ‘_match_pop’
LVM2.2.03.36/test/unit/bcache_t.c:265:12: branch_true: following ‘true’ branch (when ‘r != 0’)...
LVM2.2.03.36/test/unit/bcache_t.c:266:22: branch_true: ...to here
LVM2.2.03.36/test/unit/bcache_t.c:266:22: acquire_memory: allocated here
LVM2.2.03.36/test/unit/bcache_t.c:267:20: branch_false: following ‘false’ branch (when ‘io’ is non-NULL)...
LVM2.2.03.36/test/unit/bcache_t.c:270:17: branch_false: ...to here
LVM2.2.03.36/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): [#def646]
LVM2.2.03.36/test/unit/bcache_t.c:311:9: warning[-Wanalyzer-malloc-leak]: leak of ‘f’
LVM2.2.03.36/test/unit/bcache_t.c:334:24: enter_function: entry to ‘_fixture_init’
LVM2.2.03.36/test/unit/bcache_t.c:336:29: acquire_memory: allocated here
LVM2.2.03.36/test/unit/bcache_t.c:338:9: branch_false: following ‘false’ branch (when ‘f’ is non-NULL)...
LVM2.2.03.36/test/unit/bcache_t.c:340:17: branch_false: ...to here
LVM2.2.03.36/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): [#def647]
LVM2.2.03.36/test/unit/bcache_t.c:320:9: warning[-Wanalyzer-malloc-leak]: leak of ‘f’
LVM2.2.03.36/test/unit/bcache_t.c:334:24: enter_function: entry to ‘_fixture_init’
LVM2.2.03.36/test/unit/bcache_t.c:336:29: acquire_memory: allocated here
LVM2.2.03.36/test/unit/bcache_t.c:338:9: branch_false: following ‘false’ branch (when ‘f’ is non-NULL)...
LVM2.2.03.36/test/unit/bcache_t.c:340:17: branch_false: ...to here
LVM2.2.03.36/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): [#def648]
LVM2.2.03.36/test/unit/bcache_t.c:320:9: warning[-Wanalyzer-malloc-leak]: leak of ‘m’
LVM2.2.03.36/test/unit/bcache_t.c:309:33: acquire_memory: allocated here
LVM2.2.03.36/test/unit/bcache_t.c:311:9: branch_false: following ‘false’ branch (when ‘m’ is non-NULL)...
LVM2.2.03.36/test/unit/bcache_t.c:313:9: branch_false: ...to here
LVM2.2.03.36/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): [#def649]
LVM2.2.03.36/test/unit/bcache_t.c:321:9: warning[-Wanalyzer-malloc-leak]: leak of ‘f’
LVM2.2.03.36/test/unit/bcache_t.c:334:24: enter_function: entry to ‘_fixture_init’
LVM2.2.03.36/test/unit/bcache_t.c:336:29: acquire_memory: allocated here
LVM2.2.03.36/test/unit/bcache_t.c:338:9: branch_false: following ‘false’ branch (when ‘f’ is non-NULL)...
LVM2.2.03.36/test/unit/bcache_t.c:340:17: branch_false: ...to here
LVM2.2.03.36/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): [#def650]
LVM2.2.03.36/test/unit/bcache_t.c:344:20: warning[-Wanalyzer-malloc-leak]: leak of ‘f’
LVM2.2.03.36/test/unit/bcache_t.c:334:24: enter_function: entry to ‘_fixture_init’
LVM2.2.03.36/test/unit/bcache_t.c:336:29: acquire_memory: allocated here
LVM2.2.03.36/test/unit/bcache_t.c:338:9: branch_false: following ‘false’ branch (when ‘f’ is non-NULL)...
LVM2.2.03.36/test/unit/bcache_t.c:340:17: branch_false: ...to here
LVM2.2.03.36/test/unit/bcache_t.c:340:17: call_function: calling ‘_mock_create’ from ‘_fixture_init’
LVM2.2.03.36/test/unit/bcache_t.c:340:17: return_function: returning to ‘_fixture_init’ from ‘_mock_create’
LVM2.2.03.36/test/unit/bcache_t.c:343:9: call_function: calling ‘_expect’ from ‘_fixture_init’
LVM2.2.03.36/test/unit/bcache_t.c:343:9: return_function: returning to ‘_fixture_init’ from ‘_expect’
LVM2.2.03.36/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): [#def651]
LVM2.2.03.36/test/unit/bcache_t.c:345:9: warning[-Wanalyzer-malloc-leak]: leak of ‘f’
LVM2.2.03.36/test/unit/bcache_t.c:334:24: enter_function: entry to ‘_fixture_init’
LVM2.2.03.36/test/unit/bcache_t.c:336:29: acquire_memory: allocated here
LVM2.2.03.36/test/unit/bcache_t.c:338:9: branch_false: following ‘false’ branch (when ‘f’ is non-NULL)...
LVM2.2.03.36/test/unit/bcache_t.c:340:17: branch_false: ...to here
LVM2.2.03.36/test/unit/bcache_t.c:340:17: call_function: calling ‘_mock_create’ from ‘_fixture_init’
LVM2.2.03.36/test/unit/bcache_t.c:340:17: return_function: returning to ‘_fixture_init’ from ‘_mock_create’
LVM2.2.03.36/test/unit/bcache_t.c:343:9: call_function: calling ‘_expect’ from ‘_fixture_init’
LVM2.2.03.36/test/unit/bcache_t.c:343:9: return_function: returning to ‘_fixture_init’ from ‘_expect’
LVM2.2.03.36/test/unit/bcache_t.c:345:9: branch_true: following ‘true’ branch...
LVM2.2.03.36/test/unit/bcache_t.c:345:9: branch_true: ...to here
LVM2.2.03.36/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): [#def652]
LVM2.2.03.36/test/unit/bcache_utils_t.c:163:17: warning[-Wanalyzer-malloc-leak]: leak of ‘buffer’
LVM2.2.03.36/test/unit/bcache_utils_t.c:353:13: enter_function: entry to ‘_set_cycle’
LVM2.2.03.36/test/unit/bcache_utils_t.c:357:9: call_function: calling ‘_verify’ from ‘_set_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): [#def653]
LVM2.2.03.36/test/unit/framework.c:29:17: warning[-Wanalyzer-malloc-leak]: leak of ‘ts’
LVM2.2.03.36/test/unit/framework.c:25:33: acquire_memory: allocated here
LVM2.2.03.36/test/unit/framework.c:26:12: branch_true: following ‘true’ branch (when ‘ts’ is non-NULL)...
LVM2.2.03.36/test/unit/framework.c:27:17: branch_true: ...to here
LVM2.2.03.36/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): [#def654]
LVM2.2.03.36/test/unit/framework.c:61:9: warning[-Wanalyzer-malloc-leak]: leak of ‘t’
LVM2.2.03.36/test/unit/framework.c:51:34: acquire_memory: allocated here
LVM2.2.03.36/test/unit/framework.c:52:12: branch_false: following ‘false’ branch (when ‘t’ is non-NULL)...
LVM2.2.03.36/test/unit/framework.c:57:9: branch_false: ...to here
LVM2.2.03.36/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: GCC_ANALYZER_WARNING (CWE-401): [#def655]
LVM2.2.03.36/test/unit/io_engine_t.c:86:16: warning[-Wanalyzer-malloc-leak]: leak of ‘f’
LVM2.2.03.36/test/unit/io_engine_t.c:83:29: acquire_memory: allocated here
LVM2.2.03.36/test/unit/io_engine_t.c:85:9: branch_false: following ‘false’ branch (when ‘f’ is non-NULL)...
LVM2.2.03.36/test/unit/io_engine_t.c:86:16: branch_false: ...to here
LVM2.2.03.36/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): [#def656]
LVM2.2.03.36/test/unit/io_engine_t.c:87:9: warning[-Wanalyzer-malloc-leak]: leak of ‘f’
LVM2.2.03.36/test/unit/io_engine_t.c:83:29: acquire_memory: allocated here
LVM2.2.03.36/test/unit/io_engine_t.c:85:9: branch_false: following ‘false’ branch (when ‘f’ is non-NULL)...
LVM2.2.03.36/test/unit/io_engine_t.c:86:16: branch_false: ...to here
LVM2.2.03.36/test/unit/io_engine_t.c:87:9: branch_true: following ‘true’ branch...
LVM2.2.03.36/test/unit/io_engine_t.c:87:9: branch_true: ...to here
LVM2.2.03.36/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-401): [#def657]
LVM2.2.03.36/tools/command.c:1303:9: warning[-Wanalyzer-malloc-leak]: leak of ‘cmdname’
LVM2.2.03.36/tools/man-generator.c:1655:5: enter_function: entry to ‘main’
LVM2.2.03.36/tools/man-generator.c:1674:12: branch_true: following ‘true’ branch (when ‘stdout_buf’ is NULL)...
LVM2.2.03.36/tools/man-generator.c:1675:17: branch_true: ...to here
LVM2.2.03.36/tools/man-generator.c:1702:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/tools/man-generator.c:1707:13: branch_false: ...to here
LVM2.2.03.36/tools/man-generator.c:1707:12: branch_true: following ‘true’ branch...
LVM2.2.03.36/tools/man-generator.c:1708:45: branch_true: ...to here
LVM2.2.03.36/tools/man-generator.c:1708:33: acquire_memory: allocated here
LVM2.2.03.36/tools/man-generator.c:1708:20: branch_false: following ‘false’ branch (when ‘cmdname’ is non-NULL)...
LVM2.2.03.36/tools/man-generator.c:1717:13: branch_false: ...to here
LVM2.2.03.36/tools/man-generator.c:1717:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/tools/man-generator.c:1720:14: branch_false: ...to here
LVM2.2.03.36/tools/man-generator.c:1720:14: call_function: calling ‘define_commands’ from ‘main’
# 1301|   		opt_names_alpha[i] = &opt_names[i];
# 1302|   
# 1303|-> 	qsort(opt_names_alpha, ARG_COUNT, sizeof(long), _long_name_compare);
# 1304|   }
# 1305|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def658]
LVM2.2.03.36/tools/command.c:1303:9: warning[-Wanalyzer-malloc-leak]: leak of ‘stdout_buf’
LVM2.2.03.36/tools/man-generator.c:1655:5: enter_function: entry to ‘main’
LVM2.2.03.36/tools/man-generator.c:1674:28: acquire_memory: allocated here
LVM2.2.03.36/tools/man-generator.c:1674:12: branch_false: following ‘false’ branch (when ‘stdout_buf’ is non-NULL)...
LVM2.2.03.36/tools/man-generator.c:1677:17: branch_false: ...to here
LVM2.2.03.36/tools/man-generator.c:1702:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/tools/man-generator.c:1707:13: branch_false: ...to here
LVM2.2.03.36/tools/man-generator.c:1707:12: branch_true: following ‘true’ branch...
LVM2.2.03.36/tools/man-generator.c:1708:45: branch_true: ...to here
LVM2.2.03.36/tools/man-generator.c:1708:20: branch_false: following ‘false’ branch (when ‘cmdname’ is non-NULL)...
LVM2.2.03.36/tools/man-generator.c:1717:13: branch_false: ...to here
LVM2.2.03.36/tools/man-generator.c:1717:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/tools/man-generator.c:1720:14: branch_false: ...to here
LVM2.2.03.36/tools/man-generator.c:1720:14: call_function: calling ‘define_commands’ from ‘main’
# 1301|   		opt_names_alpha[i] = &opt_names[i];
# 1302|   
# 1303|-> 	qsort(opt_names_alpha, ARG_COUNT, sizeof(long), _long_name_compare);
# 1304|   }
# 1305|   

Error: GCC_ANALYZER_WARNING (CWE-775): [#def659]
LVM2.2.03.36/tools/lvconvert.c:6260:25: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(&proc_meminfo, "r")’
LVM2.2.03.36/tools/lvconvert.c:6244:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/tools/lvconvert.c:6248:39: branch_false: ...to here
LVM2.2.03.36/tools/lvconvert.c:6247:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/tools/lvconvert.c:6253:20: branch_false: ...to here
LVM2.2.03.36/tools/lvconvert.c:6253:20: acquire_resource: opened here
LVM2.2.03.36/tools/lvconvert.c:6253:12: branch_false: following ‘false’ branch...
 branch_false: ...to here
LVM2.2.03.36/tools/lvconvert.c:6256:16: branch_true: following ‘true’ branch...
LVM2.2.03.36/tools/lvconvert.c:6257:21: branch_true: ...to here
LVM2.2.03.36/tools/lvconvert.c:6259:20: branch_true: following ‘true’ branch...
LVM2.2.03.36/tools/lvconvert.c:6260:25: branch_true: ...to here
LVM2.2.03.36/tools/lvconvert.c:6260:25: danger: ‘fopen(&proc_meminfo, "r")’ leaks here; was opened at [(5)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/4)
# 6258|   			continue;
# 6259|   		if (sscanf(line, "%*s%llu%*s", &proc_mem_kb) != 1) {
# 6260|-> 			stack;
# 6261|   			break;
# 6262|   		}

Error: GCC_ANALYZER_WARNING (CWE-401): [#def660]
LVM2.2.03.36/tools/lvconvert.c:6260:25: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(&proc_meminfo, "r")’
LVM2.2.03.36/tools/lvconvert.c:6244:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/tools/lvconvert.c:6248:39: branch_false: ...to here
LVM2.2.03.36/tools/lvconvert.c:6247:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/tools/lvconvert.c:6253:20: branch_false: ...to here
LVM2.2.03.36/tools/lvconvert.c:6253:20: acquire_memory: allocated here
LVM2.2.03.36/tools/lvconvert.c:6253:12: branch_false: following ‘false’ branch...
 branch_false: ...to here
LVM2.2.03.36/tools/lvconvert.c:6256:16: branch_true: following ‘true’ branch...
LVM2.2.03.36/tools/lvconvert.c:6257:21: branch_true: ...to here
LVM2.2.03.36/tools/lvconvert.c:6259:20: branch_true: following ‘true’ branch...
LVM2.2.03.36/tools/lvconvert.c:6260:25: branch_true: ...to here
LVM2.2.03.36/tools/lvconvert.c:6260:25: danger: ‘fopen(&proc_meminfo, "r")’ leaks here; was allocated at [(5)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/4)
# 6258|   			continue;
# 6259|   		if (sscanf(line, "%*s%llu%*s", &proc_mem_kb) != 1) {
# 6260|-> 			stack;
# 6261|   			break;
# 6262|   		}

Error: GCC_ANALYZER_WARNING (CWE-401): [#def661]
LVM2.2.03.36/tools/lvmcmdlib.c:70:13: warning[-Wanalyzer-malloc-leak]: leak of ‘cmdcopy’
LVM2.2.03.36/tools/lvmcmdlib.c:64:25: acquire_memory: allocated here
LVM2.2.03.36/tools/lvmcmdlib.c:64:12: branch_false: following ‘false’ branch (when ‘cmdcopy’ is non-NULL)...
LVM2.2.03.36/tools/lvmcmdlib.c:70:13: branch_false: ...to here
LVM2.2.03.36/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): [#def662]
LVM2.2.03.36/tools/lvmcmdline.c:3548:25: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(script_file, "r")’
LVM2.2.03.36/tools/lvmcmdline.c:3533:23: acquire_resource: opened here
LVM2.2.03.36/tools/lvmcmdline.c:3533:12: branch_false: following ‘false’ branch...
 branch_false: ...to here
LVM2.2.03.36/tools/lvmcmdline.c:3536:16: branch_true: following ‘true’ branch...
LVM2.2.03.36/tools/lvmcmdline.c:3537:20: branch_true: ...to here
LVM2.2.03.36/tools/lvmcmdline.c:3537:20: branch_true: following ‘true’ branch (when ‘magic_number == 0’)...
LVM2.2.03.36/tools/lvmcmdline.c:3538:29: branch_true: ...to here
LVM2.2.03.36/tools/lvmcmdline.c:3538:28: branch_true: following ‘true’ branch...
LVM2.2.03.36/tools/lvmcmdline.c:3545:20: branch_true: following ‘true’ branch...
LVM2.2.03.36/tools/lvmcmdline.c:3546:25: branch_true: ...to here
LVM2.2.03.36/tools/lvmcmdline.c:3545:21: branch_true: following ‘true’ branch...
LVM2.2.03.36/tools/lvmcmdline.c:3547:25: branch_true: ...to here
LVM2.2.03.36/tools/lvmcmdline.c:3548:25: danger: ‘fopen(script_file, "r")’ leaks here; was opened at [(1)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/0)
# 3546|   		    && (buffer[sizeof(buffer) - 1] - 2 != '\n')) {
# 3547|   			buffer[50] = '\0';
# 3548|-> 			log_error("Line too long (max 255) beginning: %s",
# 3549|   				  buffer);
# 3550|   			ret = EINVALID_CMD_LINE;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def663]
LVM2.2.03.36/tools/lvmcmdline.c:3548:25: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(script_file, "r")’
LVM2.2.03.36/tools/lvmcmdline.c:3533:23: acquire_memory: allocated here
LVM2.2.03.36/tools/lvmcmdline.c:3533:12: branch_false: following ‘false’ branch...
 branch_false: ...to here
LVM2.2.03.36/tools/lvmcmdline.c:3536:16: branch_true: following ‘true’ branch...
LVM2.2.03.36/tools/lvmcmdline.c:3537:20: branch_true: ...to here
LVM2.2.03.36/tools/lvmcmdline.c:3537:20: branch_true: following ‘true’ branch (when ‘magic_number == 0’)...
LVM2.2.03.36/tools/lvmcmdline.c:3538:29: branch_true: ...to here
LVM2.2.03.36/tools/lvmcmdline.c:3538:28: branch_true: following ‘true’ branch...
LVM2.2.03.36/tools/lvmcmdline.c:3545:20: branch_true: following ‘true’ branch...
LVM2.2.03.36/tools/lvmcmdline.c:3546:25: branch_true: ...to here
LVM2.2.03.36/tools/lvmcmdline.c:3545:21: branch_true: following ‘true’ branch...
LVM2.2.03.36/tools/lvmcmdline.c:3547:25: branch_true: ...to here
LVM2.2.03.36/tools/lvmcmdline.c:3548:25: danger: ‘fopen(script_file, "r")’ leaks here; was allocated at [(1)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/0)
# 3546|   		    && (buffer[sizeof(buffer) - 1] - 2 != '\n')) {
# 3547|   			buffer[50] = '\0';
# 3548|-> 			log_error("Line too long (max 255) beginning: %s",
# 3549|   				  buffer);
# 3550|   			ret = EINVALID_CMD_LINE;

Error: GCC_ANALYZER_WARNING (CWE-126): [#def664]
LVM2.2.03.36/tools/man-generator.c:287:21: warning[-Wanalyzer-out-of-bounds]: heap-based buffer over-read
LVM2.2.03.36/tools/man-generator.c:1389:13: enter_function: entry to ‘_print_man_secondary’
LVM2.2.03.36/tools/man-generator.c:1399:21: branch_true: following ‘true’ branch (when ‘i != 202’)...
LVM2.2.03.36/tools/man-generator.c:1401:17: branch_true: ...to here
LVM2.2.03.36/tools/man-generator.c:1403:20: branch_false: following ‘false’ branch...
LVM2.2.03.36/tools/man-generator.c:1406:20: branch_false: ...to here
LVM2.2.03.36/tools/man-generator.c:1406:20: branch_false: following ‘false’ branch...
LVM2.2.03.36/tools/man-generator.c:1409:21: branch_false: ...to here
LVM2.2.03.36/tools/man-generator.c:1409:20: branch_false: following ‘false’ branch (when the strings are equal)...
LVM2.2.03.36/tools/man-generator.c:1412:20: branch_false: ...to here
LVM2.2.03.36/tools/man-generator.c:1412:20: branch_true: following ‘true’ branch (when ‘header == 0’)...
LVM2.2.03.36/tools/man-generator.c:1413:25: branch_true: ...to here
LVM2.2.03.36/tools/man-generator.c:1426:17: call_function: calling ‘_print_man_usage’ from ‘_print_man_secondary’
#  285|   		}
#  286|   
#  287|-> 		if (strstr(line_argv[i], "Number"))
#  288|   			printf("\\fI%s\\fP", line_argv[i]);
#  289|   		else

Error: GCC_ANALYZER_WARNING (CWE-401): [#def665]
LVM2.2.03.36/tools/man-generator.c:1736:24: warning[-Wanalyzer-malloc-leak]: leak of ‘cmdname’
LVM2.2.03.36/tools/man-generator.c:1655:5: enter_function: entry to ‘main’
LVM2.2.03.36/tools/man-generator.c:1674:12: branch_false: following ‘false’ branch (when ‘stdout_buf’ is non-NULL)...
LVM2.2.03.36/tools/man-generator.c:1677:17: branch_false: ...to here
LVM2.2.03.36/tools/man-generator.c:1702:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/tools/man-generator.c:1707:13: branch_false: ...to here
LVM2.2.03.36/tools/man-generator.c:1707:12: branch_true: following ‘true’ branch...
LVM2.2.03.36/tools/man-generator.c:1708:45: branch_true: ...to here
LVM2.2.03.36/tools/man-generator.c:1708:33: acquire_memory: allocated here
LVM2.2.03.36/tools/man-generator.c:1708:20: branch_false: following ‘false’ branch (when ‘cmdname’ is non-NULL)...
LVM2.2.03.36/tools/man-generator.c:1717:13: branch_false: ...to here
LVM2.2.03.36/tools/man-generator.c:1717:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/tools/man-generator.c:1720:14: branch_false: ...to here
LVM2.2.03.36/tools/man-generator.c:1720:14: call_function: calling ‘define_commands’ from ‘main’
LVM2.2.03.36/tools/man-generator.c:1720:14: return_function: returning to ‘main’ from ‘define_commands’
LVM2.2.03.36/tools/man-generator.c:1720:12: branch_true: following ‘true’ branch...
LVM2.2.03.36/tools/man-generator.c:1721:17: branch_true: ...to here
LVM2.2.03.36/tools/man-generator.c:1735:12: branch_true: following ‘true’ branch (when ‘stdout_buf’ is non-NULL)...
LVM2.2.03.36/tools/man-generator.c:1736:17: branch_true: ...to here
LVM2.2.03.36/tools/man-generator.c:1736:24: danger: ‘cmdname’ leaks here; was allocated at [(8)](sarif:/runs/0/results/4/codeFlows/0/threadFlows/0/locations/7)
# 1734|   out_free:
# 1735|   	if (stdout_buf) {
# 1736|-> 		(void) fflush(stdout);
# 1737|   		setlinebuf(stdout);
# 1738|   		free(stdout_buf);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def666]
LVM2.2.03.36/tools/man-generator.c:1736:24: warning[-Wanalyzer-malloc-leak]: leak of ‘stdout_buf’
LVM2.2.03.36/tools/man-generator.c:1674:28: acquire_memory: allocated here
LVM2.2.03.36/tools/man-generator.c:1674:12: branch_false: following ‘false’ branch (when ‘stdout_buf’ is non-NULL)...
LVM2.2.03.36/tools/man-generator.c:1677:17: branch_false: ...to here
LVM2.2.03.36/tools/man-generator.c:1735:12: branch_true: following ‘true’ branch (when ‘stdout_buf’ is non-NULL)...
LVM2.2.03.36/tools/man-generator.c:1736:17: branch_true: ...to here
LVM2.2.03.36/tools/man-generator.c:1736:24: danger: ‘stdout_buf’ leaks here; was allocated at [(1)](sarif:/runs/0/results/3/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: GCC_ANALYZER_WARNING (CWE-401): [#def667]
LVM2.2.03.36/tools/pvck.c:116:17: warning[-Wanalyzer-malloc-leak]: leak of ‘calloc(1, (long unsigned int)max)’
LVM2.2.03.36/tools/pvck.c:99:14: enter_function: entry to ‘_chars_to_hexstr’
LVM2.2.03.36/tools/pvck.c:107:21: call_function: inlined call to ‘zalloc’ from ‘_chars_to_hexstr’
LVM2.2.03.36/tools/pvck.c:107:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/tools/pvck.c:112:9: branch_false: ...to here
LVM2.2.03.36/tools/pvck.c:115:12: branch_true: following ‘true’ branch (when ‘max <= num’)...
LVM2.2.03.36/tools/pvck.c:116:17: branch_true: ...to here
LVM2.2.03.36/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): [#def668]
LVM2.2.03.36/tools/pvck.c:380:24: warning[-Wanalyzer-malloc-leak]: leak of ‘calloc(1, mda_size + 1)’
LVM2.2.03.36/tools/pvck.c:842:12: enter_function: entry to ‘_dump_meta_area’
LVM2.2.03.36/tools/pvck.c:849:12: branch_false: following ‘false’ branch (when ‘tofile’ is non-NULL)...
LVM2.2.03.36/tools/pvck.c:852:33: branch_false: ...to here
LVM2.2.03.36/tools/pvck.c:852:26: call_function: inlined call to ‘zalloc’ from ‘_dump_meta_area’
LVM2.2.03.36/tools/pvck.c:852:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/tools/pvck.c:855:14: branch_false: ...to here
LVM2.2.03.36/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): [#def669]
LVM2.2.03.36/tools/pvck.c:380:24: warning[-Wanalyzer-malloc-leak]: leak of ‘calloc(1, meta_size + 1)’
LVM2.2.03.36/tools/pvck.c:885:12: enter_function: entry to ‘_dump_current_text’
LVM2.2.03.36/tools/pvck.c:901:26: call_function: inlined call to ‘zalloc’ from ‘_dump_current_text’
LVM2.2.03.36/tools/pvck.c:901:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/tools/pvck.c:915:13: branch_false: ...to here
LVM2.2.03.36/tools/pvck.c:915:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/tools/pvck.c:939:22: branch_false: ...to here
LVM2.2.03.36/tools/pvck.c:939:22: call_function: calling ‘_read_bytes’ from ‘_dump_current_text’
#  378|   
#  379|   	if (dev)
#  380|-> 		return dev_read_bytes(dev, start, len, data);
#  381|   
#  382|   	if (!def)

Error: GCC_ANALYZER_WARNING (CWE-775): [#def670]
LVM2.2.03.36/tools/pvck.c:642:21: warning[-Wanalyzer-file-leak]: leak of FILE ‘fp’
LVM2.2.03.36/tools/pvck.c:424:12: branch_true: following ‘true’ branch (when ‘tofile’ is non-NULL)...
LVM2.2.03.36/tools/pvck.c:425:28: branch_true: ...to here
LVM2.2.03.36/tools/pvck.c:425:28: acquire_resource: opened here
LVM2.2.03.36/tools/pvck.c:425:20: branch_false: following ‘false’ branch...
LVM2.2.03.36/tools/pvck.c:449:9: branch_false: ...to here
LVM2.2.03.36/tools/pvck.c:461:16: branch_false: following ‘false’ branch...
LVM2.2.03.36/tools/pvck.c:638:12: branch_false: ...to here
LVM2.2.03.36/tools/pvck.c:638:12: branch_false: following ‘false’ branch (when ‘multiple_vgs == 0’)...
LVM2.2.03.36/tools/pvck.c:641:12: branch_false: ...to here
LVM2.2.03.36/tools/pvck.c:641:12: branch_true: following ‘true’ branch (when ‘fp’ is non-NULL)...
LVM2.2.03.36/tools/pvck.c:642:21: branch_true: ...to here
LVM2.2.03.36/tools/pvck.c:642:21: danger: ‘fp’ leaks here; was opened at [(3)](sarif:/runs/0/results/3/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): [#def671]
LVM2.2.03.36/tools/pvck.c:642:21: warning[-Wanalyzer-malloc-leak]: leak of ‘fp’
LVM2.2.03.36/tools/pvck.c:424:12: branch_true: following ‘true’ branch (when ‘tofile’ is non-NULL)...
LVM2.2.03.36/tools/pvck.c:425:28: branch_true: ...to here
LVM2.2.03.36/tools/pvck.c:425:28: acquire_memory: allocated here
LVM2.2.03.36/tools/pvck.c:425:20: branch_false: following ‘false’ branch...
LVM2.2.03.36/tools/pvck.c:449:9: branch_false: ...to here
LVM2.2.03.36/tools/pvck.c:461:16: branch_false: following ‘false’ branch...
LVM2.2.03.36/tools/pvck.c:638:12: branch_false: ...to here
LVM2.2.03.36/tools/pvck.c:638:12: branch_false: following ‘false’ branch (when ‘multiple_vgs == 0’)...
LVM2.2.03.36/tools/pvck.c:641:12: branch_false: ...to here
LVM2.2.03.36/tools/pvck.c:641:12: branch_true: following ‘true’ branch (when ‘fp’ is non-NULL)...
LVM2.2.03.36/tools/pvck.c:642:21: branch_true: ...to here
LVM2.2.03.36/tools/pvck.c:642:21: danger: ‘fp’ leaks here; was allocated at [(3)](sarif:/runs/0/results/4/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): [#def672]
LVM2.2.03.36/tools/pvck.c:643:25: warning[-Wanalyzer-file-leak]: leak of FILE ‘fp’
LVM2.2.03.36/tools/pvck.c:424:12: branch_true: following ‘true’ branch (when ‘tofile’ is non-NULL)...
LVM2.2.03.36/tools/pvck.c:425:28: branch_true: ...to here
LVM2.2.03.36/tools/pvck.c:425:28: acquire_resource: opened here
LVM2.2.03.36/tools/pvck.c:425:20: branch_false: following ‘false’ branch...
LVM2.2.03.36/tools/pvck.c:449:9: branch_false: ...to here
LVM2.2.03.36/tools/pvck.c:461:16: branch_false: following ‘false’ branch...
LVM2.2.03.36/tools/pvck.c:638:12: branch_false: ...to here
LVM2.2.03.36/tools/pvck.c:638:12: branch_false: following ‘false’ branch (when ‘multiple_vgs == 0’)...
LVM2.2.03.36/tools/pvck.c:641:12: branch_false: ...to here
LVM2.2.03.36/tools/pvck.c:641:12: branch_true: following ‘true’ branch (when ‘fp’ is non-NULL)...
LVM2.2.03.36/tools/pvck.c:642:21: branch_true: ...to here
LVM2.2.03.36/tools/pvck.c:642:20: branch_true: following ‘true’ branch...
LVM2.2.03.36/tools/pvck.c:643:25: branch_true: ...to here
LVM2.2.03.36/tools/pvck.c:643:25: danger: ‘fp’ leaks here; was opened at [(3)](sarif:/runs/0/results/5/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): [#def673]
LVM2.2.03.36/tools/pvck.c:643:25: warning[-Wanalyzer-malloc-leak]: leak of ‘fp’
LVM2.2.03.36/tools/pvck.c:424:12: branch_true: following ‘true’ branch (when ‘tofile’ is non-NULL)...
LVM2.2.03.36/tools/pvck.c:425:28: branch_true: ...to here
LVM2.2.03.36/tools/pvck.c:425:28: acquire_memory: allocated here
LVM2.2.03.36/tools/pvck.c:425:20: branch_false: following ‘false’ branch...
LVM2.2.03.36/tools/pvck.c:449:9: branch_false: ...to here
LVM2.2.03.36/tools/pvck.c:461:16: branch_false: following ‘false’ branch...
LVM2.2.03.36/tools/pvck.c:638:12: branch_false: ...to here
LVM2.2.03.36/tools/pvck.c:638:12: branch_false: following ‘false’ branch (when ‘multiple_vgs == 0’)...
LVM2.2.03.36/tools/pvck.c:641:12: branch_false: ...to here
LVM2.2.03.36/tools/pvck.c:641:12: branch_true: following ‘true’ branch (when ‘fp’ is non-NULL)...
LVM2.2.03.36/tools/pvck.c:642:21: branch_true: ...to here
LVM2.2.03.36/tools/pvck.c:642:20: branch_true: following ‘true’ branch...
LVM2.2.03.36/tools/pvck.c:643:25: branch_true: ...to here
LVM2.2.03.36/tools/pvck.c:643:25: danger: ‘fp’ leaks here; was allocated at [(3)](sarif:/runs/0/results/6/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): [#def674]
LVM2.2.03.36/tools/pvck.c:856:17: warning[-Wanalyzer-malloc-leak]: leak of ‘calloc(1, mda_size + 1)’
LVM2.2.03.36/tools/pvck.c:842:12: enter_function: entry to ‘_dump_meta_area’
LVM2.2.03.36/tools/pvck.c:849:12: branch_false: following ‘false’ branch (when ‘tofile’ is non-NULL)...
LVM2.2.03.36/tools/pvck.c:852:33: branch_false: ...to here
LVM2.2.03.36/tools/pvck.c:852:26: call_function: inlined call to ‘zalloc’ from ‘_dump_meta_area’
LVM2.2.03.36/tools/pvck.c:852:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/tools/pvck.c:855:14: branch_false: ...to here
LVM2.2.03.36/tools/pvck.c:855:14: call_function: calling ‘_read_bytes’ from ‘_dump_meta_area’
LVM2.2.03.36/tools/pvck.c:855:14: return_function: returning to ‘_dump_meta_area’ from ‘_read_bytes’
LVM2.2.03.36/tools/pvck.c:855:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/tools/pvck.c:856:17: branch_false: ...to here
LVM2.2.03.36/tools/pvck.c:856:17: danger: ‘calloc(1, mda_size + 1)’ leaks here; was allocated at [(5)](sarif:/runs/0/results/7/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-401): [#def675]
LVM2.2.03.36/tools/pvck.c:863:17: warning[-Wanalyzer-malloc-leak]: leak of ‘calloc(1, mda_size + 1)’
LVM2.2.03.36/tools/pvck.c:842:12: enter_function: entry to ‘_dump_meta_area’
LVM2.2.03.36/tools/pvck.c:849:12: branch_false: following ‘false’ branch (when ‘tofile’ is non-NULL)...
LVM2.2.03.36/tools/pvck.c:852:33: branch_false: ...to here
LVM2.2.03.36/tools/pvck.c:852:26: call_function: inlined call to ‘zalloc’ from ‘_dump_meta_area’
LVM2.2.03.36/tools/pvck.c:852:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/tools/pvck.c:855:14: branch_false: ...to here
LVM2.2.03.36/tools/pvck.c:855:14: call_function: calling ‘_read_bytes’ from ‘_dump_meta_area’
LVM2.2.03.36/tools/pvck.c:855:14: return_function: returning to ‘_dump_meta_area’ from ‘_read_bytes’
LVM2.2.03.36/tools/pvck.c:855:12: branch_true: following ‘true’ branch...
LVM2.2.03.36/tools/pvck.c:862:20: branch_true: ...to here
LVM2.2.03.36/tools/pvck.c:862:12: branch_true: following ‘true’ branch...
LVM2.2.03.36/tools/pvck.c:863:17: branch_true: ...to here
LVM2.2.03.36/tools/pvck.c:863:17: danger: ‘calloc(1, mda_size + 1)’ leaks here; was allocated at [(5)](sarif:/runs/0/results/8/codeFlows/0/threadFlows/0/locations/4)
#  861|   
#  862|   	if (!(fp = fopen(tofile, "wx"))) {
#  863|-> 		log_error("Failed to create file %s", tofile);
#  864|   		free(meta_buf);
#  865|   		return 0;

Error: GCC_ANALYZER_WARNING (CWE-775): [#def676]
LVM2.2.03.36/tools/pvck.c:869:17: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(tofile, "wx")’
LVM2.2.03.36/tools/pvck.c:842:12: enter_function: entry to ‘_dump_meta_area’
LVM2.2.03.36/tools/pvck.c:849:12: branch_false: following ‘false’ branch (when ‘tofile’ is non-NULL)...
LVM2.2.03.36/tools/pvck.c:852:33: branch_false: ...to here
LVM2.2.03.36/tools/pvck.c:852:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/tools/pvck.c:855:14: branch_false: ...to here
LVM2.2.03.36/tools/pvck.c:855:14: call_function: calling ‘_read_bytes’ from ‘_dump_meta_area’
LVM2.2.03.36/tools/pvck.c:855:14: return_function: returning to ‘_dump_meta_area’ from ‘_read_bytes’
LVM2.2.03.36/tools/pvck.c:855:12: branch_true: following ‘true’ branch...
LVM2.2.03.36/tools/pvck.c:862:20: branch_true: ...to here
LVM2.2.03.36/tools/pvck.c:862:20: acquire_resource: opened here
LVM2.2.03.36/tools/pvck.c:862:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/tools/pvck.c:868:30: branch_false: ...to here
LVM2.2.03.36/tools/pvck.c:868:12: branch_true: following ‘true’ branch...
LVM2.2.03.36/tools/pvck.c:869:17: branch_true: ...to here
LVM2.2.03.36/tools/pvck.c:869:17: danger: ‘fopen(tofile, "wx")’ leaks here; was opened at [(13)](sarif:/runs/0/results/10/codeFlows/0/threadFlows/0/locations/12)
#  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);
#  871|   		ret = 0;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def677]
LVM2.2.03.36/tools/pvck.c:869:17: warning[-Wanalyzer-malloc-leak]: leak of ‘calloc(1, mda_size + 1)’
LVM2.2.03.36/tools/pvck.c:842:12: enter_function: entry to ‘_dump_meta_area’
LVM2.2.03.36/tools/pvck.c:849:12: branch_false: following ‘false’ branch (when ‘tofile’ is non-NULL)...
LVM2.2.03.36/tools/pvck.c:852:33: branch_false: ...to here
LVM2.2.03.36/tools/pvck.c:852:26: call_function: inlined call to ‘zalloc’ from ‘_dump_meta_area’
LVM2.2.03.36/tools/pvck.c:852:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/tools/pvck.c:855:14: branch_false: ...to here
LVM2.2.03.36/tools/pvck.c:855:14: call_function: calling ‘_read_bytes’ from ‘_dump_meta_area’
LVM2.2.03.36/tools/pvck.c:855:14: return_function: returning to ‘_dump_meta_area’ from ‘_read_bytes’
LVM2.2.03.36/tools/pvck.c:855:12: branch_true: following ‘true’ branch...
LVM2.2.03.36/tools/pvck.c:862:20: branch_true: ...to here
LVM2.2.03.36/tools/pvck.c:862:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/tools/pvck.c:868:30: branch_false: ...to here
LVM2.2.03.36/tools/pvck.c:868:12: branch_true: following ‘true’ branch...
LVM2.2.03.36/tools/pvck.c:869:17: branch_true: ...to here
LVM2.2.03.36/tools/pvck.c:869:17: danger: ‘calloc(1, mda_size + 1)’ leaks here; was allocated at [(5)](sarif:/runs/0/results/9/codeFlows/0/threadFlows/0/locations/4)
#  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);
#  871|   		ret = 0;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def678]
LVM2.2.03.36/tools/pvck.c:869:17: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(tofile, "wx")’
LVM2.2.03.36/tools/pvck.c:842:12: enter_function: entry to ‘_dump_meta_area’
LVM2.2.03.36/tools/pvck.c:849:12: branch_false: following ‘false’ branch (when ‘tofile’ is non-NULL)...
LVM2.2.03.36/tools/pvck.c:852:33: branch_false: ...to here
LVM2.2.03.36/tools/pvck.c:852:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/tools/pvck.c:855:14: branch_false: ...to here
LVM2.2.03.36/tools/pvck.c:855:14: call_function: calling ‘_read_bytes’ from ‘_dump_meta_area’
LVM2.2.03.36/tools/pvck.c:855:14: return_function: returning to ‘_dump_meta_area’ from ‘_read_bytes’
LVM2.2.03.36/tools/pvck.c:855:12: branch_true: following ‘true’ branch...
LVM2.2.03.36/tools/pvck.c:862:20: branch_true: ...to here
LVM2.2.03.36/tools/pvck.c:862:20: acquire_memory: allocated here
LVM2.2.03.36/tools/pvck.c:862:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/tools/pvck.c:868:30: branch_false: ...to here
LVM2.2.03.36/tools/pvck.c:868:12: branch_true: following ‘true’ branch...
LVM2.2.03.36/tools/pvck.c:869:17: branch_true: ...to here
LVM2.2.03.36/tools/pvck.c:869:17: danger: ‘fopen(tofile, "wx")’ leaks here; was allocated at [(13)](sarif:/runs/0/results/11/codeFlows/0/threadFlows/0/locations/12)
#  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);
#  871|   		ret = 0;

Error: GCC_ANALYZER_WARNING (CWE-775): [#def679]
LVM2.2.03.36/tools/pvck.c:876:13: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(tofile, "wx")’
LVM2.2.03.36/tools/pvck.c:849:12: branch_false: following ‘false’ branch (when ‘tofile’ is non-NULL)...
LVM2.2.03.36/tools/pvck.c:852:33: branch_false: ...to here
LVM2.2.03.36/tools/pvck.c:852:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/tools/pvck.c:855:14: branch_false: ...to here
LVM2.2.03.36/tools/pvck.c:855:12: branch_true: following ‘true’ branch...
LVM2.2.03.36/tools/pvck.c:862:20: branch_true: ...to here
LVM2.2.03.36/tools/pvck.c:862:20: acquire_resource: opened here
LVM2.2.03.36/tools/pvck.c:862:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/tools/pvck.c:868:30: branch_false: ...to here
LVM2.2.03.36/tools/pvck.c:876:13: danger: ‘fopen(tofile, "wx")’ leaks here; was opened at [(7)](sarif:/runs/0/results/12/codeFlows/0/threadFlows/0/locations/6)
#  874|   	free(meta_buf);
#  875|   
#  876|-> 	if (fflush(fp))
#  877|   		stack;
#  878|   	if (fclose(fp))

Error: GCC_ANALYZER_WARNING (CWE-401): [#def680]
LVM2.2.03.36/tools/pvck.c:876:13: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(tofile, "wx")’
LVM2.2.03.36/tools/pvck.c:849:12: branch_false: following ‘false’ branch (when ‘tofile’ is non-NULL)...
LVM2.2.03.36/tools/pvck.c:852:33: branch_false: ...to here
LVM2.2.03.36/tools/pvck.c:852:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/tools/pvck.c:855:14: branch_false: ...to here
LVM2.2.03.36/tools/pvck.c:855:12: branch_true: following ‘true’ branch...
LVM2.2.03.36/tools/pvck.c:862:20: branch_true: ...to here
LVM2.2.03.36/tools/pvck.c:862:20: acquire_memory: allocated here
LVM2.2.03.36/tools/pvck.c:862:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/tools/pvck.c:868:30: branch_false: ...to here
LVM2.2.03.36/tools/pvck.c:876:13: danger: ‘fopen(tofile, "wx")’ leaks here; was allocated at [(7)](sarif:/runs/0/results/13/codeFlows/0/threadFlows/0/locations/6)
#  874|   	free(meta_buf);
#  875|   
#  876|-> 	if (fflush(fp))
#  877|   		stack;
#  878|   	if (fclose(fp))

Error: GCC_ANALYZER_WARNING (CWE-775): [#def681]
LVM2.2.03.36/tools/pvck.c:877:17: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(tofile, "wx")’
LVM2.2.03.36/tools/pvck.c:849:12: branch_false: following ‘false’ branch (when ‘tofile’ is non-NULL)...
LVM2.2.03.36/tools/pvck.c:852:33: branch_false: ...to here
LVM2.2.03.36/tools/pvck.c:852:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/tools/pvck.c:855:14: branch_false: ...to here
LVM2.2.03.36/tools/pvck.c:855:12: branch_true: following ‘true’ branch...
LVM2.2.03.36/tools/pvck.c:862:20: branch_true: ...to here
LVM2.2.03.36/tools/pvck.c:862:20: acquire_resource: opened here
LVM2.2.03.36/tools/pvck.c:862:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/tools/pvck.c:868:30: branch_false: ...to here
LVM2.2.03.36/tools/pvck.c:876:12: branch_true: following ‘true’ branch...
LVM2.2.03.36/tools/pvck.c:877:17: branch_true: ...to here
LVM2.2.03.36/tools/pvck.c:877:17: danger: ‘fopen(tofile, "wx")’ leaks here; was opened at [(7)](sarif:/runs/0/results/14/codeFlows/0/threadFlows/0/locations/6)
#  875|   
#  876|   	if (fflush(fp))
#  877|-> 		stack;
#  878|   	if (fclose(fp))
#  879|   		stack;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def682]
LVM2.2.03.36/tools/pvck.c:877:17: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(tofile, "wx")’
LVM2.2.03.36/tools/pvck.c:849:12: branch_false: following ‘false’ branch (when ‘tofile’ is non-NULL)...
LVM2.2.03.36/tools/pvck.c:852:33: branch_false: ...to here
LVM2.2.03.36/tools/pvck.c:852:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/tools/pvck.c:855:14: branch_false: ...to here
LVM2.2.03.36/tools/pvck.c:855:12: branch_true: following ‘true’ branch...
LVM2.2.03.36/tools/pvck.c:862:20: branch_true: ...to here
LVM2.2.03.36/tools/pvck.c:862:20: acquire_memory: allocated here
LVM2.2.03.36/tools/pvck.c:862:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/tools/pvck.c:868:30: branch_false: ...to here
LVM2.2.03.36/tools/pvck.c:876:12: branch_true: following ‘true’ branch...
LVM2.2.03.36/tools/pvck.c:877:17: branch_true: ...to here
LVM2.2.03.36/tools/pvck.c:877:17: danger: ‘fopen(tofile, "wx")’ leaks here; was allocated at [(7)](sarif:/runs/0/results/15/codeFlows/0/threadFlows/0/locations/6)
#  875|   
#  876|   	if (fflush(fp))
#  877|-> 		stack;
#  878|   	if (fclose(fp))
#  879|   		stack;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def683]
LVM2.2.03.36/tools/pvck.c:924:25: warning[-Wanalyzer-malloc-leak]: leak of ‘calloc(1, meta_size + 1)’
LVM2.2.03.36/tools/pvck.c:885:12: enter_function: entry to ‘_dump_current_text’
LVM2.2.03.36/tools/pvck.c:901:26: call_function: inlined call to ‘zalloc’ from ‘_dump_current_text’
LVM2.2.03.36/tools/pvck.c:901:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/tools/pvck.c:915:13: branch_false: ...to here
LVM2.2.03.36/tools/pvck.c:915:12: branch_true: following ‘true’ branch...
LVM2.2.03.36/tools/pvck.c:917:45: branch_true: ...to here
LVM2.2.03.36/tools/pvck.c:923:22: call_function: calling ‘_read_bytes’ from ‘_dump_current_text’
LVM2.2.03.36/tools/pvck.c:923:22: return_function: returning to ‘_dump_current_text’ from ‘_read_bytes’
LVM2.2.03.36/tools/pvck.c:923:20: branch_false: following ‘false’ branch...
LVM2.2.03.36/tools/pvck.c:924:25: branch_false: ...to here
LVM2.2.03.36/tools/pvck.c:924:25: danger: ‘calloc(1, meta_size + 1)’ leaks here; was allocated at [(3)](sarif:/runs/0/results/16/codeFlows/0/threadFlows/0/locations/2)
#  922|   
#  923|   		if (!_read_bytes(dev, def, offset_a, size_a, meta_buf)) {
#  924|-> 			log_print("CHECK: failed to read metadata text at mda_header_%d.raw_locn[%d].offset %llu size %llu part_a %llu %llu", mn, ri,
#  925|   				  (unsigned long long)meta_offset, (unsigned long long)meta_size,
#  926|   				  (unsigned long long)offset_a, (unsigned long long)size_a);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def684]
LVM2.2.03.36/tools/pvck.c:932:25: warning[-Wanalyzer-malloc-leak]: leak of ‘calloc(1, meta_size + 1)’
LVM2.2.03.36/tools/pvck.c:885:12: enter_function: entry to ‘_dump_current_text’
LVM2.2.03.36/tools/pvck.c:901:26: call_function: inlined call to ‘zalloc’ from ‘_dump_current_text’
LVM2.2.03.36/tools/pvck.c:901:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/tools/pvck.c:915:13: branch_false: ...to here
LVM2.2.03.36/tools/pvck.c:915:12: branch_true: following ‘true’ branch...
LVM2.2.03.36/tools/pvck.c:917:45: branch_true: ...to here
LVM2.2.03.36/tools/pvck.c:923:22: call_function: calling ‘_read_bytes’ from ‘_dump_current_text’
LVM2.2.03.36/tools/pvck.c:923:22: return_function: returning to ‘_dump_current_text’ from ‘_read_bytes’
LVM2.2.03.36/tools/pvck.c:923:20: branch_true: following ‘true’ branch...
LVM2.2.03.36/tools/pvck.c:931:62: branch_true: ...to here
LVM2.2.03.36/tools/pvck.c:931:22: call_function: calling ‘_read_bytes’ from ‘_dump_current_text’
LVM2.2.03.36/tools/pvck.c:931:22: return_function: returning to ‘_dump_current_text’ from ‘_read_bytes’
LVM2.2.03.36/tools/pvck.c:931:20: branch_false: following ‘false’ branch...
LVM2.2.03.36/tools/pvck.c:932:25: branch_false: ...to here
LVM2.2.03.36/tools/pvck.c:932:25: danger: ‘calloc(1, meta_size + 1)’ leaks here; was allocated at [(3)](sarif:/runs/0/results/17/codeFlows/0/threadFlows/0/locations/2)
#  930|   
#  931|   		if (!_read_bytes(dev, def, offset_b, size_b, meta_buf + size_a)) {
#  932|-> 			log_print("CHECK: failed to read metadata text at mda_header_%d.raw_locn[%d].offset %llu size %llu part_b %llu %llu", mn, ri,
#  933|   				  (unsigned long long)meta_offset, (unsigned long long)meta_size,
#  934|   				  (unsigned long long)offset_b, (unsigned long long)size_b);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def685]
LVM2.2.03.36/tools/pvck.c:940:25: warning[-Wanalyzer-malloc-leak]: leak of ‘calloc(1, meta_size + 1)’
LVM2.2.03.36/tools/pvck.c:885:12: enter_function: entry to ‘_dump_current_text’
LVM2.2.03.36/tools/pvck.c:901:26: call_function: inlined call to ‘zalloc’ from ‘_dump_current_text’
LVM2.2.03.36/tools/pvck.c:901:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/tools/pvck.c:915:13: branch_false: ...to here
LVM2.2.03.36/tools/pvck.c:915:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/tools/pvck.c:939:22: branch_false: ...to here
LVM2.2.03.36/tools/pvck.c:939:22: call_function: calling ‘_read_bytes’ from ‘_dump_current_text’
LVM2.2.03.36/tools/pvck.c:939:22: return_function: returning to ‘_dump_current_text’ from ‘_read_bytes’
LVM2.2.03.36/tools/pvck.c:939:20: branch_false: following ‘false’ branch...
LVM2.2.03.36/tools/pvck.c:940:25: branch_false: ...to here
LVM2.2.03.36/tools/pvck.c:940:25: danger: ‘calloc(1, meta_size + 1)’ leaks here; was allocated at [(3)](sarif:/runs/0/results/18/codeFlows/0/threadFlows/0/locations/2)
#  938|   	} else {
#  939|   		if (!_read_bytes(dev, def, mda_offset + meta_offset, meta_size, meta_buf)) {
#  940|-> 			log_print("CHECK: failed to read metadata text at mda_header_%d.raw_locn[%d].offset %llu size %llu", mn, ri,
#  941|   				  (unsigned long long)meta_offset, (unsigned long long)meta_size);
#  942|   			free(meta_buf);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def686]
LVM2.2.03.36/tools/pvck.c:948:15: warning[-Wanalyzer-malloc-leak]: leak of ‘calloc(1, meta_size + 1)’
LVM2.2.03.36/tools/pvck.c:885:12: enter_function: entry to ‘_dump_current_text’
LVM2.2.03.36/tools/pvck.c:901:26: call_function: inlined call to ‘zalloc’ from ‘_dump_current_text’
LVM2.2.03.36/tools/pvck.c:901:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/tools/pvck.c:915:13: branch_false: ...to here
LVM2.2.03.36/tools/pvck.c:939:22: call_function: calling ‘_read_bytes’ from ‘_dump_current_text’
LVM2.2.03.36/tools/pvck.c:939:22: return_function: returning to ‘_dump_current_text’ from ‘_read_bytes’
LVM2.2.03.36/tools/pvck.c:939:20: branch_true: following ‘true’ branch...
LVM2.2.03.36/tools/pvck.c:947:17: branch_true: ...to here
LVM2.2.03.36/tools/pvck.c:948:15: danger: ‘calloc(1, meta_size + 1)’ leaks here; was allocated at [(3)](sarif:/runs/0/results/19/codeFlows/0/threadFlows/0/locations/2)
#  946|   
#  947|   	meta_buf[meta_size] = 0;
#  948|-> 	crc = calc_crc(INITIAL_CRC, (uint8_t *)meta_buf, meta_size);
#  949|   	if (crc != meta_checksum) {
#  950|   		log_print("CHECK: metadata text at %llu crc does not match mda_header_%d.raw_locn[%d].checksum",

Error: GCC_ANALYZER_WARNING (CWE-401): [#def687]
LVM2.2.03.36/tools/pvck.c:950:17: warning[-Wanalyzer-malloc-leak]: leak of ‘calloc(1, meta_size + 1)’
LVM2.2.03.36/tools/pvck.c:885:12: enter_function: entry to ‘_dump_current_text’
LVM2.2.03.36/tools/pvck.c:901:26: call_function: inlined call to ‘zalloc’ from ‘_dump_current_text’
LVM2.2.03.36/tools/pvck.c:901:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/tools/pvck.c:915:13: branch_false: ...to here
LVM2.2.03.36/tools/pvck.c:939:22: call_function: calling ‘_read_bytes’ from ‘_dump_current_text’
LVM2.2.03.36/tools/pvck.c:939:22: return_function: returning to ‘_dump_current_text’ from ‘_read_bytes’
LVM2.2.03.36/tools/pvck.c:939:20: branch_true: following ‘true’ branch...
LVM2.2.03.36/tools/pvck.c:947:17: branch_true: ...to here
LVM2.2.03.36/tools/pvck.c:949:12: branch_true: following ‘true’ branch...
LVM2.2.03.36/tools/pvck.c:950:17: branch_true: ...to here
LVM2.2.03.36/tools/pvck.c:950:17: danger: ‘calloc(1, meta_size + 1)’ leaks here; was allocated at [(3)](sarif:/runs/0/results/20/codeFlows/0/threadFlows/0/locations/2)
#  948|   	crc = calc_crc(INITIAL_CRC, (uint8_t *)meta_buf, meta_size);
#  949|   	if (crc != meta_checksum) {
#  950|-> 		log_print("CHECK: metadata text at %llu crc does not match mda_header_%d.raw_locn[%d].checksum",
#  951|   			  (unsigned long long)(mda_offset + meta_offset), mn, ri);
#  952|   		bad++;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def688]
LVM2.2.03.36/tools/pvck.c:955:21: warning[-Wanalyzer-malloc-leak]: leak of ‘calloc(1, meta_size + 1)’
LVM2.2.03.36/tools/pvck.c:885:12: enter_function: entry to ‘_dump_current_text’
LVM2.2.03.36/tools/pvck.c:901:26: call_function: inlined call to ‘zalloc’ from ‘_dump_current_text’
LVM2.2.03.36/tools/pvck.c:901:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/tools/pvck.c:915:13: branch_false: ...to here
LVM2.2.03.36/tools/pvck.c:939:22: call_function: calling ‘_read_bytes’ from ‘_dump_current_text’
LVM2.2.03.36/tools/pvck.c:939:22: return_function: returning to ‘_dump_current_text’ from ‘_read_bytes’
LVM2.2.03.36/tools/pvck.c:939:20: branch_true: following ‘true’ branch...
LVM2.2.03.36/tools/pvck.c:947:17: branch_true: ...to here
LVM2.2.03.36/tools/pvck.c:955:21: danger: ‘calloc(1, meta_size + 1)’ leaks here; was allocated at [(3)](sarif:/runs/0/results/21/codeFlows/0/threadFlows/0/locations/2)
#  953|   	}
#  954|   
#  955|-> 	if (!(cft = config_open(CONFIG_FILE_SPECIAL, NULL, 0))) {
#  956|   		log_print("CHECK: failed to set up metadata parsing");
#  957|   		bad++;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def689]
LVM2.2.03.36/tools/pvck.c:956:17: warning[-Wanalyzer-malloc-leak]: leak of ‘calloc(1, meta_size + 1)’
LVM2.2.03.36/tools/pvck.c:885:12: enter_function: entry to ‘_dump_current_text’
LVM2.2.03.36/tools/pvck.c:901:26: call_function: inlined call to ‘zalloc’ from ‘_dump_current_text’
LVM2.2.03.36/tools/pvck.c:901:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/tools/pvck.c:915:13: branch_false: ...to here
LVM2.2.03.36/tools/pvck.c:939:22: call_function: calling ‘_read_bytes’ from ‘_dump_current_text’
LVM2.2.03.36/tools/pvck.c:939:22: return_function: returning to ‘_dump_current_text’ from ‘_read_bytes’
LVM2.2.03.36/tools/pvck.c:939:20: branch_true: following ‘true’ branch...
LVM2.2.03.36/tools/pvck.c:947:17: branch_true: ...to here
LVM2.2.03.36/tools/pvck.c:955:12: branch_true: following ‘true’ branch...
LVM2.2.03.36/tools/pvck.c:956:17: branch_true: ...to here
LVM2.2.03.36/tools/pvck.c:956:17: danger: ‘calloc(1, meta_size + 1)’ leaks here; was allocated at [(3)](sarif:/runs/0/results/22/codeFlows/0/threadFlows/0/locations/2)
#  954|   
#  955|   	if (!(cft = config_open(CONFIG_FILE_SPECIAL, NULL, 0))) {
#  956|-> 		log_print("CHECK: failed to set up metadata parsing");
#  957|   		bad++;
#  958|   	} else {

Error: GCC_ANALYZER_WARNING (CWE-401): [#def690]
LVM2.2.03.36/tools/pvck.c:959:22: warning[-Wanalyzer-malloc-leak]: leak of ‘calloc(1, meta_size + 1)’
LVM2.2.03.36/tools/pvck.c:885:12: enter_function: entry to ‘_dump_current_text’
LVM2.2.03.36/tools/pvck.c:901:26: call_function: inlined call to ‘zalloc’ from ‘_dump_current_text’
LVM2.2.03.36/tools/pvck.c:901:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/tools/pvck.c:915:13: branch_false: ...to here
LVM2.2.03.36/tools/pvck.c:939:22: call_function: calling ‘_read_bytes’ from ‘_dump_current_text’
LVM2.2.03.36/tools/pvck.c:939:22: return_function: returning to ‘_dump_current_text’ from ‘_read_bytes’
LVM2.2.03.36/tools/pvck.c:939:20: branch_true: following ‘true’ branch...
LVM2.2.03.36/tools/pvck.c:947:17: branch_true: ...to here
LVM2.2.03.36/tools/pvck.c:955:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/tools/pvck.c:959:22: branch_false: ...to here
LVM2.2.03.36/tools/pvck.c:959:22: danger: ‘calloc(1, meta_size + 1)’ leaks here; was allocated at [(3)](sarif:/runs/0/results/23/codeFlows/0/threadFlows/0/locations/2)
#  957|   		bad++;
#  958|   	} else {
#  959|-> 		if (!dm_config_parse_without_dup_node_check(cft, meta_buf, meta_buf + meta_size)) {
#  960|   			log_print("CHECK: failed to parse metadata text at %llu size %llu",
#  961|   				  (unsigned long long)(mda_offset + meta_offset),

Error: GCC_ANALYZER_WARNING (CWE-401): [#def691]
LVM2.2.03.36/tools/pvck.c:960:25: warning[-Wanalyzer-malloc-leak]: leak of ‘calloc(1, meta_size + 1)’
LVM2.2.03.36/tools/pvck.c:885:12: enter_function: entry to ‘_dump_current_text’
LVM2.2.03.36/tools/pvck.c:901:26: call_function: inlined call to ‘zalloc’ from ‘_dump_current_text’
LVM2.2.03.36/tools/pvck.c:901:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/tools/pvck.c:915:13: branch_false: ...to here
LVM2.2.03.36/tools/pvck.c:939:22: call_function: calling ‘_read_bytes’ from ‘_dump_current_text’
LVM2.2.03.36/tools/pvck.c:939:22: return_function: returning to ‘_dump_current_text’ from ‘_read_bytes’
LVM2.2.03.36/tools/pvck.c:939:20: branch_true: following ‘true’ branch...
LVM2.2.03.36/tools/pvck.c:947:17: branch_true: ...to here
LVM2.2.03.36/tools/pvck.c:955:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/tools/pvck.c:959:22: branch_false: ...to here
LVM2.2.03.36/tools/pvck.c:959:20: branch_true: following ‘true’ branch...
LVM2.2.03.36/tools/pvck.c:960:25: branch_true: ...to here
LVM2.2.03.36/tools/pvck.c:960:25: danger: ‘calloc(1, meta_size + 1)’ leaks here; was allocated at [(3)](sarif:/runs/0/results/24/codeFlows/0/threadFlows/0/locations/2)
#  958|   	} else {
#  959|   		if (!dm_config_parse_without_dup_node_check(cft, meta_buf, meta_buf + meta_size)) {
#  960|-> 			log_print("CHECK: failed to parse metadata text at %llu size %llu",
#  961|   				  (unsigned long long)(mda_offset + meta_offset),
#  962|   				   (unsigned long long)meta_size);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def692]
LVM2.2.03.36/tools/pvck.c:967:41: warning[-Wanalyzer-malloc-leak]: leak of ‘calloc(1, meta_size + 1)’
LVM2.2.03.36/tools/pvck.c:885:12: enter_function: entry to ‘_dump_current_text’
LVM2.2.03.36/tools/pvck.c:901:26: call_function: inlined call to ‘zalloc’ from ‘_dump_current_text’
LVM2.2.03.36/tools/pvck.c:901:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/tools/pvck.c:915:13: branch_false: ...to here
LVM2.2.03.36/tools/pvck.c:939:22: call_function: calling ‘_read_bytes’ from ‘_dump_current_text’
LVM2.2.03.36/tools/pvck.c:939:22: return_function: returning to ‘_dump_current_text’ from ‘_read_bytes’
LVM2.2.03.36/tools/pvck.c:939:20: branch_true: following ‘true’ branch...
LVM2.2.03.36/tools/pvck.c:947:17: branch_true: ...to here
LVM2.2.03.36/tools/pvck.c:955:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/tools/pvck.c:959:22: branch_false: ...to here
LVM2.2.03.36/tools/pvck.c:959:20: branch_false: following ‘false’ branch...
LVM2.2.03.36/tools/pvck.c:965:29: branch_false: ...to here
LVM2.2.03.36/tools/pvck.c:965:28: branch_true: following ‘true’ branch...
LVM2.2.03.36/tools/pvck.c:966:36: branch_true: following ‘true’ branch (when ‘vgname’ is NULL)...
LVM2.2.03.36/tools/pvck.c:967:41: branch_true: ...to here
LVM2.2.03.36/tools/pvck.c:967:41: danger: ‘calloc(1, meta_size + 1)’ leaks here; was allocated at [(3)](sarif:/runs/0/results/25/codeFlows/0/threadFlows/0/locations/2)
#  965|   			if (cft->root && cft->root->key) {
#  966|   				if (!(vgname = strdup(cft->root->key))) {
#  967|-> 					log_error("Failed to allocate vgname.");
#  968|   					goto out;
#  969|   				}

Error: GCC_ANALYZER_WARNING (CWE-401): [#def693]
LVM2.2.03.36/tools/pvck.c:972:30: warning[-Wanalyzer-malloc-leak]: leak of ‘calloc(1, meta_size + 1)’
LVM2.2.03.36/tools/pvck.c:885:12: enter_function: entry to ‘_dump_current_text’
LVM2.2.03.36/tools/pvck.c:901:26: call_function: inlined call to ‘zalloc’ from ‘_dump_current_text’
LVM2.2.03.36/tools/pvck.c:901:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/tools/pvck.c:915:13: branch_false: ...to here
LVM2.2.03.36/tools/pvck.c:939:22: call_function: calling ‘_read_bytes’ from ‘_dump_current_text’
LVM2.2.03.36/tools/pvck.c:939:22: return_function: returning to ‘_dump_current_text’ from ‘_read_bytes’
LVM2.2.03.36/tools/pvck.c:939:20: branch_true: following ‘true’ branch...
LVM2.2.03.36/tools/pvck.c:947:17: branch_true: ...to here
LVM2.2.03.36/tools/pvck.c:955:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/tools/pvck.c:959:22: branch_false: ...to here
LVM2.2.03.36/tools/pvck.c:959:20: branch_false: following ‘false’ branch...
LVM2.2.03.36/tools/pvck.c:965:29: branch_false: ...to here
LVM2.2.03.36/tools/pvck.c:965:28: branch_true: following ‘true’ branch...
LVM2.2.03.36/tools/pvck.c:965:42: branch_true: ...to here
LVM2.2.03.36/tools/pvck.c:965:29: branch_false: following ‘false’ branch...
LVM2.2.03.36/tools/pvck.c:971:28: branch_false: ...to here
LVM2.2.03.36/tools/pvck.c:971:28: branch_true: following ‘true’ branch...
LVM2.2.03.36/tools/pvck.c:972:30: danger: ‘calloc(1, meta_size + 1)’ leaks here; was allocated at [(3)](sarif:/runs/0/results/27/codeFlows/0/threadFlows/0/locations/2)
#  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): [#def694]
LVM2.2.03.36/tools/pvck.c:972:30: warning[-Wanalyzer-malloc-leak]: leak of ‘vgname’
LVM2.2.03.36/tools/pvck.c:885:12: enter_function: entry to ‘_dump_current_text’
LVM2.2.03.36/tools/pvck.c:901:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/tools/pvck.c:915:13: branch_false: ...to here
LVM2.2.03.36/tools/pvck.c:939:22: call_function: calling ‘_read_bytes’ from ‘_dump_current_text’
LVM2.2.03.36/tools/pvck.c:939:22: return_function: returning to ‘_dump_current_text’ from ‘_read_bytes’
LVM2.2.03.36/tools/pvck.c:939:20: branch_true: following ‘true’ branch...
LVM2.2.03.36/tools/pvck.c:947:17: branch_true: ...to here
LVM2.2.03.36/tools/pvck.c:955:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/tools/pvck.c:959:22: branch_false: ...to here
LVM2.2.03.36/tools/pvck.c:959:20: branch_false: following ‘false’ branch...
LVM2.2.03.36/tools/pvck.c:965:29: branch_false: ...to here
LVM2.2.03.36/tools/pvck.c:965:28: branch_true: following ‘true’ branch...
LVM2.2.03.36/tools/pvck.c:966:48: acquire_memory: allocated here
LVM2.2.03.36/tools/pvck.c:966:36: branch_false: following ‘false’ branch (when ‘vgname’ is non-NULL)...
LVM2.2.03.36/tools/pvck.c:971:28: branch_false: ...to here
LVM2.2.03.36/tools/pvck.c:971:28: branch_true: following ‘true’ branch...
LVM2.2.03.36/tools/pvck.c:972:30: danger: ‘vgname’ leaks here; was allocated at [(17)](sarif:/runs/0/results/26/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): [#def695]
LVM2.2.03.36/tools/pvck.c:973:33: warning[-Wanalyzer-malloc-leak]: leak of ‘calloc(1, meta_size + 1)’
LVM2.2.03.36/tools/pvck.c:885:12: enter_function: entry to ‘_dump_current_text’
LVM2.2.03.36/tools/pvck.c:901:26: call_function: inlined call to ‘zalloc’ from ‘_dump_current_text’
LVM2.2.03.36/tools/pvck.c:901:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/tools/pvck.c:915:13: branch_false: ...to here
LVM2.2.03.36/tools/pvck.c:939:22: call_function: calling ‘_read_bytes’ from ‘_dump_current_text’
LVM2.2.03.36/tools/pvck.c:939:22: return_function: returning to ‘_dump_current_text’ from ‘_read_bytes’
LVM2.2.03.36/tools/pvck.c:939:20: branch_true: following ‘true’ branch...
LVM2.2.03.36/tools/pvck.c:947:17: branch_true: ...to here
LVM2.2.03.36/tools/pvck.c:955:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/tools/pvck.c:959:22: branch_false: ...to here
LVM2.2.03.36/tools/pvck.c:959:20: branch_false: following ‘false’ branch...
LVM2.2.03.36/tools/pvck.c:965:29: branch_false: ...to here
LVM2.2.03.36/tools/pvck.c:965:28: branch_true: following ‘true’ branch...
LVM2.2.03.36/tools/pvck.c:965:42: branch_true: ...to here
LVM2.2.03.36/tools/pvck.c:965:29: branch_false: following ‘false’ branch...
LVM2.2.03.36/tools/pvck.c:971:28: branch_false: ...to here
LVM2.2.03.36/tools/pvck.c:971:28: branch_true: following ‘true’ branch...
LVM2.2.03.36/tools/pvck.c:973:33: danger: ‘calloc(1, meta_size + 1)’ leaks here; was allocated at [(3)](sarif:/runs/0/results/29/codeFlows/0/threadFlows/0/locations/2)
#  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-401): [#def696]
LVM2.2.03.36/tools/pvck.c:973:33: warning[-Wanalyzer-malloc-leak]: leak of ‘vgname’
LVM2.2.03.36/tools/pvck.c:885:12: enter_function: entry to ‘_dump_current_text’
LVM2.2.03.36/tools/pvck.c:901:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/tools/pvck.c:915:13: branch_false: ...to here
LVM2.2.03.36/tools/pvck.c:939:22: call_function: calling ‘_read_bytes’ from ‘_dump_current_text’
LVM2.2.03.36/tools/pvck.c:939:22: return_function: returning to ‘_dump_current_text’ from ‘_read_bytes’
LVM2.2.03.36/tools/pvck.c:939:20: branch_true: following ‘true’ branch...
LVM2.2.03.36/tools/pvck.c:947:17: branch_true: ...to here
LVM2.2.03.36/tools/pvck.c:955:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/tools/pvck.c:959:22: branch_false: ...to here
LVM2.2.03.36/tools/pvck.c:959:20: branch_false: following ‘false’ branch...
LVM2.2.03.36/tools/pvck.c:965:29: branch_false: ...to here
LVM2.2.03.36/tools/pvck.c:965:28: branch_true: following ‘true’ branch...
LVM2.2.03.36/tools/pvck.c:966:48: acquire_memory: allocated here
LVM2.2.03.36/tools/pvck.c:966:36: branch_false: following ‘false’ branch (when ‘vgname’ is non-NULL)...
LVM2.2.03.36/tools/pvck.c:971:28: branch_false: ...to here
LVM2.2.03.36/tools/pvck.c:971:28: branch_true: following ‘true’ branch...
LVM2.2.03.36/tools/pvck.c:973:33: danger: ‘vgname’ leaks here; was allocated at [(17)](sarif:/runs/0/results/28/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-401): [#def697]
LVM2.2.03.36/tools/pvck.c:979:17: warning[-Wanalyzer-malloc-leak]: leak of ‘vgname’
LVM2.2.03.36/tools/pvck.c:885:12: enter_function: entry to ‘_dump_current_text’
LVM2.2.03.36/tools/pvck.c:901:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/tools/pvck.c:915:13: branch_false: ...to here
LVM2.2.03.36/tools/pvck.c:939:22: call_function: calling ‘_read_bytes’ from ‘_dump_current_text’
LVM2.2.03.36/tools/pvck.c:939:22: return_function: returning to ‘_dump_current_text’ from ‘_read_bytes’
LVM2.2.03.36/tools/pvck.c:939:20: branch_true: following ‘true’ branch...
LVM2.2.03.36/tools/pvck.c:947:17: branch_true: ...to here
LVM2.2.03.36/tools/pvck.c:955:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/tools/pvck.c:959:22: branch_false: ...to here
LVM2.2.03.36/tools/pvck.c:959:20: branch_false: following ‘false’ branch...
LVM2.2.03.36/tools/pvck.c:965:29: branch_false: ...to here
LVM2.2.03.36/tools/pvck.c:965:28: branch_true: following ‘true’ branch...
LVM2.2.03.36/tools/pvck.c:966:48: acquire_memory: allocated here
LVM2.2.03.36/tools/pvck.c:966:36: branch_false: following ‘false’ branch (when ‘vgname’ is non-NULL)...
LVM2.2.03.36/tools/pvck.c:971:28: branch_false: ...to here
LVM2.2.03.36/tools/pvck.c:971:28: branch_true: following ‘true’ branch...
LVM2.2.03.36/tools/pvck.c:971:43: branch_true: ...to here
LVM2.2.03.36/tools/pvck.c:971:29: branch_false: following ‘false’ branch...
 branch_false: ...to here
LVM2.2.03.36/tools/pvck.c:979:17: danger: ‘vgname’ leaks here; was allocated at [(17)](sarif:/runs/0/results/30/codeFlows/0/threadFlows/0/locations/16)
#  977|   			}
#  978|   		}
#  979|-> 		config_destroy(cft);
#  980|   	}
#  981|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def698]
LVM2.2.03.36/tools/pvck.c:983:17: warning[-Wanalyzer-malloc-leak]: leak of ‘vgname’
LVM2.2.03.36/tools/pvck.c:885:12: enter_function: entry to ‘_dump_current_text’
LVM2.2.03.36/tools/pvck.c:901:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/tools/pvck.c:915:13: branch_false: ...to here
LVM2.2.03.36/tools/pvck.c:939:22: call_function: calling ‘_read_bytes’ from ‘_dump_current_text’
LVM2.2.03.36/tools/pvck.c:939:22: return_function: returning to ‘_dump_current_text’ from ‘_read_bytes’
LVM2.2.03.36/tools/pvck.c:939:20: branch_true: following ‘true’ branch...
LVM2.2.03.36/tools/pvck.c:947:17: branch_true: ...to here
LVM2.2.03.36/tools/pvck.c:955:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/tools/pvck.c:959:22: branch_false: ...to here
LVM2.2.03.36/tools/pvck.c:959:20: branch_false: following ‘false’ branch...
LVM2.2.03.36/tools/pvck.c:965:29: branch_false: ...to here
LVM2.2.03.36/tools/pvck.c:965:28: branch_true: following ‘true’ branch...
LVM2.2.03.36/tools/pvck.c:966:48: acquire_memory: allocated here
LVM2.2.03.36/tools/pvck.c:966:36: branch_false: following ‘false’ branch (when ‘vgname’ is non-NULL)...
LVM2.2.03.36/tools/pvck.c:971:28: branch_false: ...to here
LVM2.2.03.36/tools/pvck.c:971:28: branch_true: following ‘true’ branch...
LVM2.2.03.36/tools/pvck.c:971:43: branch_true: ...to here
LVM2.2.03.36/tools/pvck.c:982:12: branch_true: following ‘true’ branch...
LVM2.2.03.36/tools/pvck.c:983:17: branch_true: ...to here
LVM2.2.03.36/tools/pvck.c:983:17: branch_true: following ‘true’ branch (when ‘vgname’ is non-NULL)...
 branch_true: ...to here
LVM2.2.03.36/tools/pvck.c:983:17: danger: ‘vgname’ leaks here; was allocated at [(17)](sarif:/runs/0/results/31/codeFlows/0/threadFlows/0/locations/16)
#  981|   
#  982|   	if (print_fields || print_metadata)
#  983|-> 		log_print("metadata text at %llu crc 0x%x # vgname %s seqno %u",
#  984|   			  (unsigned long long)(mda_offset + meta_offset), crc,
#  985|   			  vgname ? vgname : "?", seqno);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def699]
LVM2.2.03.36/tools/pvck.c:991:17: warning[-Wanalyzer-malloc-leak]: leak of ‘calloc(1, meta_size + 1)’
LVM2.2.03.36/tools/pvck.c:885:12: enter_function: entry to ‘_dump_current_text’
LVM2.2.03.36/tools/pvck.c:901:26: call_function: inlined call to ‘zalloc’ from ‘_dump_current_text’
LVM2.2.03.36/tools/pvck.c:901:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/tools/pvck.c:915:13: branch_false: ...to here
LVM2.2.03.36/tools/pvck.c:939:22: call_function: calling ‘_read_bytes’ from ‘_dump_current_text’
LVM2.2.03.36/tools/pvck.c:939:22: return_function: returning to ‘_dump_current_text’ from ‘_read_bytes’
LVM2.2.03.36/tools/pvck.c:939:20: branch_true: following ‘true’ branch...
LVM2.2.03.36/tools/pvck.c:947:17: branch_true: ...to here
LVM2.2.03.36/tools/pvck.c:955:12: branch_true: following ‘true’ branch...
LVM2.2.03.36/tools/pvck.c:956:17: branch_true: ...to here
LVM2.2.03.36/tools/pvck.c:982:12: branch_true: following ‘true’ branch...
LVM2.2.03.36/tools/pvck.c:983:17: branch_true: ...to here
LVM2.2.03.36/tools/pvck.c:983:17: branch_false: following ‘false’ branch (when ‘vgname’ is NULL)...
LVM2.2.03.36/tools/pvck.c:983:17: branch_false: ...to here
LVM2.2.03.36/tools/pvck.c:987:12: branch_false: following ‘false’ branch (when ‘print_metadata != 0’)...
LVM2.2.03.36/tools/pvck.c:990:12: branch_false: ...to here
LVM2.2.03.36/tools/pvck.c:990:12: branch_true: following ‘true’ branch (when ‘tofile’ is NULL)...
LVM2.2.03.36/tools/pvck.c:991:17: branch_true: ...to here
LVM2.2.03.36/tools/pvck.c:991:17: danger: ‘calloc(1, meta_size + 1)’ leaks here; was allocated at [(3)](sarif:/runs/0/results/32/codeFlows/0/threadFlows/0/locations/2)
#  989|   
#  990|   	if (!tofile) {
#  991|-> 		log_print("---");
#  992|   		printf("%s\n", meta_buf);
#  993|   		log_print("---");

Error: GCC_ANALYZER_WARNING (CWE-401): [#def700]
LVM2.2.03.36/tools/pvck.c:993:17: warning[-Wanalyzer-malloc-leak]: leak of ‘calloc(1, meta_size + 1)’
LVM2.2.03.36/tools/pvck.c:885:12: enter_function: entry to ‘_dump_current_text’
LVM2.2.03.36/tools/pvck.c:901:26: call_function: inlined call to ‘zalloc’ from ‘_dump_current_text’
LVM2.2.03.36/tools/pvck.c:901:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/tools/pvck.c:915:13: branch_false: ...to here
LVM2.2.03.36/tools/pvck.c:939:22: call_function: calling ‘_read_bytes’ from ‘_dump_current_text’
LVM2.2.03.36/tools/pvck.c:939:22: return_function: returning to ‘_dump_current_text’ from ‘_read_bytes’
LVM2.2.03.36/tools/pvck.c:939:20: branch_true: following ‘true’ branch...
LVM2.2.03.36/tools/pvck.c:947:17: branch_true: ...to here
LVM2.2.03.36/tools/pvck.c:955:12: branch_true: following ‘true’ branch...
LVM2.2.03.36/tools/pvck.c:956:17: branch_true: ...to here
LVM2.2.03.36/tools/pvck.c:982:12: branch_true: following ‘true’ branch...
LVM2.2.03.36/tools/pvck.c:983:17: branch_true: ...to here
LVM2.2.03.36/tools/pvck.c:983:17: branch_false: following ‘false’ branch (when ‘vgname’ is NULL)...
LVM2.2.03.36/tools/pvck.c:983:17: branch_false: ...to here
LVM2.2.03.36/tools/pvck.c:987:12: branch_false: following ‘false’ branch (when ‘print_metadata != 0’)...
LVM2.2.03.36/tools/pvck.c:990:12: branch_false: ...to here
LVM2.2.03.36/tools/pvck.c:990:12: branch_true: following ‘true’ branch (when ‘tofile’ is NULL)...
LVM2.2.03.36/tools/pvck.c:991:17: branch_true: ...to here
LVM2.2.03.36/tools/pvck.c:993:17: danger: ‘calloc(1, meta_size + 1)’ leaks here; was allocated at [(3)](sarif:/runs/0/results/33/codeFlows/0/threadFlows/0/locations/2)
#  991|   		log_print("---");
#  992|   		printf("%s\n", meta_buf);
#  993|-> 		log_print("---");
#  994|   	} else {
#  995|   		FILE *fp;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def701]
LVM2.2.03.36/tools/pvck.c:997:25: warning[-Wanalyzer-malloc-leak]: leak of ‘calloc(1, meta_size + 1)’
LVM2.2.03.36/tools/pvck.c:885:12: enter_function: entry to ‘_dump_current_text’
LVM2.2.03.36/tools/pvck.c:901:26: call_function: inlined call to ‘zalloc’ from ‘_dump_current_text’
LVM2.2.03.36/tools/pvck.c:901:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/tools/pvck.c:915:13: branch_false: ...to here
LVM2.2.03.36/tools/pvck.c:939:22: call_function: calling ‘_read_bytes’ from ‘_dump_current_text’
LVM2.2.03.36/tools/pvck.c:939:22: return_function: returning to ‘_dump_current_text’ from ‘_read_bytes’
LVM2.2.03.36/tools/pvck.c:939:20: branch_true: following ‘true’ branch...
LVM2.2.03.36/tools/pvck.c:947:17: branch_true: ...to here
LVM2.2.03.36/tools/pvck.c:955:12: branch_true: following ‘true’ branch...
LVM2.2.03.36/tools/pvck.c:956:17: branch_true: ...to here
LVM2.2.03.36/tools/pvck.c:982:12: branch_true: following ‘true’ branch...
LVM2.2.03.36/tools/pvck.c:983:17: branch_true: ...to here
LVM2.2.03.36/tools/pvck.c:983:17: branch_false: following ‘false’ branch (when ‘vgname’ is NULL)...
LVM2.2.03.36/tools/pvck.c:983:17: branch_false: ...to here
LVM2.2.03.36/tools/pvck.c:987:12: branch_false: following ‘false’ branch (when ‘print_metadata != 0’)...
LVM2.2.03.36/tools/pvck.c:990:12: branch_false: ...to here
LVM2.2.03.36/tools/pvck.c:990:12: branch_false: following ‘false’ branch (when ‘tofile’ is non-NULL)...
LVM2.2.03.36/tools/pvck.c:996:28: branch_false: ...to here
LVM2.2.03.36/tools/pvck.c:996:20: branch_true: following ‘true’ branch...
LVM2.2.03.36/tools/pvck.c:997:25: branch_true: ...to here
LVM2.2.03.36/tools/pvck.c:997:25: danger: ‘calloc(1, meta_size + 1)’ leaks here; was allocated at [(3)](sarif:/runs/0/results/34/codeFlows/0/threadFlows/0/locations/2)
#  995|   		FILE *fp;
#  996|   		if (!(fp = fopen(tofile, "wx"))) {
#  997|-> 			log_error("Failed to create file %s", tofile);
#  998|   			goto out;
#  999|   		}

Error: GCC_ANALYZER_WARNING (CWE-775): [#def702]
LVM2.2.03.36/tools/pvck.c:1003:21: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(tofile, "wx")’
LVM2.2.03.36/tools/pvck.c:885:12: enter_function: entry to ‘_dump_current_text’
LVM2.2.03.36/tools/pvck.c:901:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/tools/pvck.c:915:13: branch_false: ...to here
LVM2.2.03.36/tools/pvck.c:939:22: call_function: calling ‘_read_bytes’ from ‘_dump_current_text’
LVM2.2.03.36/tools/pvck.c:939:22: return_function: returning to ‘_dump_current_text’ from ‘_read_bytes’
LVM2.2.03.36/tools/pvck.c:939:20: branch_true: following ‘true’ branch...
LVM2.2.03.36/tools/pvck.c:947:17: branch_true: ...to here
LVM2.2.03.36/tools/pvck.c:982:12: branch_true: following ‘true’ branch...
LVM2.2.03.36/tools/pvck.c:983:17: branch_true: ...to here
LVM2.2.03.36/tools/pvck.c:983:17: branch_false: following ‘false’ branch (when ‘vgname’ is NULL)...
LVM2.2.03.36/tools/pvck.c:983:17: branch_false: ...to here
LVM2.2.03.36/tools/pvck.c:987:12: branch_false: following ‘false’ branch (when ‘print_metadata != 0’)...
LVM2.2.03.36/tools/pvck.c:990:12: branch_false: ...to here
LVM2.2.03.36/tools/pvck.c:990:12: branch_false: following ‘false’ branch (when ‘tofile’ is non-NULL)...
LVM2.2.03.36/tools/pvck.c:996:28: branch_false: ...to here
LVM2.2.03.36/tools/pvck.c:996:28: acquire_resource: opened here
LVM2.2.03.36/tools/pvck.c:996:20: branch_false: following ‘false’ branch...
LVM2.2.03.36/tools/pvck.c:1001:17: branch_false: ...to here
LVM2.2.03.36/tools/pvck.c:1003:21: danger: ‘fopen(tofile, "wx")’ leaks here; was opened at [(19)](sarif:/runs/0/results/35/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): [#def703]
LVM2.2.03.36/tools/pvck.c:1003:21: warning[-Wanalyzer-malloc-leak]: leak of ‘calloc(1, meta_size + 1)’
LVM2.2.03.36/tools/pvck.c:885:12: enter_function: entry to ‘_dump_current_text’
LVM2.2.03.36/tools/pvck.c:901:26: call_function: inlined call to ‘zalloc’ from ‘_dump_current_text’
LVM2.2.03.36/tools/pvck.c:901:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/tools/pvck.c:915:13: branch_false: ...to here
LVM2.2.03.36/tools/pvck.c:939:22: call_function: calling ‘_read_bytes’ from ‘_dump_current_text’
LVM2.2.03.36/tools/pvck.c:939:22: return_function: returning to ‘_dump_current_text’ from ‘_read_bytes’
LVM2.2.03.36/tools/pvck.c:939:20: branch_true: following ‘true’ branch...
LVM2.2.03.36/tools/pvck.c:947:17: branch_true: ...to here
LVM2.2.03.36/tools/pvck.c:955:12: branch_true: following ‘true’ branch...
LVM2.2.03.36/tools/pvck.c:956:17: branch_true: ...to here
LVM2.2.03.36/tools/pvck.c:982:12: branch_true: following ‘true’ branch...
LVM2.2.03.36/tools/pvck.c:983:17: branch_true: ...to here
LVM2.2.03.36/tools/pvck.c:983:17: branch_false: following ‘false’ branch (when ‘vgname’ is NULL)...
LVM2.2.03.36/tools/pvck.c:983:17: branch_false: ...to here
LVM2.2.03.36/tools/pvck.c:987:12: branch_false: following ‘false’ branch (when ‘print_metadata != 0’)...
LVM2.2.03.36/tools/pvck.c:990:12: branch_false: ...to here
LVM2.2.03.36/tools/pvck.c:990:12: branch_false: following ‘false’ branch (when ‘tofile’ is non-NULL)...
LVM2.2.03.36/tools/pvck.c:996:28: branch_false: ...to here
LVM2.2.03.36/tools/pvck.c:996:20: branch_false: following ‘false’ branch...
LVM2.2.03.36/tools/pvck.c:1001:17: branch_false: ...to here
LVM2.2.03.36/tools/pvck.c:1003:21: danger: ‘calloc(1, meta_size + 1)’ leaks here; was allocated at [(3)](sarif:/runs/0/results/37/codeFlows/0/threadFlows/0/locations/2)
# 1001|   		fprintf(fp, "%s", meta_buf);
# 1002|   
# 1003|-> 		if (fflush(fp))
# 1004|   			stack;
# 1005|   		if (fclose(fp))

Error: GCC_ANALYZER_WARNING (CWE-401): [#def704]
LVM2.2.03.36/tools/pvck.c:1003:21: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(tofile, "wx")’
LVM2.2.03.36/tools/pvck.c:885:12: enter_function: entry to ‘_dump_current_text’
LVM2.2.03.36/tools/pvck.c:901:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/tools/pvck.c:915:13: branch_false: ...to here
LVM2.2.03.36/tools/pvck.c:939:22: call_function: calling ‘_read_bytes’ from ‘_dump_current_text’
LVM2.2.03.36/tools/pvck.c:939:22: return_function: returning to ‘_dump_current_text’ from ‘_read_bytes’
LVM2.2.03.36/tools/pvck.c:939:20: branch_true: following ‘true’ branch...
LVM2.2.03.36/tools/pvck.c:947:17: branch_true: ...to here
LVM2.2.03.36/tools/pvck.c:982:12: branch_true: following ‘true’ branch...
LVM2.2.03.36/tools/pvck.c:983:17: branch_true: ...to here
LVM2.2.03.36/tools/pvck.c:983:17: branch_false: following ‘false’ branch (when ‘vgname’ is NULL)...
LVM2.2.03.36/tools/pvck.c:983:17: branch_false: ...to here
LVM2.2.03.36/tools/pvck.c:987:12: branch_false: following ‘false’ branch (when ‘print_metadata != 0’)...
LVM2.2.03.36/tools/pvck.c:990:12: branch_false: ...to here
LVM2.2.03.36/tools/pvck.c:990:12: branch_false: following ‘false’ branch (when ‘tofile’ is non-NULL)...
LVM2.2.03.36/tools/pvck.c:996:28: branch_false: ...to here
LVM2.2.03.36/tools/pvck.c:996:28: acquire_memory: allocated here
LVM2.2.03.36/tools/pvck.c:996:20: branch_false: following ‘false’ branch...
LVM2.2.03.36/tools/pvck.c:1001:17: branch_false: ...to here
LVM2.2.03.36/tools/pvck.c:1003:21: danger: ‘fopen(tofile, "wx")’ leaks here; was allocated at [(19)](sarif:/runs/0/results/36/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): [#def705]
LVM2.2.03.36/tools/pvck.c:1004:25: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(tofile, "wx")’
LVM2.2.03.36/tools/pvck.c:885:12: enter_function: entry to ‘_dump_current_text’
LVM2.2.03.36/tools/pvck.c:901:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/tools/pvck.c:915:13: branch_false: ...to here
LVM2.2.03.36/tools/pvck.c:939:22: call_function: calling ‘_read_bytes’ from ‘_dump_current_text’
LVM2.2.03.36/tools/pvck.c:939:22: return_function: returning to ‘_dump_current_text’ from ‘_read_bytes’
LVM2.2.03.36/tools/pvck.c:939:20: branch_true: following ‘true’ branch...
LVM2.2.03.36/tools/pvck.c:947:17: branch_true: ...to here
LVM2.2.03.36/tools/pvck.c:982:12: branch_true: following ‘true’ branch...
LVM2.2.03.36/tools/pvck.c:983:17: branch_true: ...to here
LVM2.2.03.36/tools/pvck.c:983:17: branch_false: following ‘false’ branch (when ‘vgname’ is NULL)...
LVM2.2.03.36/tools/pvck.c:983:17: branch_false: ...to here
LVM2.2.03.36/tools/pvck.c:987:12: branch_false: following ‘false’ branch (when ‘print_metadata != 0’)...
LVM2.2.03.36/tools/pvck.c:990:12: branch_false: ...to here
LVM2.2.03.36/tools/pvck.c:990:12: branch_false: following ‘false’ branch (when ‘tofile’ is non-NULL)...
LVM2.2.03.36/tools/pvck.c:996:28: branch_false: ...to here
LVM2.2.03.36/tools/pvck.c:996:28: acquire_resource: opened here
LVM2.2.03.36/tools/pvck.c:996:20: branch_false: following ‘false’ branch...
LVM2.2.03.36/tools/pvck.c:1001:17: branch_false: ...to here
LVM2.2.03.36/tools/pvck.c:1003:20: branch_true: following ‘true’ branch...
LVM2.2.03.36/tools/pvck.c:1004:25: branch_true: ...to here
LVM2.2.03.36/tools/pvck.c:1004:25: danger: ‘fopen(tofile, "wx")’ leaks here; was opened at [(19)](sarif:/runs/0/results/38/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): [#def706]
LVM2.2.03.36/tools/pvck.c:1004:25: warning[-Wanalyzer-malloc-leak]: leak of ‘calloc(1, meta_size + 1)’
LVM2.2.03.36/tools/pvck.c:885:12: enter_function: entry to ‘_dump_current_text’
LVM2.2.03.36/tools/pvck.c:901:26: call_function: inlined call to ‘zalloc’ from ‘_dump_current_text’
LVM2.2.03.36/tools/pvck.c:901:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/tools/pvck.c:915:13: branch_false: ...to here
LVM2.2.03.36/tools/pvck.c:939:22: call_function: calling ‘_read_bytes’ from ‘_dump_current_text’
LVM2.2.03.36/tools/pvck.c:939:22: return_function: returning to ‘_dump_current_text’ from ‘_read_bytes’
LVM2.2.03.36/tools/pvck.c:939:20: branch_true: following ‘true’ branch...
LVM2.2.03.36/tools/pvck.c:947:17: branch_true: ...to here
LVM2.2.03.36/tools/pvck.c:955:12: branch_true: following ‘true’ branch...
LVM2.2.03.36/tools/pvck.c:956:17: branch_true: ...to here
LVM2.2.03.36/tools/pvck.c:982:12: branch_true: following ‘true’ branch...
LVM2.2.03.36/tools/pvck.c:983:17: branch_true: ...to here
LVM2.2.03.36/tools/pvck.c:983:17: branch_false: following ‘false’ branch (when ‘vgname’ is NULL)...
LVM2.2.03.36/tools/pvck.c:983:17: branch_false: ...to here
LVM2.2.03.36/tools/pvck.c:987:12: branch_false: following ‘false’ branch (when ‘print_metadata != 0’)...
LVM2.2.03.36/tools/pvck.c:990:12: branch_false: ...to here
LVM2.2.03.36/tools/pvck.c:990:12: branch_false: following ‘false’ branch (when ‘tofile’ is non-NULL)...
LVM2.2.03.36/tools/pvck.c:996:28: branch_false: ...to here
LVM2.2.03.36/tools/pvck.c:996:20: branch_false: following ‘false’ branch...
LVM2.2.03.36/tools/pvck.c:1001:17: branch_false: ...to here
LVM2.2.03.36/tools/pvck.c:1003:20: branch_true: following ‘true’ branch...
LVM2.2.03.36/tools/pvck.c:1004:25: branch_true: ...to here
LVM2.2.03.36/tools/pvck.c:1004:25: danger: ‘calloc(1, meta_size + 1)’ leaks here; was allocated at [(3)](sarif:/runs/0/results/40/codeFlows/0/threadFlows/0/locations/2)
# 1002|   
# 1003|   		if (fflush(fp))
# 1004|-> 			stack;
# 1005|   		if (fclose(fp))
# 1006|   			stack;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def707]
LVM2.2.03.36/tools/pvck.c:1004:25: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(tofile, "wx")’
LVM2.2.03.36/tools/pvck.c:885:12: enter_function: entry to ‘_dump_current_text’
LVM2.2.03.36/tools/pvck.c:901:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/tools/pvck.c:915:13: branch_false: ...to here
LVM2.2.03.36/tools/pvck.c:939:22: call_function: calling ‘_read_bytes’ from ‘_dump_current_text’
LVM2.2.03.36/tools/pvck.c:939:22: return_function: returning to ‘_dump_current_text’ from ‘_read_bytes’
LVM2.2.03.36/tools/pvck.c:939:20: branch_true: following ‘true’ branch...
LVM2.2.03.36/tools/pvck.c:947:17: branch_true: ...to here
LVM2.2.03.36/tools/pvck.c:982:12: branch_true: following ‘true’ branch...
LVM2.2.03.36/tools/pvck.c:983:17: branch_true: ...to here
LVM2.2.03.36/tools/pvck.c:983:17: branch_false: following ‘false’ branch (when ‘vgname’ is NULL)...
LVM2.2.03.36/tools/pvck.c:983:17: branch_false: ...to here
LVM2.2.03.36/tools/pvck.c:987:12: branch_false: following ‘false’ branch (when ‘print_metadata != 0’)...
LVM2.2.03.36/tools/pvck.c:990:12: branch_false: ...to here
LVM2.2.03.36/tools/pvck.c:990:12: branch_false: following ‘false’ branch (when ‘tofile’ is non-NULL)...
LVM2.2.03.36/tools/pvck.c:996:28: branch_false: ...to here
LVM2.2.03.36/tools/pvck.c:996:28: acquire_memory: allocated here
LVM2.2.03.36/tools/pvck.c:996:20: branch_false: following ‘false’ branch...
LVM2.2.03.36/tools/pvck.c:1001:17: branch_false: ...to here
LVM2.2.03.36/tools/pvck.c:1003:20: branch_true: following ‘true’ branch...
LVM2.2.03.36/tools/pvck.c:1004:25: branch_true: ...to here
LVM2.2.03.36/tools/pvck.c:1004:25: danger: ‘fopen(tofile, "wx")’ leaks here; was allocated at [(19)](sarif:/runs/0/results/39/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): [#def708]
LVM2.2.03.36/tools/pvck.c:2132:14: warning[-Wanalyzer-malloc-leak]: leak of ‘buf’
LVM2.2.03.36/tools/pvck.c:2122:12: branch_false: following ‘false’ branch (when ‘device_size > 2097151’)...
LVM2.2.03.36/tools/pvck.c:2126:22: branch_false: ...to here
LVM2.2.03.36/tools/pvck.c:2129:21: acquire_memory: allocated here
LVM2.2.03.36/tools/pvck.c:2129:12: branch_false: following ‘false’ branch (when ‘buf’ is non-NULL)...
LVM2.2.03.36/tools/pvck.c:2132:14: branch_false: ...to here
LVM2.2.03.36/tools/pvck.c:2132:14: danger: ‘buf’ leaks here; was allocated at [(3)](sarif:/runs/0/results/41/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): [#def709]
LVM2.2.03.36/tools/pvck.c:2703:17: warning[-Wanalyzer-malloc-leak]: leak of ‘calloc(1, back_size)’
LVM2.2.03.36/tools/pvck.c:2796:12: enter_function: entry to ‘_dump_backup_to_raw’
LVM2.2.03.36/tools/pvck.c:2805:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/tools/pvck.c:2810:12: branch_false: ...to here
LVM2.2.03.36/tools/pvck.c:2810:12: branch_false: following ‘false’ branch (when ‘input’ is non-NULL)...
LVM2.2.03.36/tools/pvck.c:2815:19: branch_false: ...to here
LVM2.2.03.36/tools/pvck.c:2815:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/tools/pvck.c:2820:13: branch_false: ...to here
LVM2.2.03.36/tools/pvck.c:2820:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/tools/pvck.c:2825:37: branch_false: ...to here
LVM2.2.03.36/tools/pvck.c:2825:12: branch_false: following ‘false’ branch (when ‘back_size != 0’)...
LVM2.2.03.36/tools/pvck.c:2830:26: call_function: inlined call to ‘zalloc’ from ‘_dump_backup_to_raw’
LVM2.2.03.36/tools/pvck.c:2830:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/tools/pvck.c:2833:14: branch_false: ...to here
LVM2.2.03.36/tools/pvck.c:2834:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/tools/pvck.c:2840:13: branch_false: ...to here
LVM2.2.03.36/tools/pvck.c:2843:14: call_function: inlined call to ‘_is_backup_file’ from ‘_dump_backup_to_raw’
 branch_true: ...to here
LVM2.2.03.36/tools/pvck.c:2843:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/tools/pvck.c:2849:14: branch_false: ...to here
LVM2.2.03.36/tools/pvck.c:2849:14: call_function: calling ‘_backup_file_to_raw_metadata’ from ‘_dump_backup_to_raw’
# 2701|   
# 2702|   	if (!(text_buf = zalloc(text_max)))
# 2703|-> 		return_0;
# 2704|   
# 2705|   	p = back_buf;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def710]
LVM2.2.03.36/tools/pvck.c:2703:17: warning[-Wanalyzer-malloc-leak]: leak of ‘malloc((long unsigned int)sb.st_size + 1)’
LVM2.2.03.36/tools/pvck.c:2944:12: enter_function: entry to ‘_read_metadata_file’
LVM2.2.03.36/tools/pvck.c:2952:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/tools/pvck.c:2957:13: branch_false: ...to here
LVM2.2.03.36/tools/pvck.c:2957:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/tools/pvck.c:2962:37: branch_false: ...to here
LVM2.2.03.36/tools/pvck.c:2962:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/tools/pvck.c:2967:33: branch_false: ...to here
LVM2.2.03.36/tools/pvck.c:2967:26: acquire_memory: allocated here
LVM2.2.03.36/tools/pvck.c:2967:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/tools/pvck.c:2970:14: branch_false: ...to here
LVM2.2.03.36/tools/pvck.c:2971:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/tools/pvck.c:2976:18: branch_false: ...to here
LVM2.2.03.36/tools/pvck.c:2981:13: call_function: inlined call to ‘_is_backup_file’ from ‘_read_metadata_file’
 branch_true: ...to here
LVM2.2.03.36/tools/pvck.c:2981:12: branch_true: following ‘true’ branch...
LVM2.2.03.36/tools/pvck.c:2984:17: branch_true: ...to here
LVM2.2.03.36/tools/pvck.c:2986:22: call_function: calling ‘_backup_file_to_raw_metadata’ from ‘_read_metadata_file’
# 2701|   
# 2702|   	if (!(text_buf = zalloc(text_max)))
# 2703|-> 		return_0;
# 2704|   
# 2705|   	p = back_buf;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def711]
LVM2.2.03.36/tools/pvck.c:2770:17: warning[-Wanalyzer-malloc-leak]: leak of ‘calloc(1, back_size)’
LVM2.2.03.36/tools/pvck.c:2796:12: enter_function: entry to ‘_dump_backup_to_raw’
LVM2.2.03.36/tools/pvck.c:2805:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/tools/pvck.c:2810:12: branch_false: ...to here
LVM2.2.03.36/tools/pvck.c:2810:12: branch_false: following ‘false’ branch (when ‘input’ is non-NULL)...
LVM2.2.03.36/tools/pvck.c:2815:19: branch_false: ...to here
LVM2.2.03.36/tools/pvck.c:2815:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/tools/pvck.c:2820:13: branch_false: ...to here
LVM2.2.03.36/tools/pvck.c:2820:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/tools/pvck.c:2825:37: branch_false: ...to here
LVM2.2.03.36/tools/pvck.c:2825:12: branch_false: following ‘false’ branch (when ‘back_size != 0’)...
LVM2.2.03.36/tools/pvck.c:2830:26: call_function: inlined call to ‘zalloc’ from ‘_dump_backup_to_raw’
LVM2.2.03.36/tools/pvck.c:2830:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/tools/pvck.c:2833:14: branch_false: ...to here
LVM2.2.03.36/tools/pvck.c:2834:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/tools/pvck.c:2840:13: branch_false: ...to here
LVM2.2.03.36/tools/pvck.c:2843:14: call_function: inlined call to ‘_is_backup_file’ from ‘_dump_backup_to_raw’
 branch_true: ...to here
LVM2.2.03.36/tools/pvck.c:2843:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/tools/pvck.c:2849:14: branch_false: ...to here
LVM2.2.03.36/tools/pvck.c:2849:14: call_function: calling ‘_backup_file_to_raw_metadata’ from ‘_dump_backup_to_raw’
# 2768|   	if (text_pos + pre_len + 3 > text_max) {
# 2769|   		free(text_buf);
# 2770|-> 		return_0;
# 2771|   	}
# 2772|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def712]
LVM2.2.03.36/tools/pvck.c:2770:17: warning[-Wanalyzer-malloc-leak]: leak of ‘malloc((long unsigned int)sb.st_size + 1)’
LVM2.2.03.36/tools/pvck.c:2944:12: enter_function: entry to ‘_read_metadata_file’
LVM2.2.03.36/tools/pvck.c:2952:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/tools/pvck.c:2957:13: branch_false: ...to here
LVM2.2.03.36/tools/pvck.c:2957:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/tools/pvck.c:2962:37: branch_false: ...to here
LVM2.2.03.36/tools/pvck.c:2962:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/tools/pvck.c:2967:33: branch_false: ...to here
LVM2.2.03.36/tools/pvck.c:2967:26: acquire_memory: allocated here
LVM2.2.03.36/tools/pvck.c:2967:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/tools/pvck.c:2970:14: branch_false: ...to here
LVM2.2.03.36/tools/pvck.c:2971:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/tools/pvck.c:2976:18: branch_false: ...to here
LVM2.2.03.36/tools/pvck.c:2981:13: call_function: inlined call to ‘_is_backup_file’ from ‘_read_metadata_file’
 branch_true: ...to here
LVM2.2.03.36/tools/pvck.c:2981:12: branch_true: following ‘true’ branch...
LVM2.2.03.36/tools/pvck.c:2984:17: branch_true: ...to here
LVM2.2.03.36/tools/pvck.c:2986:22: call_function: calling ‘_backup_file_to_raw_metadata’ from ‘_read_metadata_file’
# 2768|   	if (text_pos + pre_len + 3 > text_max) {
# 2769|   		free(text_buf);
# 2770|-> 		return_0;
# 2771|   	}
# 2772|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def713]
LVM2.2.03.36/tools/pvck.c:2835:17: warning[-Wanalyzer-malloc-leak]: leak of ‘calloc(1, back_size)’
LVM2.2.03.36/tools/pvck.c:2796:12: enter_function: entry to ‘_dump_backup_to_raw’
LVM2.2.03.36/tools/pvck.c:2810:12: branch_false: following ‘false’ branch (when ‘input’ is non-NULL)...
LVM2.2.03.36/tools/pvck.c:2815:19: branch_false: ...to here
LVM2.2.03.36/tools/pvck.c:2815:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/tools/pvck.c:2820:13: branch_false: ...to here
LVM2.2.03.36/tools/pvck.c:2820:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/tools/pvck.c:2825:37: branch_false: ...to here
LVM2.2.03.36/tools/pvck.c:2825:12: branch_false: following ‘false’ branch (when ‘back_size != 0’)...
LVM2.2.03.36/tools/pvck.c:2830:26: call_function: inlined call to ‘zalloc’ from ‘_dump_backup_to_raw’
LVM2.2.03.36/tools/pvck.c:2830:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/tools/pvck.c:2833:14: branch_false: ...to here
LVM2.2.03.36/tools/pvck.c:2834:12: branch_true: following ‘true’ branch...
LVM2.2.03.36/tools/pvck.c:2835:17: branch_true: ...to here
LVM2.2.03.36/tools/pvck.c:2835:17: danger: ‘calloc(1, back_size)’ leaks here; was allocated at [(11)](sarif:/runs/0/results/46/codeFlows/0/threadFlows/0/locations/10)
# 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);
# 2837|   		goto fail_close;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def714]
LVM2.2.03.36/tools/pvck.c:2840:13: warning[-Wanalyzer-malloc-leak]: leak of ‘calloc(1, back_size)’
LVM2.2.03.36/tools/pvck.c:2796:12: enter_function: entry to ‘_dump_backup_to_raw’
LVM2.2.03.36/tools/pvck.c:2805:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/tools/pvck.c:2810:12: branch_false: ...to here
LVM2.2.03.36/tools/pvck.c:2810:12: branch_false: following ‘false’ branch (when ‘input’ is non-NULL)...
LVM2.2.03.36/tools/pvck.c:2815:19: branch_false: ...to here
LVM2.2.03.36/tools/pvck.c:2815:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/tools/pvck.c:2820:13: branch_false: ...to here
LVM2.2.03.36/tools/pvck.c:2820:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/tools/pvck.c:2825:37: branch_false: ...to here
LVM2.2.03.36/tools/pvck.c:2825:12: branch_false: following ‘false’ branch (when ‘back_size != 0’)...
LVM2.2.03.36/tools/pvck.c:2830:26: call_function: inlined call to ‘zalloc’ from ‘_dump_backup_to_raw’
LVM2.2.03.36/tools/pvck.c:2830:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/tools/pvck.c:2833:14: branch_false: ...to here
LVM2.2.03.36/tools/pvck.c:2834:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/tools/pvck.c:2840:13: branch_false: ...to here
LVM2.2.03.36/tools/pvck.c:2840:13: danger: ‘calloc(1, back_size)’ leaks here; was allocated at [(13)](sarif:/runs/0/results/47/codeFlows/0/threadFlows/0/locations/12)
# 2838|   	}
# 2839|   
# 2840|-> 	if (close(fd))
# 2841|   		stack;
# 2842|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def715]
LVM2.2.03.36/tools/pvck.c:2841:17: warning[-Wanalyzer-malloc-leak]: leak of ‘calloc(1, back_size)’
LVM2.2.03.36/tools/pvck.c:2796:12: enter_function: entry to ‘_dump_backup_to_raw’
LVM2.2.03.36/tools/pvck.c:2805:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/tools/pvck.c:2810:12: branch_false: ...to here
LVM2.2.03.36/tools/pvck.c:2810:12: branch_false: following ‘false’ branch (when ‘input’ is non-NULL)...
LVM2.2.03.36/tools/pvck.c:2815:19: branch_false: ...to here
LVM2.2.03.36/tools/pvck.c:2815:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/tools/pvck.c:2820:13: branch_false: ...to here
LVM2.2.03.36/tools/pvck.c:2820:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/tools/pvck.c:2825:37: branch_false: ...to here
LVM2.2.03.36/tools/pvck.c:2825:12: branch_false: following ‘false’ branch (when ‘back_size != 0’)...
LVM2.2.03.36/tools/pvck.c:2830:26: call_function: inlined call to ‘zalloc’ from ‘_dump_backup_to_raw’
LVM2.2.03.36/tools/pvck.c:2830:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/tools/pvck.c:2833:14: branch_false: ...to here
LVM2.2.03.36/tools/pvck.c:2834:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/tools/pvck.c:2840:13: branch_false: ...to here
LVM2.2.03.36/tools/pvck.c:2840:12: branch_true: following ‘true’ branch...
LVM2.2.03.36/tools/pvck.c:2841:17: branch_true: ...to here
LVM2.2.03.36/tools/pvck.c:2841:17: danger: ‘calloc(1, back_size)’ leaks here; was allocated at [(13)](sarif:/runs/0/results/48/codeFlows/0/threadFlows/0/locations/12)
# 2839|   
# 2840|   	if (close(fd))
# 2841|-> 		stack;
# 2842|   
# 2843|   	if (!_is_backup_file(cmd, back_buf, back_size)) {

Error: GCC_ANALYZER_WARNING (CWE-401): [#def716]
LVM2.2.03.36/tools/pvck.c:2844:17: warning[-Wanalyzer-malloc-leak]: leak of ‘calloc(1, back_size)’
LVM2.2.03.36/tools/pvck.c:2796:12: enter_function: entry to ‘_dump_backup_to_raw’
LVM2.2.03.36/tools/pvck.c:2810:12: branch_false: following ‘false’ branch (when ‘input’ is non-NULL)...
LVM2.2.03.36/tools/pvck.c:2815:19: branch_false: ...to here
LVM2.2.03.36/tools/pvck.c:2815:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/tools/pvck.c:2820:13: branch_false: ...to here
LVM2.2.03.36/tools/pvck.c:2820:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/tools/pvck.c:2825:37: branch_false: ...to here
LVM2.2.03.36/tools/pvck.c:2825:12: branch_false: following ‘false’ branch (when ‘back_size != 0’)...
LVM2.2.03.36/tools/pvck.c:2830:26: call_function: inlined call to ‘zalloc’ from ‘_dump_backup_to_raw’
LVM2.2.03.36/tools/pvck.c:2830:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/tools/pvck.c:2833:14: branch_false: ...to here
LVM2.2.03.36/tools/pvck.c:2834:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/tools/pvck.c:2840:13: branch_false: ...to here
LVM2.2.03.36/tools/pvck.c:2844:17: danger: ‘calloc(1, back_size)’ leaks here; was allocated at [(11)](sarif:/runs/0/results/49/codeFlows/0/threadFlows/0/locations/10)
# 2842|   
# 2843|   	if (!_is_backup_file(cmd, back_buf, back_size)) {
# 2844|-> 		log_error("File does not appear to contain a metadata backup.");
# 2845|   		free(back_buf);
# 2846|   		return 0;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def717]
LVM2.2.03.36/tools/pvck.c:2894:17: warning[-Wanalyzer-malloc-leak]: leak of ‘text_buf’
LVM2.2.03.36/tools/pvck.c:2944:12: enter_function: entry to ‘_read_metadata_file’
LVM2.2.03.36/tools/pvck.c:2952:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/tools/pvck.c:2957:13: branch_false: ...to here
LVM2.2.03.36/tools/pvck.c:2957:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/tools/pvck.c:2962:37: branch_false: ...to here
LVM2.2.03.36/tools/pvck.c:2962:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/tools/pvck.c:2967:33: branch_false: ...to here
LVM2.2.03.36/tools/pvck.c:2967:26: acquire_memory: allocated here
LVM2.2.03.36/tools/pvck.c:2967:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/tools/pvck.c:2970:14: branch_false: ...to here
LVM2.2.03.36/tools/pvck.c:2971:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/tools/pvck.c:2976:18: branch_false: ...to here
LVM2.2.03.36/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): [#def718]
LVM2.2.03.36/tools/pvck.c:2903:17: warning[-Wanalyzer-malloc-leak]: leak of ‘text_buf’
LVM2.2.03.36/tools/pvck.c:2944:12: enter_function: entry to ‘_read_metadata_file’
LVM2.2.03.36/tools/pvck.c:2952:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/tools/pvck.c:2957:13: branch_false: ...to here
LVM2.2.03.36/tools/pvck.c:2957:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/tools/pvck.c:2962:37: branch_false: ...to here
LVM2.2.03.36/tools/pvck.c:2962:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/tools/pvck.c:2967:33: branch_false: ...to here
LVM2.2.03.36/tools/pvck.c:2967:26: acquire_memory: allocated here
LVM2.2.03.36/tools/pvck.c:2967:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/tools/pvck.c:2970:14: branch_false: ...to here
LVM2.2.03.36/tools/pvck.c:2971:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/tools/pvck.c:2976:18: branch_false: ...to here
LVM2.2.03.36/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): [#def719]
LVM2.2.03.36/tools/pvck.c:2904:17: warning[-Wanalyzer-malloc-leak]: leak of ‘text_buf’
LVM2.2.03.36/tools/pvck.c:2944:12: enter_function: entry to ‘_read_metadata_file’
LVM2.2.03.36/tools/pvck.c:2952:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/tools/pvck.c:2957:13: branch_false: ...to here
LVM2.2.03.36/tools/pvck.c:2957:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/tools/pvck.c:2962:37: branch_false: ...to here
LVM2.2.03.36/tools/pvck.c:2962:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/tools/pvck.c:2967:33: branch_false: ...to here
LVM2.2.03.36/tools/pvck.c:2967:26: acquire_memory: allocated here
LVM2.2.03.36/tools/pvck.c:2967:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/tools/pvck.c:2970:14: branch_false: ...to here
LVM2.2.03.36/tools/pvck.c:2971:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/tools/pvck.c:2976:18: branch_false: ...to here
LVM2.2.03.36/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): [#def720]
LVM2.2.03.36/tools/pvck.c:2912:17: warning[-Wanalyzer-malloc-leak]: leak of ‘text_buf’
LVM2.2.03.36/tools/pvck.c:2944:12: enter_function: entry to ‘_read_metadata_file’
LVM2.2.03.36/tools/pvck.c:2952:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/tools/pvck.c:2957:13: branch_false: ...to here
LVM2.2.03.36/tools/pvck.c:2957:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/tools/pvck.c:2962:37: branch_false: ...to here
LVM2.2.03.36/tools/pvck.c:2962:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/tools/pvck.c:2967:33: branch_false: ...to here
LVM2.2.03.36/tools/pvck.c:2967:26: acquire_memory: allocated here
LVM2.2.03.36/tools/pvck.c:2967:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/tools/pvck.c:2970:14: branch_false: ...to here
LVM2.2.03.36/tools/pvck.c:2971:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/tools/pvck.c:2976:18: branch_false: ...to here
LVM2.2.03.36/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): [#def721]
LVM2.2.03.36/tools/pvck.c:2913:17: warning[-Wanalyzer-malloc-leak]: leak of ‘text_buf’
LVM2.2.03.36/tools/pvck.c:2944:12: enter_function: entry to ‘_read_metadata_file’
LVM2.2.03.36/tools/pvck.c:2952:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/tools/pvck.c:2957:13: branch_false: ...to here
LVM2.2.03.36/tools/pvck.c:2957:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/tools/pvck.c:2962:37: branch_false: ...to here
LVM2.2.03.36/tools/pvck.c:2962:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/tools/pvck.c:2967:33: branch_false: ...to here
LVM2.2.03.36/tools/pvck.c:2967:26: acquire_memory: allocated here
LVM2.2.03.36/tools/pvck.c:2967:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/tools/pvck.c:2970:14: branch_false: ...to here
LVM2.2.03.36/tools/pvck.c:2971:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/tools/pvck.c:2976:18: branch_false: ...to here
LVM2.2.03.36/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): [#def722]
LVM2.2.03.36/tools/pvck.c:2919:13: warning[-Wanalyzer-out-of-bounds]: heap-based buffer over-read
LVM2.2.03.36/tools/pvck.c:2944:12: enter_function: entry to ‘_read_metadata_file’
LVM2.2.03.36/tools/pvck.c:2952:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/tools/pvck.c:2957:13: branch_false: ...to here
LVM2.2.03.36/tools/pvck.c:2957:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/tools/pvck.c:2962:37: branch_false: ...to here
LVM2.2.03.36/tools/pvck.c:2962:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/tools/pvck.c:2967:33: branch_false: ...to here
LVM2.2.03.36/tools/pvck.c:2967:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/tools/pvck.c:2970:14: branch_false: ...to here
LVM2.2.03.36/tools/pvck.c:2971:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/tools/pvck.c:2976:18: branch_false: ...to here
LVM2.2.03.36/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): [#def723]
LVM2.2.03.36/tools/pvck.c:2920:17: warning[-Wanalyzer-malloc-leak]: leak of ‘text_buf’
LVM2.2.03.36/tools/pvck.c:2944:12: enter_function: entry to ‘_read_metadata_file’
LVM2.2.03.36/tools/pvck.c:2952:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/tools/pvck.c:2957:13: branch_false: ...to here
LVM2.2.03.36/tools/pvck.c:2957:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/tools/pvck.c:2962:37: branch_false: ...to here
LVM2.2.03.36/tools/pvck.c:2962:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/tools/pvck.c:2967:33: branch_false: ...to here
LVM2.2.03.36/tools/pvck.c:2967:26: acquire_memory: allocated here
LVM2.2.03.36/tools/pvck.c:2967:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/tools/pvck.c:2970:14: branch_false: ...to here
LVM2.2.03.36/tools/pvck.c:2971:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/tools/pvck.c:2976:18: branch_false: ...to here
LVM2.2.03.36/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): [#def724]
LVM2.2.03.36/tools/pvck.c:2931:9: warning[-Wanalyzer-malloc-leak]: leak of ‘text_buf’
LVM2.2.03.36/tools/pvck.c:2944:12: enter_function: entry to ‘_read_metadata_file’
LVM2.2.03.36/tools/pvck.c:2952:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/tools/pvck.c:2957:13: branch_false: ...to here
LVM2.2.03.36/tools/pvck.c:2957:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/tools/pvck.c:2962:37: branch_false: ...to here
LVM2.2.03.36/tools/pvck.c:2962:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/tools/pvck.c:2967:33: branch_false: ...to here
LVM2.2.03.36/tools/pvck.c:2967:26: acquire_memory: allocated here
LVM2.2.03.36/tools/pvck.c:2967:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/tools/pvck.c:2970:14: branch_false: ...to here
LVM2.2.03.36/tools/pvck.c:2971:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/tools/pvck.c:2976:18: branch_false: ...to here
LVM2.2.03.36/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): [#def725]
LVM2.2.03.36/tools/pvck.c:2972:17: warning[-Wanalyzer-malloc-leak]: leak of ‘text_buf’
LVM2.2.03.36/tools/pvck.c:2952:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/tools/pvck.c:2957:13: branch_false: ...to here
LVM2.2.03.36/tools/pvck.c:2957:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/tools/pvck.c:2962:37: branch_false: ...to here
LVM2.2.03.36/tools/pvck.c:2962:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/tools/pvck.c:2967:33: branch_false: ...to here
LVM2.2.03.36/tools/pvck.c:2967:26: acquire_memory: allocated here
LVM2.2.03.36/tools/pvck.c:2967:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/tools/pvck.c:2970:14: branch_false: ...to here
LVM2.2.03.36/tools/pvck.c:2971:12: branch_true: following ‘true’ branch...
LVM2.2.03.36/tools/pvck.c:2972:17: branch_true: ...to here
LVM2.2.03.36/tools/pvck.c:2972:17: danger: ‘text_buf’ leaks here; was allocated at [(7)](sarif:/runs/0/results/58/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): [#def726]
LVM2.2.03.36/tools/pvck.c:2978:13: warning[-Wanalyzer-malloc-leak]: leak of ‘text_buf’
LVM2.2.03.36/tools/pvck.c:2952:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/tools/pvck.c:2957:13: branch_false: ...to here
LVM2.2.03.36/tools/pvck.c:2957:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/tools/pvck.c:2962:37: branch_false: ...to here
LVM2.2.03.36/tools/pvck.c:2962:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/tools/pvck.c:2967:33: branch_false: ...to here
LVM2.2.03.36/tools/pvck.c:2967:26: acquire_memory: allocated here
LVM2.2.03.36/tools/pvck.c:2967:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/tools/pvck.c:2970:14: branch_false: ...to here
LVM2.2.03.36/tools/pvck.c:2971:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/tools/pvck.c:2976:18: branch_false: ...to here
LVM2.2.03.36/tools/pvck.c:2978:13: danger: ‘text_buf’ leaks here; was allocated at [(7)](sarif:/runs/0/results/59/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): [#def727]
LVM2.2.03.36/tools/pvck.c:2979:17: warning[-Wanalyzer-malloc-leak]: leak of ‘text_buf’
LVM2.2.03.36/tools/pvck.c:2952:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/tools/pvck.c:2957:13: branch_false: ...to here
LVM2.2.03.36/tools/pvck.c:2957:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/tools/pvck.c:2962:37: branch_false: ...to here
LVM2.2.03.36/tools/pvck.c:2962:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/tools/pvck.c:2967:33: branch_false: ...to here
LVM2.2.03.36/tools/pvck.c:2967:26: acquire_memory: allocated here
LVM2.2.03.36/tools/pvck.c:2967:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/tools/pvck.c:2970:14: branch_false: ...to here
LVM2.2.03.36/tools/pvck.c:2971:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/tools/pvck.c:2976:18: branch_false: ...to here
LVM2.2.03.36/tools/pvck.c:2978:12: branch_true: following ‘true’ branch...
LVM2.2.03.36/tools/pvck.c:2979:17: branch_true: ...to here
LVM2.2.03.36/tools/pvck.c:2979:17: danger: ‘text_buf’ leaks here; was allocated at [(7)](sarif:/runs/0/results/60/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): [#def728]
LVM2.2.03.36/tools/pvscan.c:281:22: warning[-Wanalyzer-malloc-leak]: leak of ‘opendir(dirpath)’
LVM2.2.03.36/tools/pvscan.c:1347:12: enter_function: entry to ‘_pvscan_cache_all’
LVM2.2.03.36/tools/pvscan.c:1358:9: call_function: calling ‘_online_files_remove’ from ‘_pvscan_cache_all’
#  279|   		return;
#  280|   
#  281|-> 	while ((de = readdir(dir))) {
#  282|   		if (de->d_name[0] == '.')
#  283|   			continue;

Error: GCC_ANALYZER_WARNING (CWE-775): [#def729]
LVM2.2.03.36/tools/pvscan.c:346:9: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(&path, "r")’
LVM2.2.03.36/tools/pvscan.c:1009:12: enter_function: entry to ‘_online_devs’
LVM2.2.03.36/tools/pvscan.c:1037:9: branch_true: following ‘true’ branch...
LVM2.2.03.36/tools/pvscan.c:1038:17: branch_true: ...to here
LVM2.2.03.36/tools/pvscan.c:1042:20: branch_false: following ‘false’ branch...
LVM2.2.03.36/tools/pvscan.c:1048:31: branch_false: ...to here
LVM2.2.03.36/tools/pvscan.c:1057:20: branch_false: following ‘false’ branch...
LVM2.2.03.36/tools/pvscan.c:1065:24: branch_false: ...to here
LVM2.2.03.36/tools/pvscan.c:1074:20: branch_true: following ‘true’ branch (when ‘vg’ is NULL)...
LVM2.2.03.36/tools/pvscan.c:1075:25: branch_true: ...to here
LVM2.2.03.36/tools/pvscan.c:1160:20: branch_false: following ‘false’ branch...
LVM2.2.03.36/tools/pvscan.c:1172:20: branch_false: ...to here
LVM2.2.03.36/tools/pvscan.c:1172:20: branch_true: following ‘true’ branch...
LVM2.2.03.36/tools/pvscan.c:1173:25: branch_true: ...to here
LVM2.2.03.36/tools/pvscan.c:1178:28: branch_false: following ‘false’ branch (when ‘vg’ is NULL)...
LVM2.2.03.36/tools/pvscan.c:1221:33: branch_false: ...to here
LVM2.2.03.36/tools/pvscan.c:1222:38: call_function: calling ‘_count_pvid_files_from_lookup_file’ from ‘_online_devs’
#  344|   	char pvid[ID_LEN + 1] __attribute__((aligned(8))) = { 0 };
#  345|   
#  346|-> 	log_debug("checking all pvid files using lookup file for %s", vgname);
#  347|   
#  348|   	errno = 0;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def730]
LVM2.2.03.36/tools/pvscan.c:346:9: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(&path, "r")’
LVM2.2.03.36/tools/pvscan.c:1009:12: enter_function: entry to ‘_online_devs’
LVM2.2.03.36/tools/pvscan.c:1037:9: branch_true: following ‘true’ branch...
LVM2.2.03.36/tools/pvscan.c:1038:17: branch_true: ...to here
LVM2.2.03.36/tools/pvscan.c:1042:20: branch_false: following ‘false’ branch...
LVM2.2.03.36/tools/pvscan.c:1048:31: branch_false: ...to here
LVM2.2.03.36/tools/pvscan.c:1057:20: branch_false: following ‘false’ branch...
LVM2.2.03.36/tools/pvscan.c:1065:24: branch_false: ...to here
LVM2.2.03.36/tools/pvscan.c:1074:20: branch_true: following ‘true’ branch (when ‘vg’ is NULL)...
LVM2.2.03.36/tools/pvscan.c:1075:25: branch_true: ...to here
LVM2.2.03.36/tools/pvscan.c:1160:20: branch_false: following ‘false’ branch...
LVM2.2.03.36/tools/pvscan.c:1172:20: branch_false: ...to here
LVM2.2.03.36/tools/pvscan.c:1172:20: branch_true: following ‘true’ branch...
LVM2.2.03.36/tools/pvscan.c:1173:25: branch_true: ...to here
LVM2.2.03.36/tools/pvscan.c:1178:28: branch_false: following ‘false’ branch (when ‘vg’ is NULL)...
LVM2.2.03.36/tools/pvscan.c:1221:33: branch_false: ...to here
LVM2.2.03.36/tools/pvscan.c:1222:38: call_function: calling ‘_count_pvid_files_from_lookup_file’ from ‘_online_devs’
#  344|   	char pvid[ID_LEN + 1] __attribute__((aligned(8))) = { 0 };
#  345|   
#  346|-> 	log_debug("checking all pvid files using lookup file for %s", vgname);
#  347|   
#  348|   	errno = 0;

Error: GCC_ANALYZER_WARNING (CWE-775): [#def731]
LVM2.2.03.36/tools/pvscan.c:349:9: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(&path, "r")’
LVM2.2.03.36/tools/pvscan.c:1009:12: enter_function: entry to ‘_online_devs’
LVM2.2.03.36/tools/pvscan.c:1037:9: branch_true: following ‘true’ branch...
LVM2.2.03.36/tools/pvscan.c:1038:17: branch_true: ...to here
LVM2.2.03.36/tools/pvscan.c:1042:20: branch_false: following ‘false’ branch...
LVM2.2.03.36/tools/pvscan.c:1048:31: branch_false: ...to here
LVM2.2.03.36/tools/pvscan.c:1057:20: branch_false: following ‘false’ branch...
LVM2.2.03.36/tools/pvscan.c:1065:24: branch_false: ...to here
LVM2.2.03.36/tools/pvscan.c:1074:20: branch_true: following ‘true’ branch (when ‘vg’ is NULL)...
LVM2.2.03.36/tools/pvscan.c:1075:25: branch_true: ...to here
LVM2.2.03.36/tools/pvscan.c:1160:20: branch_false: following ‘false’ branch...
LVM2.2.03.36/tools/pvscan.c:1172:20: branch_false: ...to here
LVM2.2.03.36/tools/pvscan.c:1172:20: branch_true: following ‘true’ branch...
LVM2.2.03.36/tools/pvscan.c:1173:25: branch_true: ...to here
LVM2.2.03.36/tools/pvscan.c:1178:28: branch_false: following ‘false’ branch (when ‘vg’ is NULL)...
LVM2.2.03.36/tools/pvscan.c:1221:33: branch_false: ...to here
LVM2.2.03.36/tools/pvscan.c:1222:38: call_function: calling ‘_count_pvid_files_from_lookup_file’ from ‘_online_devs’
#  347|   
#  348|   	errno = 0;
#  349|-> 	rewind(fp);
#  350|   	if (errno) {
#  351|   		/* trace possible failure from rewind() */

Error: GCC_ANALYZER_WARNING (CWE-401): [#def732]
LVM2.2.03.36/tools/pvscan.c:349:9: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(&path, "r")’
LVM2.2.03.36/tools/pvscan.c:1009:12: enter_function: entry to ‘_online_devs’
LVM2.2.03.36/tools/pvscan.c:1037:9: branch_true: following ‘true’ branch...
LVM2.2.03.36/tools/pvscan.c:1038:17: branch_true: ...to here
LVM2.2.03.36/tools/pvscan.c:1042:20: branch_false: following ‘false’ branch...
LVM2.2.03.36/tools/pvscan.c:1048:31: branch_false: ...to here
LVM2.2.03.36/tools/pvscan.c:1057:20: branch_false: following ‘false’ branch...
LVM2.2.03.36/tools/pvscan.c:1065:24: branch_false: ...to here
LVM2.2.03.36/tools/pvscan.c:1074:20: branch_true: following ‘true’ branch (when ‘vg’ is NULL)...
LVM2.2.03.36/tools/pvscan.c:1075:25: branch_true: ...to here
LVM2.2.03.36/tools/pvscan.c:1160:20: branch_false: following ‘false’ branch...
LVM2.2.03.36/tools/pvscan.c:1172:20: branch_false: ...to here
LVM2.2.03.36/tools/pvscan.c:1172:20: branch_true: following ‘true’ branch...
LVM2.2.03.36/tools/pvscan.c:1173:25: branch_true: ...to here
LVM2.2.03.36/tools/pvscan.c:1178:28: branch_false: following ‘false’ branch (when ‘vg’ is NULL)...
LVM2.2.03.36/tools/pvscan.c:1221:33: branch_false: ...to here
LVM2.2.03.36/tools/pvscan.c:1222:38: call_function: calling ‘_count_pvid_files_from_lookup_file’ from ‘_online_devs’
#  347|   
#  348|   	errno = 0;
#  349|-> 	rewind(fp);
#  350|   	if (errno) {
#  351|   		/* trace possible failure from rewind() */

Error: GCC_ANALYZER_WARNING (CWE-775): [#def733]
LVM2.2.03.36/tools/pvscan.c:359:25: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(&path, "r")’
LVM2.2.03.36/tools/pvscan.c:1009:12: enter_function: entry to ‘_online_devs’
LVM2.2.03.36/tools/pvscan.c:1037:9: branch_true: following ‘true’ branch...
LVM2.2.03.36/tools/pvscan.c:1038:17: branch_true: ...to here
LVM2.2.03.36/tools/pvscan.c:1042:20: branch_false: following ‘false’ branch...
LVM2.2.03.36/tools/pvscan.c:1048:31: branch_false: ...to here
LVM2.2.03.36/tools/pvscan.c:1057:20: branch_false: following ‘false’ branch...
LVM2.2.03.36/tools/pvscan.c:1065:24: branch_false: ...to here
LVM2.2.03.36/tools/pvscan.c:1074:20: branch_true: following ‘true’ branch (when ‘vg’ is NULL)...
LVM2.2.03.36/tools/pvscan.c:1075:25: branch_true: ...to here
LVM2.2.03.36/tools/pvscan.c:1160:20: branch_false: following ‘false’ branch...
LVM2.2.03.36/tools/pvscan.c:1172:20: branch_false: ...to here
LVM2.2.03.36/tools/pvscan.c:1172:20: branch_true: following ‘true’ branch...
LVM2.2.03.36/tools/pvscan.c:1173:25: branch_true: ...to here
LVM2.2.03.36/tools/pvscan.c:1178:28: branch_false: following ‘false’ branch (when ‘vg’ is NULL)...
LVM2.2.03.36/tools/pvscan.c:1221:33: branch_false: ...to here
LVM2.2.03.36/tools/pvscan.c:1222:38: call_function: calling ‘_count_pvid_files_from_lookup_file’ from ‘_online_devs’
#  357|   
#  358|   		if (strlen(pvid) != ID_LEN) {
#  359|-> 			log_debug("ignore lookup file line %s", line);
#  360|   			continue;
#  361|   		}

Error: GCC_ANALYZER_WARNING (CWE-401): [#def734]
LVM2.2.03.36/tools/pvscan.c:359:25: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(&path, "r")’
LVM2.2.03.36/tools/pvscan.c:1009:12: enter_function: entry to ‘_online_devs’
LVM2.2.03.36/tools/pvscan.c:1037:9: branch_true: following ‘true’ branch...
LVM2.2.03.36/tools/pvscan.c:1038:17: branch_true: ...to here
LVM2.2.03.36/tools/pvscan.c:1042:20: branch_false: following ‘false’ branch...
LVM2.2.03.36/tools/pvscan.c:1048:31: branch_false: ...to here
LVM2.2.03.36/tools/pvscan.c:1057:20: branch_false: following ‘false’ branch...
LVM2.2.03.36/tools/pvscan.c:1065:24: branch_false: ...to here
LVM2.2.03.36/tools/pvscan.c:1074:20: branch_true: following ‘true’ branch (when ‘vg’ is NULL)...
LVM2.2.03.36/tools/pvscan.c:1075:25: branch_true: ...to here
LVM2.2.03.36/tools/pvscan.c:1160:20: branch_false: following ‘false’ branch...
LVM2.2.03.36/tools/pvscan.c:1172:20: branch_false: ...to here
LVM2.2.03.36/tools/pvscan.c:1172:20: branch_true: following ‘true’ branch...
LVM2.2.03.36/tools/pvscan.c:1173:25: branch_true: ...to here
LVM2.2.03.36/tools/pvscan.c:1178:28: branch_false: following ‘false’ branch (when ‘vg’ is NULL)...
LVM2.2.03.36/tools/pvscan.c:1221:33: branch_false: ...to here
LVM2.2.03.36/tools/pvscan.c:1222:38: call_function: calling ‘_count_pvid_files_from_lookup_file’ from ‘_online_devs’
#  357|   
#  358|   		if (strlen(pvid) != ID_LEN) {
#  359|-> 			log_debug("ignore lookup file line %s", line);
#  360|   			continue;
#  361|   		}

Error: GCC_ANALYZER_WARNING (CWE-775): [#def735]
LVM2.2.03.36/tools/pvscan.c:363:21: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(&path, "r")’
LVM2.2.03.36/tools/pvscan.c:1009:12: enter_function: entry to ‘_online_devs’
LVM2.2.03.36/tools/pvscan.c:1037:9: branch_true: following ‘true’ branch...
LVM2.2.03.36/tools/pvscan.c:1038:17: branch_true: ...to here
LVM2.2.03.36/tools/pvscan.c:1042:20: branch_false: following ‘false’ branch...
LVM2.2.03.36/tools/pvscan.c:1048:31: branch_false: ...to here
LVM2.2.03.36/tools/pvscan.c:1057:20: branch_false: following ‘false’ branch...
LVM2.2.03.36/tools/pvscan.c:1065:24: branch_false: ...to here
LVM2.2.03.36/tools/pvscan.c:1074:20: branch_true: following ‘true’ branch (when ‘vg’ is NULL)...
LVM2.2.03.36/tools/pvscan.c:1075:25: branch_true: ...to here
LVM2.2.03.36/tools/pvscan.c:1160:20: branch_false: following ‘false’ branch...
LVM2.2.03.36/tools/pvscan.c:1172:20: branch_false: ...to here
LVM2.2.03.36/tools/pvscan.c:1172:20: branch_true: following ‘true’ branch...
LVM2.2.03.36/tools/pvscan.c:1173:25: branch_true: ...to here
LVM2.2.03.36/tools/pvscan.c:1178:28: branch_false: following ‘false’ branch (when ‘vg’ is NULL)...
LVM2.2.03.36/tools/pvscan.c:1221:33: branch_false: ...to here
LVM2.2.03.36/tools/pvscan.c:1222:38: call_function: calling ‘_count_pvid_files_from_lookup_file’ from ‘_online_devs’
#  361|   		}
#  362|   
#  363|-> 		if (online_pvid_file_exists((const char *)pvid))
#  364|   			(*pvs_online)++;
#  365|   		else

Error: GCC_ANALYZER_WARNING (CWE-401): [#def736]
LVM2.2.03.36/tools/pvscan.c:363:21: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(&path, "r")’
LVM2.2.03.36/tools/pvscan.c:1009:12: enter_function: entry to ‘_online_devs’
LVM2.2.03.36/tools/pvscan.c:1037:9: branch_true: following ‘true’ branch...
LVM2.2.03.36/tools/pvscan.c:1038:17: branch_true: ...to here
LVM2.2.03.36/tools/pvscan.c:1042:20: branch_false: following ‘false’ branch...
LVM2.2.03.36/tools/pvscan.c:1048:31: branch_false: ...to here
LVM2.2.03.36/tools/pvscan.c:1057:20: branch_false: following ‘false’ branch...
LVM2.2.03.36/tools/pvscan.c:1065:24: branch_false: ...to here
LVM2.2.03.36/tools/pvscan.c:1074:20: branch_true: following ‘true’ branch (when ‘vg’ is NULL)...
LVM2.2.03.36/tools/pvscan.c:1075:25: branch_true: ...to here
LVM2.2.03.36/tools/pvscan.c:1160:20: branch_false: following ‘false’ branch...
LVM2.2.03.36/tools/pvscan.c:1172:20: branch_false: ...to here
LVM2.2.03.36/tools/pvscan.c:1172:20: branch_true: following ‘true’ branch...
LVM2.2.03.36/tools/pvscan.c:1173:25: branch_true: ...to here
LVM2.2.03.36/tools/pvscan.c:1178:28: branch_false: following ‘false’ branch (when ‘vg’ is NULL)...
LVM2.2.03.36/tools/pvscan.c:1221:33: branch_false: ...to here
LVM2.2.03.36/tools/pvscan.c:1222:38: call_function: calling ‘_count_pvid_files_from_lookup_file’ from ‘_online_devs’
#  361|   		}
#  362|   
#  363|-> 		if (online_pvid_file_exists((const char *)pvid))
#  364|   			(*pvs_online)++;
#  365|   		else

Error: GCC_ANALYZER_WARNING (CWE-401): [#def737]
LVM2.2.03.36/tools/pvscan.c:433:33: warning[-Wanalyzer-malloc-leak]: leak of ‘opendir("/run/lvm/pvs_lookup")’
LVM2.2.03.36/tools/pvscan.c:1009:12: enter_function: entry to ‘_online_devs’
LVM2.2.03.36/tools/pvscan.c:1037:9: branch_true: following ‘true’ branch...
LVM2.2.03.36/tools/pvscan.c:1038:17: branch_true: ...to here
LVM2.2.03.36/tools/pvscan.c:1042:20: branch_false: following ‘false’ branch...
LVM2.2.03.36/tools/pvscan.c:1048:31: branch_false: ...to here
LVM2.2.03.36/tools/pvscan.c:1057:20: branch_false: following ‘false’ branch...
LVM2.2.03.36/tools/pvscan.c:1065:24: branch_false: ...to here
LVM2.2.03.36/tools/pvscan.c:1074:20: branch_true: following ‘true’ branch (when ‘vg’ is NULL)...
LVM2.2.03.36/tools/pvscan.c:1075:25: branch_true: ...to here
LVM2.2.03.36/tools/pvscan.c:1160:20: branch_false: following ‘false’ branch...
LVM2.2.03.36/tools/pvscan.c:1172:20: branch_false: ...to here
LVM2.2.03.36/tools/pvscan.c:1172:20: branch_true: following ‘true’ branch...
LVM2.2.03.36/tools/pvscan.c:1173:25: branch_true: ...to here
LVM2.2.03.36/tools/pvscan.c:1178:28: branch_false: following ‘false’ branch (when ‘vg’ is NULL)...
LVM2.2.03.36/tools/pvscan.c:1221:33: branch_false: ...to here
LVM2.2.03.36/tools/pvscan.c:1222:38: call_function: calling ‘_count_pvid_files_from_lookup_file’ from ‘_online_devs’
#  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): [#def738]
LVM2.2.03.36/tools/pvscan.c:448:39: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(&path, "r")’
LVM2.2.03.36/tools/pvscan.c:1009:12: enter_function: entry to ‘_online_devs’
LVM2.2.03.36/tools/pvscan.c:1037:9: branch_true: following ‘true’ branch...
LVM2.2.03.36/tools/pvscan.c:1038:17: branch_true: ...to here
LVM2.2.03.36/tools/pvscan.c:1042:20: branch_false: following ‘false’ branch...
LVM2.2.03.36/tools/pvscan.c:1048:31: branch_false: ...to here
LVM2.2.03.36/tools/pvscan.c:1057:20: branch_false: following ‘false’ branch...
LVM2.2.03.36/tools/pvscan.c:1065:24: branch_false: ...to here
LVM2.2.03.36/tools/pvscan.c:1074:20: branch_true: following ‘true’ branch (when ‘vg’ is NULL)...
LVM2.2.03.36/tools/pvscan.c:1075:25: branch_true: ...to here
LVM2.2.03.36/tools/pvscan.c:1160:20: branch_false: following ‘false’ branch...
LVM2.2.03.36/tools/pvscan.c:1172:20: branch_false: ...to here
LVM2.2.03.36/tools/pvscan.c:1172:20: branch_true: following ‘true’ branch...
LVM2.2.03.36/tools/pvscan.c:1173:25: branch_true: ...to here
LVM2.2.03.36/tools/pvscan.c:1178:28: branch_false: following ‘false’ branch (when ‘vg’ is NULL)...
LVM2.2.03.36/tools/pvscan.c:1221:33: branch_false: ...to here
LVM2.2.03.36/tools/pvscan.c:1222:38: call_function: calling ‘_count_pvid_files_from_lookup_file’ from ‘_online_devs’
#  446|   
#  447|   		if (_lookup_file_contains_pvid(fp, dev->pvid)) {
#  448|-> 			if ((vgname = dm_pool_strdup(cmd->mem, de->d_name)))
#  449|   				/*
#  450|   				 * stat pvid online file of each pvid listed in this file

Error: GCC_ANALYZER_WARNING (CWE-401): [#def739]
LVM2.2.03.36/tools/pvscan.c:448:39: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(&path, "r")’
LVM2.2.03.36/tools/pvscan.c:1009:12: enter_function: entry to ‘_online_devs’
LVM2.2.03.36/tools/pvscan.c:1037:9: branch_true: following ‘true’ branch...
LVM2.2.03.36/tools/pvscan.c:1038:17: branch_true: ...to here
LVM2.2.03.36/tools/pvscan.c:1042:20: branch_false: following ‘false’ branch...
LVM2.2.03.36/tools/pvscan.c:1048:31: branch_false: ...to here
LVM2.2.03.36/tools/pvscan.c:1057:20: branch_false: following ‘false’ branch...
LVM2.2.03.36/tools/pvscan.c:1065:24: branch_false: ...to here
LVM2.2.03.36/tools/pvscan.c:1074:20: branch_true: following ‘true’ branch (when ‘vg’ is NULL)...
LVM2.2.03.36/tools/pvscan.c:1075:25: branch_true: ...to here
LVM2.2.03.36/tools/pvscan.c:1160:20: branch_false: following ‘false’ branch...
LVM2.2.03.36/tools/pvscan.c:1172:20: branch_false: ...to here
LVM2.2.03.36/tools/pvscan.c:1172:20: branch_true: following ‘true’ branch...
LVM2.2.03.36/tools/pvscan.c:1173:25: branch_true: ...to here
LVM2.2.03.36/tools/pvscan.c:1178:28: branch_false: following ‘false’ branch (when ‘vg’ is NULL)...
LVM2.2.03.36/tools/pvscan.c:1221:33: branch_false: ...to here
LVM2.2.03.36/tools/pvscan.c:1222:38: call_function: calling ‘_count_pvid_files_from_lookup_file’ from ‘_online_devs’
#  446|   
#  447|   		if (_lookup_file_contains_pvid(fp, dev->pvid)) {
#  448|-> 			if ((vgname = dm_pool_strdup(cmd->mem, de->d_name)))
#  449|   				/*
#  450|   				 * stat pvid online file of each pvid listed in this file

Error: GCC_ANALYZER_WARNING (CWE-775): [#def740]
LVM2.2.03.36/tools/pvscan.c:456:33: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(&path, "r")’
LVM2.2.03.36/tools/pvscan.c:1009:12: enter_function: entry to ‘_online_devs’
LVM2.2.03.36/tools/pvscan.c:1037:9: branch_true: following ‘true’ branch...
LVM2.2.03.36/tools/pvscan.c:1038:17: branch_true: ...to here
LVM2.2.03.36/tools/pvscan.c:1042:20: branch_false: following ‘false’ branch...
LVM2.2.03.36/tools/pvscan.c:1048:31: branch_false: ...to here
LVM2.2.03.36/tools/pvscan.c:1057:20: branch_false: following ‘false’ branch...
LVM2.2.03.36/tools/pvscan.c:1065:24: branch_false: ...to here
LVM2.2.03.36/tools/pvscan.c:1074:20: branch_true: following ‘true’ branch (when ‘vg’ is NULL)...
LVM2.2.03.36/tools/pvscan.c:1075:25: branch_true: ...to here
LVM2.2.03.36/tools/pvscan.c:1160:20: branch_false: following ‘false’ branch...
LVM2.2.03.36/tools/pvscan.c:1172:20: branch_false: ...to here
LVM2.2.03.36/tools/pvscan.c:1172:20: branch_true: following ‘true’ branch...
LVM2.2.03.36/tools/pvscan.c:1173:25: branch_true: ...to here
LVM2.2.03.36/tools/pvscan.c:1178:28: branch_false: following ‘false’ branch (when ‘vg’ is NULL)...
LVM2.2.03.36/tools/pvscan.c:1221:33: branch_false: ...to here
LVM2.2.03.36/tools/pvscan.c:1222:38: call_function: calling ‘_count_pvid_files_from_lookup_file’ from ‘_online_devs’
#  454|   				_lookup_file_count_pvid_files(fp, vgname, pvs_online, pvs_offline);
#  455|   			else
#  456|-> 				log_warn("WARNING: Failed to strdup vgname.");
#  457|   		}
#  458|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def741]
LVM2.2.03.36/tools/pvscan.c:456:33: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(&path, "r")’
LVM2.2.03.36/tools/pvscan.c:1009:12: enter_function: entry to ‘_online_devs’
LVM2.2.03.36/tools/pvscan.c:1037:9: branch_true: following ‘true’ branch...
LVM2.2.03.36/tools/pvscan.c:1038:17: branch_true: ...to here
LVM2.2.03.36/tools/pvscan.c:1042:20: branch_false: following ‘false’ branch...
LVM2.2.03.36/tools/pvscan.c:1048:31: branch_false: ...to here
LVM2.2.03.36/tools/pvscan.c:1057:20: branch_false: following ‘false’ branch...
LVM2.2.03.36/tools/pvscan.c:1065:24: branch_false: ...to here
LVM2.2.03.36/tools/pvscan.c:1074:20: branch_true: following ‘true’ branch (when ‘vg’ is NULL)...
LVM2.2.03.36/tools/pvscan.c:1075:25: branch_true: ...to here
LVM2.2.03.36/tools/pvscan.c:1160:20: branch_false: following ‘false’ branch...
LVM2.2.03.36/tools/pvscan.c:1172:20: branch_false: ...to here
LVM2.2.03.36/tools/pvscan.c:1172:20: branch_true: following ‘true’ branch...
LVM2.2.03.36/tools/pvscan.c:1173:25: branch_true: ...to here
LVM2.2.03.36/tools/pvscan.c:1178:28: branch_false: following ‘false’ branch (when ‘vg’ is NULL)...
LVM2.2.03.36/tools/pvscan.c:1221:33: branch_false: ...to here
LVM2.2.03.36/tools/pvscan.c:1222:38: call_function: calling ‘_count_pvid_files_from_lookup_file’ from ‘_online_devs’
#  454|   				_lookup_file_count_pvid_files(fp, vgname, pvs_online, pvs_offline);
#  455|   			else
#  456|-> 				log_warn("WARNING: Failed to strdup vgname.");
#  457|   		}
#  458|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def742]
LVM2.2.03.36/tools/toollib.c:1855:41: warning[-Wanalyzer-malloc-leak]: leak of ‘devl’
LVM2.2.03.36/tools/toollib.c:1827:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/tools/toollib.c:1832:12: branch_false: ...to here
LVM2.2.03.36/tools/toollib.c:1832:12: branch_true: following ‘true’ branch (when ‘argc != 0’)...
 branch_true: ...to here
LVM2.2.03.36/tools/toollib.c:1833:24: branch_true: following ‘true’ branch (when ‘opt < argc’)...
LVM2.2.03.36/tools/toollib.c:1834:29: branch_true: ...to here
LVM2.2.03.36/tools/toollib.c:1834:28: branch_false: following ‘false’ branch...
LVM2.2.03.36/tools/toollib.c:1840:37: branch_false: ...to here
LVM2.2.03.36/tools/toollib.c:1840:28: branch_false: following ‘false’ branch...
LVM2.2.03.36/tools/toollib.c:1847:39: branch_false: ...to here
LVM2.2.03.36/tools/toollib.c:1847:28: branch_true: following ‘true’ branch...
LVM2.2.03.36/tools/toollib.c:1848:38: branch_true: ...to here
LVM2.2.03.36/tools/toollib.c:1848:36: branch_true: following ‘true’ branch...
LVM2.2.03.36/tools/toollib.c:1852:54: branch_true: ...to here
LVM2.2.03.36/tools/toollib.c:1852:54: acquire_memory: allocated here
LVM2.2.03.36/tools/toollib.c:1852:44: branch_false: following ‘false’ branch (when ‘devl’ is non-NULL)...
LVM2.2.03.36/tools/toollib.c:1854:41: branch_false: ...to here
LVM2.2.03.36/tools/toollib.c:1855:41: danger: ‘devl’ leaks here; was allocated at [(15)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/14)
# 1853|   						return_0;
# 1854|   					devl->dev = dev;
# 1855|-> 					dm_list_add(&process_duplicates, &devl->list);
# 1856|   				}
# 1857|   				continue;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def743]
LVM2.2.03.36/tools/vgcfgbackup.c:37:13: warning[-Wanalyzer-malloc-leak]: leak of ‘filename’
LVM2.2.03.36/tools/vgcfgbackup.c:23:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/tools/vgcfgbackup.c:31:26: branch_false: ...to here
LVM2.2.03.36/tools/vgcfgbackup.c:31:26: acquire_memory: allocated here
LVM2.2.03.36/tools/vgcfgbackup.c:31:12: branch_false: following ‘false’ branch (when ‘filename’ is non-NULL)...
LVM2.2.03.36/tools/vgcfgbackup.c:37:13: branch_false: ...to here
LVM2.2.03.36/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): [#def744]
LVM2.2.03.36/tools/vgimportclone.c:192:17: warning[-Wanalyzer-malloc-leak]: leak of ‘calloc(1, 24)’
LVM2.2.03.36/tools/vgimportclone.c:174:12: enter_function: entry to ‘_get_other_devs’
LVM2.2.03.36/tools/vgimportclone.c:181:12: branch_false: following ‘false’ branch...
 branch_false: ...to here
LVM2.2.03.36/tools/vgimportclone.c:184:16: branch_true: following ‘true’ branch...
LVM2.2.03.36/tools/vgimportclone.c:185:21: branch_true: ...to here
LVM2.2.03.36/tools/vgimportclone.c:185:20: branch_false: following ‘false’ branch...
LVM2.2.03.36/tools/vgimportclone.c:187:30: call_function: inlined call to ‘zalloc’ from ‘_get_other_devs’
LVM2.2.03.36/tools/vgimportclone.c:187:20: branch_false: following ‘false’ branch...
LVM2.2.03.36/tools/vgimportclone.c:191:17: branch_false: ...to here
LVM2.2.03.36/tools/vgimportclone.c:192:17: danger: ‘calloc(1, 24)’ leaks here; was allocated at [(9)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/8)
#  190|   		}
#  191|   		devl->dev = dev;
#  192|-> 		dm_list_add(other_devs, &devl->list);
#  193|   	}
#  194|   bad:

Error: GCC_ANALYZER_WARNING (CWE-401): [#def745]
LVM2.2.03.36/tools/vgimportclone.c:275:17: warning[-Wanalyzer-malloc-leak]: leak of ‘calloc(1, 24)’
LVM2.2.03.36/tools/vgimportclone.c:199:5: enter_function: entry to ‘vgimportclone’
LVM2.2.03.36/tools/vgimportclone.c:227:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/tools/vgimportclone.c:230:9: branch_false: ...to here
LVM2.2.03.36/tools/vgimportclone.c:234:12: branch_false: following ‘false’ branch...
LVM2.2.03.36/tools/vgimportclone.c:244:13: branch_false: ...to here
LVM2.2.03.36/tools/vgimportclone.c:264:21: branch_true: following ‘true’ branch (when ‘i < argc’)...
LVM2.2.03.36/tools/vgimportclone.c:265:29: branch_true: ...to here
LVM2.2.03.36/tools/vgimportclone.c:265:20: branch_false: following ‘false’ branch...
LVM2.2.03.36/tools/vgimportclone.c:271:30: call_function: inlined call to ‘zalloc’ from ‘vgimportclone’
LVM2.2.03.36/tools/vgimportclone.c:271:20: branch_false: following ‘false’ branch...
LVM2.2.03.36/tools/vgimportclone.c:274:17: branch_false: ...to here
LVM2.2.03.36/tools/vgimportclone.c:275:17: danger: ‘calloc(1, 24)’ leaks here; was allocated at [(11)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/10)
#  273|   
#  274|   		devl->dev = dev;
#  275|-> 		dm_list_add(&vp.new_devs, &devl->list);
#  276|   	}
#  277|   

Scan Properties

analyzer-version-clippy1.90.0
analyzer-version-cppcheck2.18.3
analyzer-version-gcc15.2.1
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-43.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-gcc-latest-x86_64
project-namelvm2-2.03.36-1.fc44
store-results-to/tmp/tmpbfyfzxzt/lvm2-2.03.36-1.fc44.tar.xz
time-created2025-10-28 19:27:03
time-finished2025-10-28 19:31:16
toolcsmock
tool-args'/usr/bin/csmock' '-r' 'fedora-rawhide-gcc-latest-x86_64' '-t' 'gcc,cppcheck,shellcheck,clippy,unicontrol' '-o' '/tmp/tmpbfyfzxzt/lvm2-2.03.36-1.fc44.tar.xz' '--gcc-analyze' '--unicontrol-notests' '--unicontrol-bidi-only' '--install' 'pam' '--install=gcc-latest' '--gcc-analyzer-bin=/opt/gcc-latest/bin/gcc' '/tmp/tmpbfyfzxzt/lvm2-2.03.36-1.fc44.src.rpm'
tool-versioncsmock-3.8.3.20251027.143044.ge6b947b-1.el9