fcoe-utils-1.0.34-13.gitb233050.fc44

List of Findings

Error: SHELLCHECK_WARNING (CWE-252): [#def1]
/usr/libexec/fcoe/fcc.sh:70:3: warning[SC2164]: Use 'cd ... || exit' or 'cd ... || return' in case cd fails.
#   68|   	printf "\n$x Statistics:\n"
#   69|   	(
#   70|-> 		cd $fdir/$x/statistics
#   71|   		for y in *
#   72|   		do

Error: SHELLCHECK_WARNING (CWE-571): [#def2]
/usr/libexec/fcoe/fcc.sh:166:8: warning[SC2155]: Declare and assign separately to avoid masking return values.
#  164|   	host=`echo $hba | sed -e 's/host//'`
#  165|   
#  166|-> 	local luns=`(cd $ddir &&
#  167|   		 ls -d $host:* | sort -n -t: -k1 -k2 -k3 -k4) 2>/dev/null`
#  168|   

Error: SHELLCHECK_WARNING (CWE-252): [#def3]
/usr/libexec/fcoe/fcc.sh:186:4: warning[SC2164]: Use 'cd ... || exit' or 'cd ... || return' in case cd fails.
#  184|   			cap=-
#  185|   
#  186|-> 			cd $ddir/$lun/device
#  187|   			if [ -d block ]
#  188|   			then

Error: SHELLCHECK_WARNING (CWE-477): [#def4]
/usr/libexec/fcoe/fcc.sh:207:24: warning[SC2166]: Prefer [ p ] || [ q ] as [ p -o q ] is not well defined.
#  205|   				dev="`ls -d block:* char:* 2>/dev/null |
#  206|   					sed -e 's/.*\://'`"
#  207|-> 				if [ -L block:$dev -o -d block:$dev ]
#  208|   				then
#  209|   					size=`cat block:$dev/size`

Error: SHELLCHECK_WARNING (CWE-252): [#def5]
/usr/libexec/fcoe/fcc.sh:268:4: warning[SC2164]: Use 'cd ... || exit' or 'cd ... || return' in case cd fails.
#  266|   	do
#  267|   		(
#  268|-> 			cd $fdir/$x
#  269|   			printf "$fmt" "$x" \
#  270|   				"`fmt_hex $fdir/$x/port_name`" \

Error: SHELLCHECK_WARNING (CWE-571): [#def6]
/usr/libexec/fcoe/fcc.sh:279:8: warning[SC2155]: Declare and assign separately to avoid masking return values.
#  277|   
#  278|   hba_info() {
#  279|-> 	local x=`hba_name $1`
#  280|   	local fmt="\t%-20s %s\n"
#  281|   

Error: SHELLCHECK_WARNING (CWE-252): [#def7]
/usr/libexec/fcoe/fcc.sh:285:3: warning[SC2164]: Use 'cd ... || exit' or 'cd ... || return' in case cd fails.
#  283|   	printf "\n$x Info:\n"
#  284|   	(
#  285|-> 		cd $fdir/$x
#  286|   
#  287|   		printf "$fmt" "Symbolic Name" "`cat symbolic_name`"

Error: SHELLCHECK_WARNING (CWE-252): [#def8]
/usr/libexec/fcoe/fcc.sh:312:4: warning[SC2164]: Use 'cd ... || exit' or 'cd ... || return' in case cd fails.
#  310|   	do
#  311|   		(
#  312|-> 			cd $fdir/$x
#  313|   			dev="`cat $sdir/$x/proc_name``cat $sdir/$x/unique_id`"
#  314|   			printf "$fmt" "$x" "$dev" \

Error: SHELLCHECK_WARNING (CWE-477): [#def9]
/usr/libexec/fcoe/fcc.sh:456:18: warning[SC2166]: Prefer [ p ] && [ q ] as [ p -a q ] is not well defined.
#  454|   	then
#  455|   		hba_spec=n
#  456|-> 	elif [ $# -eq 1 -a "$1" = all ]
#  457|   	then
#  458|   		hba_spec=y

Error: SHELLCHECK_WARNING (CWE-569): [#def10]
/usr/libexec/fcoe/fcc.sh:461:8: warning[SC2124]: Assigning an array to a string! Assign as array, or use * instead of @ to concatenate.
#  459|   	else
#  460|   		hba_spec=y
#  461|-> 		hbas="$@"
#  462|   		scsi_hbas="$@"
#  463|   	fi

Error: SHELLCHECK_WARNING (CWE-569): [#def11]
/usr/libexec/fcoe/fcc.sh:462:13: warning[SC2124]: Assigning an array to a string! Assign as array, or use * instead of @ to concatenate.
#  460|   		hba_spec=y
#  461|   		hbas="$@"
#  462|-> 		scsi_hbas="$@"
#  463|   	fi
#  464|   fi

Error: SHELLCHECK_WARNING (CWE-563): [#def12]
/usr/libexec/fcoe/fcoe-setup.sh:12:58: warning[SC2034]: s1 appears unused. Verify use (or export if used externally).
#   10|       local vlan=$2
#   11|   
#   12|->     cat /proc/net/vlan/config | tail +3 | while read vif s1 vid s2 if ; do
#   13|   	if [ "$if" = "$ifname" ] && [ "$vid" == "$vlan" ] ; then
#   14|   	    echo "$vif"

Error: SHELLCHECK_WARNING (CWE-563): [#def13]
/usr/libexec/fcoe/fcoe-setup.sh:12:65: warning[SC2034]: s2 appears unused. Verify use (or export if used externally).
#   10|       local vlan=$2
#   11|   
#   12|->     cat /proc/net/vlan/config | tail +3 | while read vif s1 vid s2 if ; do
#   13|   	if [ "$if" = "$ifname" ] && [ "$vid" == "$vlan" ] ; then
#   14|   	    echo "$vif"

Error: SHELLCHECK_WARNING (CWE-783): [#def14]
/usr/libexec/fcoe/fcoedump.sh:176:16: warning[SC2069]: To redirect stdout+stderr, 2>&1 must be last (or use '{ cmd > file; } 2>&1' to clarify).
#  174|   	service lldpad status
#  175|   
#  176|-> 	which dcbtool 2>&1 > /dev/null
#  177|   	[ $? -eq 0 ] && dcbtool_info
#  178|   

Error: SHELLCHECK_WARNING (CWE-783): [#def15]
/usr/libexec/fcoe/fcoedump.sh:179:17: warning[SC2069]: To redirect stdout+stderr, 2>&1 must be last (or use '{ cmd > file; } 2>&1' to clarify).
#  177|   	[ $? -eq 0 ] && dcbtool_info
#  178|   
#  179|-> 	which lldptool 2>&1 > /dev/null
#  180|   	[ $? -eq 0 ] && lldptool_info
#  181|   }

Error: SHELLCHECK_WARNING (CWE-156): [#def16]
/usr/libexec/fcoe/fcoedump.sh:207:11: warning[SC2046]: Quote this to prevent word splitting.
#  205|   	# to the log file that we will capture later in
#  206|   	# this script.
#  207|-> 	kill -10 `pidof fcoemon`
#  208|   }
#  209|   

Error: GCC_ANALYZER_WARNING (CWE-775): [#def17]
fcoe-utils-b233050792cc5fa54ba1da257706ca2b5ef3c987/fcoeadm.c:154:13: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘*clif_info.socket_fd’
fcoe-utils-b233050792cc5fa54ba1da257706ca2b5ef3c987/fcoeadm.c:144:12: branch_false: following ‘false’ branch...
fcoe-utils-b233050792cc5fa54ba1da257706ca2b5ef3c987/fcoeadm.c:147:9: branch_false: ...to here
fcoe-utils-b233050792cc5fa54ba1da257706ca2b5ef3c987/fcoeadm.c:154:13: danger: ‘*clif_info.socket_fd’ leaks here
#  152|   		 "%s/%lu", CLIF_IFNAME, (unsigned long int)getpid);
#  153|   	addrlen = sizeof(sa_family_t) + strlen(lp->sun_path + 1) + 1;
#  154|-> 	if (bind(clif_info->socket_fd, (struct sockaddr *)lp, addrlen) < 0) {
#  155|   		rc = ENOMONCONN;
#  156|   		goto err_close;

Error: GCC_ANALYZER_WARNING (CWE-775): [#def18]
fcoe-utils-b233050792cc5fa54ba1da257706ca2b5ef3c987/fcoeadm.c:159:9: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘*clif_info.socket_fd’
fcoe-utils-b233050792cc5fa54ba1da257706ca2b5ef3c987/fcoeadm.c:144:12: branch_false: following ‘false’ branch...
fcoe-utils-b233050792cc5fa54ba1da257706ca2b5ef3c987/fcoeadm.c:147:9: branch_false: ...to here
fcoe-utils-b233050792cc5fa54ba1da257706ca2b5ef3c987/fcoeadm.c:154:12: branch_false: following ‘false’ branch...
fcoe-utils-b233050792cc5fa54ba1da257706ca2b5ef3c987/fcoeadm.c:159:9: branch_false: ...to here
fcoe-utils-b233050792cc5fa54ba1da257706ca2b5ef3c987/fcoeadm.c:159:9: danger: ‘*clif_info.socket_fd’ leaks here
#  157|   	}
#  158|   
#  159|-> 	clif_info->dest.sun_family = AF_LOCAL;
#  160|   	clif_info->dest.sun_path[0] = '\0';
#  161|   	snprintf(&clif_info->dest.sun_path[1],

Error: GCC_ANALYZER_WARNING (CWE-775): [#def19]
fcoe-utils-b233050792cc5fa54ba1da257706ca2b5ef3c987/fcoeadm.c:159:9: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘clif_info.socket_fd’
fcoe-utils-b233050792cc5fa54ba1da257706ca2b5ef3c987/fcoeadm.c:182:1: enter_function: entry to ‘fcoeadm_action’
fcoe-utils-b233050792cc5fa54ba1da257706ca2b5ef3c987/fcoeadm.c:196:14: call_function: calling ‘fcoeadm_open_cli’ from ‘fcoeadm_action’
#  157|   	}
#  158|   
#  159|-> 	clif_info->dest.sun_family = AF_LOCAL;
#  160|   	clif_info->dest.sun_path[0] = '\0';
#  161|   	snprintf(&clif_info->dest.sun_path[1],

Error: GCC_ANALYZER_WARNING (CWE-775): [#def20]
fcoe-utils-b233050792cc5fa54ba1da257706ca2b5ef3c987/fcoeadm.c:165:13: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘*clif_info.socket_fd’
fcoe-utils-b233050792cc5fa54ba1da257706ca2b5ef3c987/fcoeadm.c:144:12: branch_false: following ‘false’ branch...
fcoe-utils-b233050792cc5fa54ba1da257706ca2b5ef3c987/fcoeadm.c:147:9: branch_false: ...to here
fcoe-utils-b233050792cc5fa54ba1da257706ca2b5ef3c987/fcoeadm.c:154:12: branch_false: following ‘false’ branch...
fcoe-utils-b233050792cc5fa54ba1da257706ca2b5ef3c987/fcoeadm.c:159:9: branch_false: ...to here
fcoe-utils-b233050792cc5fa54ba1da257706ca2b5ef3c987/fcoeadm.c:165:13: danger: ‘*clif_info.socket_fd’ leaks here
#  163|   		 "%s", CLIF_IFNAME);
#  164|   	addrlen = sizeof(sa_family_t) + strlen(clif_info->dest.sun_path + 1) + 1;
#  165|-> 	if (connect(clif_info->socket_fd, (struct sockaddr *)&clif_info->dest,
#  166|   		    addrlen) < 0) {
#  167|   		rc = ENOMONCONN;

Error: GCC_ANALYZER_WARNING (CWE-775): [#def21]
fcoe-utils-b233050792cc5fa54ba1da257706ca2b5ef3c987/fcoeadm.c:174:9: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘clif_info.socket_fd’
fcoe-utils-b233050792cc5fa54ba1da257706ca2b5ef3c987/fcoeadm.c:182:1: enter_function: entry to ‘fcoeadm_action’
fcoe-utils-b233050792cc5fa54ba1da257706ca2b5ef3c987/fcoeadm.c:196:14: call_function: calling ‘fcoeadm_open_cli’ from ‘fcoeadm_action’
#  172|   
#  173|   err_close:
#  174|-> 	close(clif_info->socket_fd);
#  175|   	return rc;
#  176|   }

Error: GCC_ANALYZER_WARNING (CWE-401): [#def22]
fcoe-utils-b233050792cc5fa54ba1da257706ca2b5ef3c987/fcoeadm_display.c:199:22: warning[-Wanalyzer-malloc-leak]: leak of ‘opendir(dir_name)’
fcoe-utils-b233050792cc5fa54ba1da257706ca2b5ef3c987/fcoeadm_display.c:423:13: enter_function: entry to ‘search_rport_targets’
fcoe-utils-b233050792cc5fa54ba1da257706ca2b5ef3c987/fcoeadm_display.c:428:9: call_function: calling ‘sa_dir_crawl’ from ‘search_rport_targets’
#  197|   		return;
#  198|   
#  199|-> 	while ((dp = readdir(dir)) != NULL) {
#  200|   		if (dp->d_name[0] == '.' && (dp->d_name[1] == '\0' ||
#  201|   		   (dp->d_name[1] == '.' && dp->d_name[2] == '\0')))

Error: GCC_ANALYZER_WARNING (CWE-401): [#def23]
fcoe-utils-b233050792cc5fa54ba1da257706ca2b5ef3c987/fcoeadm_display.c:287:22: warning[-Wanalyzer-malloc-leak]: leak of ‘opendir(&path)’
fcoe-utils-b233050792cc5fa54ba1da257706ca2b5ef3c987/fcoeadm_display.c:423:13: enter_function: entry to ‘search_rport_targets’
fcoe-utils-b233050792cc5fa54ba1da257706ca2b5ef3c987/fcoeadm_display.c:428:9: call_function: calling ‘sa_dir_crawl’ from ‘search_rport_targets’
#  285|   		goto free_port;
#  286|   
#  287|-> 	while ((dp = readdir(dir)) != NULL) {
#  288|   		if (dp->d_name[0] == '.' && (dp->d_name[1] == '\0' ||
#  289|   		   (dp->d_name[1] == '.' && dp->d_name[2] == '\0')))

Error: GCC_ANALYZER_WARNING (CWE-401): [#def24]
fcoe-utils-b233050792cc5fa54ba1da257706ca2b5ef3c987/fcoeadm_display.c:370:22: warning[-Wanalyzer-malloc-leak]: leak of ‘opendir(&path)’
fcoe-utils-b233050792cc5fa54ba1da257706ca2b5ef3c987/fcoeadm_display.c:423:13: enter_function: entry to ‘search_rport_targets’
fcoe-utils-b233050792cc5fa54ba1da257706ca2b5ef3c987/fcoeadm_display.c:428:9: call_function: calling ‘sa_dir_crawl’ from ‘search_rport_targets’
#  368|   		return;
#  369|   
#  370|-> 	while ((dp = readdir(dir)) != NULL) {
#  371|   		if (dp->d_name[0] == '.' && (dp->d_name[1] == '\0' ||
#  372|   		   (dp->d_name[1] == '.' && dp->d_name[2] == '\0')))

Error: GCC_ANALYZER_WARNING (CWE-688): [#def25]
fcoe-utils-b233050792cc5fa54ba1da257706ca2b5ef3c987/fcoeadm_display.c:458:30: warning[-Wanalyzer-null-argument]: use of NULL ‘substr’ where non-null expected
fcoe-utils-b233050792cc5fa54ba1da257706ca2b5ef3c987/fcoeadm_display.c:464:13: enter_function: entry to ‘scan_device_map’
fcoe-utils-b233050792cc5fa54ba1da257706ca2b5ef3c987/fcoeadm_display.c:469:9: call_function: calling ‘list_luns_by_rport’ from ‘scan_device_map’
#  456|   	substr = strstr(path, "fc_remote_ports");
#  457|   
#  458|-> 	len = strlen(path) - strlen(substr);
#  459|   	path[len] = '\0';
#  460|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def26]
fcoe-utils-b233050792cc5fa54ba1da257706ca2b5ef3c987/fcoemon.c:496:22: warning[-Wanalyzer-malloc-leak]: leak of ‘opendir("/etc/fcoe")’
fcoe-utils-b233050792cc5fa54ba1da257706ca2b5ef3c987/fcoemon.c:3715:5: enter_function: entry to ‘main’
fcoe-utils-b233050792cc5fa54ba1da257706ca2b5ef3c987/fcoemon.c:3725:9: call_function: inlined call to ‘strncpy’ from ‘main’
fcoe-utils-b233050792cc5fa54ba1da257706ca2b5ef3c987/fcoemon.c:3764:12: branch_false: following ‘false’ branch...
fcoe-utils-b233050792cc5fa54ba1da257706ca2b5ef3c987/fcoemon.c:3767:9: branch_false: ...to here
fcoe-utils-b233050792cc5fa54ba1da257706ca2b5ef3c987/fcoemon.c:3786:12: branch_false: following ‘false’ branch (when ‘rc >= 0’)...
fcoe-utils-b233050792cc5fa54ba1da257706ca2b5ef3c987/fcoemon.c:3790:14: branch_false: ...to here
fcoe-utils-b233050792cc5fa54ba1da257706ca2b5ef3c987/fcoemon.c:3791:12: branch_false: following ‘false’ branch (when ‘rc >= 0’)...
fcoe-utils-b233050792cc5fa54ba1da257706ca2b5ef3c987/fcoemon.c:3795:14: branch_false: ...to here
fcoe-utils-b233050792cc5fa54ba1da257706ca2b5ef3c987/fcoemon.c:3796:12: branch_false: following ‘false’ branch (when ‘rc >= 0’)...
fcoe-utils-b233050792cc5fa54ba1da257706ca2b5ef3c987/fcoemon.c:3800:14: branch_false: ...to here
fcoe-utils-b233050792cc5fa54ba1da257706ca2b5ef3c987/fcoemon.c:3801:12: branch_false: following ‘false’ branch (when ‘rc >= 0’)...
fcoe-utils-b233050792cc5fa54ba1da257706ca2b5ef3c987/fcoemon.c:3807:13: branch_false: ...to here
fcoe-utils-b233050792cc5fa54ba1da257706ca2b5ef3c987/fcoemon.c:3807:12: branch_false: following ‘false’ branch...
fcoe-utils-b233050792cc5fa54ba1da257706ca2b5ef3c987/fcoemon.c:3812:9: branch_false: ...to here
fcoe-utils-b233050792cc5fa54ba1da257706ca2b5ef3c987/fcoemon.c:3812:9: call_function: calling ‘fcm_fcoe_init’ from ‘main’
#  494|   	}
#  495|   	for (;;) {
#  496|-> 		dp = readdir(dir);
#  497|   		if (dp == NULL)
#  498|   			break;

Error: GCC_ANALYZER_WARNING (CWE-775): [#def27]
fcoe-utils-b233050792cc5fa54ba1da257706ca2b5ef3c987/fcoemon.c:529:58: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(&file, "r")’
fcoe-utils-b233050792cc5fa54ba1da257706ca2b5ef3c987/fcoemon.c:3715:5: enter_function: entry to ‘main’
fcoe-utils-b233050792cc5fa54ba1da257706ca2b5ef3c987/fcoemon.c:3725:9: call_function: inlined call to ‘strncpy’ from ‘main’
fcoe-utils-b233050792cc5fa54ba1da257706ca2b5ef3c987/fcoemon.c:3764:12: branch_false: following ‘false’ branch...
fcoe-utils-b233050792cc5fa54ba1da257706ca2b5ef3c987/fcoemon.c:3767:9: branch_false: ...to here
fcoe-utils-b233050792cc5fa54ba1da257706ca2b5ef3c987/fcoemon.c:3786:12: branch_false: following ‘false’ branch (when ‘rc >= 0’)...
fcoe-utils-b233050792cc5fa54ba1da257706ca2b5ef3c987/fcoemon.c:3790:14: branch_false: ...to here
fcoe-utils-b233050792cc5fa54ba1da257706ca2b5ef3c987/fcoemon.c:3791:12: branch_false: following ‘false’ branch (when ‘rc >= 0’)...
fcoe-utils-b233050792cc5fa54ba1da257706ca2b5ef3c987/fcoemon.c:3795:14: branch_false: ...to here
fcoe-utils-b233050792cc5fa54ba1da257706ca2b5ef3c987/fcoemon.c:3796:12: branch_false: following ‘false’ branch (when ‘rc >= 0’)...
fcoe-utils-b233050792cc5fa54ba1da257706ca2b5ef3c987/fcoemon.c:3800:14: branch_false: ...to here
fcoe-utils-b233050792cc5fa54ba1da257706ca2b5ef3c987/fcoemon.c:3801:12: branch_false: following ‘false’ branch (when ‘rc >= 0’)...
fcoe-utils-b233050792cc5fa54ba1da257706ca2b5ef3c987/fcoemon.c:3807:13: branch_false: ...to here
fcoe-utils-b233050792cc5fa54ba1da257706ca2b5ef3c987/fcoemon.c:3807:12: branch_false: following ‘false’ branch...
fcoe-utils-b233050792cc5fa54ba1da257706ca2b5ef3c987/fcoemon.c:3812:9: branch_false: ...to here
fcoe-utils-b233050792cc5fa54ba1da257706ca2b5ef3c987/fcoemon.c:3812:9: call_function: calling ‘fcm_fcoe_init’ from ‘main’
#  527|   		}
#  528|   
#  529|-> 		real_ifname_from_name(next->real_ifname, next->ifname);
#  530|   
#  531|   		/* FCOE_ENABLE */

Error: GCC_ANALYZER_WARNING (CWE-401): [#def28]
fcoe-utils-b233050792cc5fa54ba1da257706ca2b5ef3c987/fcoemon.c:529:58: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(&file, "r")’
fcoe-utils-b233050792cc5fa54ba1da257706ca2b5ef3c987/fcoemon.c:3715:5: enter_function: entry to ‘main’
fcoe-utils-b233050792cc5fa54ba1da257706ca2b5ef3c987/fcoemon.c:3725:9: call_function: inlined call to ‘strncpy’ from ‘main’
fcoe-utils-b233050792cc5fa54ba1da257706ca2b5ef3c987/fcoemon.c:3764:12: branch_false: following ‘false’ branch...
fcoe-utils-b233050792cc5fa54ba1da257706ca2b5ef3c987/fcoemon.c:3767:9: branch_false: ...to here
fcoe-utils-b233050792cc5fa54ba1da257706ca2b5ef3c987/fcoemon.c:3786:12: branch_false: following ‘false’ branch (when ‘rc >= 0’)...
fcoe-utils-b233050792cc5fa54ba1da257706ca2b5ef3c987/fcoemon.c:3790:14: branch_false: ...to here
fcoe-utils-b233050792cc5fa54ba1da257706ca2b5ef3c987/fcoemon.c:3791:12: branch_false: following ‘false’ branch (when ‘rc >= 0’)...
fcoe-utils-b233050792cc5fa54ba1da257706ca2b5ef3c987/fcoemon.c:3795:14: branch_false: ...to here
fcoe-utils-b233050792cc5fa54ba1da257706ca2b5ef3c987/fcoemon.c:3796:12: branch_false: following ‘false’ branch (when ‘rc >= 0’)...
fcoe-utils-b233050792cc5fa54ba1da257706ca2b5ef3c987/fcoemon.c:3800:14: branch_false: ...to here
fcoe-utils-b233050792cc5fa54ba1da257706ca2b5ef3c987/fcoemon.c:3801:12: branch_false: following ‘false’ branch (when ‘rc >= 0’)...
fcoe-utils-b233050792cc5fa54ba1da257706ca2b5ef3c987/fcoemon.c:3807:13: branch_false: ...to here
fcoe-utils-b233050792cc5fa54ba1da257706ca2b5ef3c987/fcoemon.c:3807:12: branch_false: following ‘false’ branch...
fcoe-utils-b233050792cc5fa54ba1da257706ca2b5ef3c987/fcoemon.c:3812:9: branch_false: ...to here
fcoe-utils-b233050792cc5fa54ba1da257706ca2b5ef3c987/fcoemon.c:3812:9: call_function: calling ‘fcm_fcoe_init’ from ‘main’
#  527|   		}
#  528|   
#  529|-> 		real_ifname_from_name(next->real_ifname, next->ifname);
#  530|   
#  531|   		/* FCOE_ENABLE */

Error: GCC_ANALYZER_WARNING (CWE-476): [#def29]
fcoe-utils-b233050792cc5fa54ba1da257706ca2b5ef3c987/fcoemon.c:614:25: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘curr’
fcoe-utils-b233050792cc5fa54ba1da257706ca2b5ef3c987/fcoemon.c:3715:5: enter_function: entry to ‘main’
fcoe-utils-b233050792cc5fa54ba1da257706ca2b5ef3c987/fcoemon.c:3725:9: call_function: inlined call to ‘strncpy’ from ‘main’
fcoe-utils-b233050792cc5fa54ba1da257706ca2b5ef3c987/fcoemon.c:3764:12: branch_false: following ‘false’ branch...
fcoe-utils-b233050792cc5fa54ba1da257706ca2b5ef3c987/fcoemon.c:3767:9: branch_false: ...to here
fcoe-utils-b233050792cc5fa54ba1da257706ca2b5ef3c987/fcoemon.c:3786:12: branch_false: following ‘false’ branch (when ‘rc >= 0’)...
fcoe-utils-b233050792cc5fa54ba1da257706ca2b5ef3c987/fcoemon.c:3790:14: branch_false: ...to here
fcoe-utils-b233050792cc5fa54ba1da257706ca2b5ef3c987/fcoemon.c:3791:12: branch_false: following ‘false’ branch (when ‘rc >= 0’)...
fcoe-utils-b233050792cc5fa54ba1da257706ca2b5ef3c987/fcoemon.c:3795:14: branch_false: ...to here
fcoe-utils-b233050792cc5fa54ba1da257706ca2b5ef3c987/fcoemon.c:3796:12: branch_false: following ‘false’ branch (when ‘rc >= 0’)...
fcoe-utils-b233050792cc5fa54ba1da257706ca2b5ef3c987/fcoemon.c:3800:14: branch_false: ...to here
fcoe-utils-b233050792cc5fa54ba1da257706ca2b5ef3c987/fcoemon.c:3801:12: branch_false: following ‘false’ branch (when ‘rc >= 0’)...
fcoe-utils-b233050792cc5fa54ba1da257706ca2b5ef3c987/fcoemon.c:3807:13: branch_false: ...to here
fcoe-utils-b233050792cc5fa54ba1da257706ca2b5ef3c987/fcoemon.c:3807:12: branch_false: following ‘false’ branch...
fcoe-utils-b233050792cc5fa54ba1da257706ca2b5ef3c987/fcoemon.c:3812:9: branch_false: ...to here
fcoe-utils-b233050792cc5fa54ba1da257706ca2b5ef3c987/fcoemon.c:3812:9: call_function: calling ‘fcm_fcoe_init’ from ‘main’
#  612|   			curr = next;
#  613|   		} else {
#  614|-> 			curr->next = next;
#  615|   			curr = next;
#  616|   		}

Error: GCC_ANALYZER_WARNING (CWE-775): [#def30]
fcoe-utils-b233050792cc5fa54ba1da257706ca2b5ef3c987/fcoemon.c:1103:17: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘fd’
fcoe-utils-b233050792cc5fa54ba1da257706ca2b5ef3c987/fcoemon.c:3353:1: enter_function: entry to ‘fcm_port_create’
fcoe-utils-b233050792cc5fa54ba1da257706ca2b5ef3c987/fcoemon.c:3360:12: branch_false: following ‘false’ branch...
fcoe-utils-b233050792cc5fa54ba1da257706ca2b5ef3c987/fcoemon.c:3380:13: branch_false: ...to here
fcoe-utils-b233050792cc5fa54ba1da257706ca2b5ef3c987/fcoemon.c:3380:13: call_function: calling ‘alloc_fcoe_port’ from ‘fcm_port_create’
fcoe-utils-b233050792cc5fa54ba1da257706ca2b5ef3c987/fcoemon.c:3380:13: return_function: returning to ‘fcm_port_create’ from ‘alloc_fcoe_port’
fcoe-utils-b233050792cc5fa54ba1da257706ca2b5ef3c987/fcoemon.c:3381:12: branch_false: following ‘false’ branch...
fcoe-utils-b233050792cc5fa54ba1da257706ca2b5ef3c987/fcoemon.c:3386:39: branch_false: ...to here
fcoe-utils-b233050792cc5fa54ba1da257706ca2b5ef3c987/fcoemon.c:3386:9: call_function: calling ‘fcm_vlan_dev_real_dev’ from ‘fcm_port_create’
# 1101|   	ifv.cmd = GET_VLAN_REALDEV_NAME_CMD;
# 1102|   	if (strlen(vlan_ifname) > (sizeof(ifv.device1) - 1)) {
# 1103|-> 		FCM_LOG_ERR(ENOSPC, "no room for vlan ifname");
# 1104|   		goto close_fd;
# 1105|   	}

Error: GCC_ANALYZER_WARNING (CWE-775): [#def31]
fcoe-utils-b233050792cc5fa54ba1da257706ca2b5ef3c987/fcoemon.c:1119:9: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘fd’
fcoe-utils-b233050792cc5fa54ba1da257706ca2b5ef3c987/fcoemon.c:3353:1: enter_function: entry to ‘fcm_port_create’
fcoe-utils-b233050792cc5fa54ba1da257706ca2b5ef3c987/fcoemon.c:3360:12: branch_false: following ‘false’ branch...
fcoe-utils-b233050792cc5fa54ba1da257706ca2b5ef3c987/fcoemon.c:3380:13: branch_false: ...to here
fcoe-utils-b233050792cc5fa54ba1da257706ca2b5ef3c987/fcoemon.c:3380:13: call_function: calling ‘alloc_fcoe_port’ from ‘fcm_port_create’
fcoe-utils-b233050792cc5fa54ba1da257706ca2b5ef3c987/fcoemon.c:3380:13: return_function: returning to ‘fcm_port_create’ from ‘alloc_fcoe_port’
fcoe-utils-b233050792cc5fa54ba1da257706ca2b5ef3c987/fcoemon.c:3381:12: branch_false: following ‘false’ branch...
fcoe-utils-b233050792cc5fa54ba1da257706ca2b5ef3c987/fcoemon.c:3386:39: branch_false: ...to here
fcoe-utils-b233050792cc5fa54ba1da257706ca2b5ef3c987/fcoemon.c:3386:9: call_function: calling ‘fcm_vlan_dev_real_dev’ from ‘fcm_port_create’
# 1117|   	}
# 1118|   close_fd:
# 1119|-> 	close(fd);
# 1120|   }
# 1121|   

Error: CPPCHECK_WARNING (CWE-457): [#def32]
fcoe-utils-b233050792cc5fa54ba1da257706ca2b5ef3c987/fcoemon.c:2029: error[uninitvar]: Uninitialized variables: ff.ff_enabled, ff.ff_dcb_state, ff.dcbx_cap, ff.ieee_state, ff.ieee_resp_pending, ff.ieee_pfc_info, ff.ieee_app_info, ff.ff_pfc_info, ff.ff_app_info, ff.ff_operstate, ff.ff_dcbd_state, ff.response_pending, ff.dcbd_retry_cnt, ff.dcbd_retry_timer
# 2027|   	TAILQ_FOREACH(ff, &fcm_netif_head, ff_list) {
# 2028|   		if (!strncmp(ifname, ff->ifname, IFNAMSIZ))
# 2029|-> 			return ff;
# 2030|   	}
# 2031|   

Error: CPPCHECK_WARNING (CWE-457): [#def33]
fcoe-utils-b233050792cc5fa54ba1da257706ca2b5ef3c987/fcoemon.c:2051: error[uninitvar]: Uninitialized variables: curr.ff_enabled, curr.ff_dcb_state, curr.dcbx_cap, curr.ieee_state, curr.ieee_resp_pending, curr.ieee_pfc_info, curr.ieee_app_info, curr.ff_pfc_info, curr.ff_app_info, curr.ff_operstate, curr.ff_dcbd_state, curr.response_pending, curr.dcbd_retry_cnt, curr.dcbd_retry_timer
# 2049|   	TAILQ_FOREACH(curr, &fcm_netif_head, ff_list) {
# 2050|   		if (strcmp(curr->ifname, ifname) == 0) {
# 2051|-> 			ff = curr;
# 2052|   			break;
# 2053|   		}

Error: GCC_ANALYZER_WARNING (CWE-775): [#def34]
fcoe-utils-b233050792cc5fa54ba1da257706ca2b5ef3c987/fcoemon.c:2901:17: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(path, "w")’
fcoe-utils-b233050792cc5fa54ba1da257706ca2b5ef3c987/fcoemon.c:2893:14: acquire_resource: opened here
fcoe-utils-b233050792cc5fa54ba1da257706ca2b5ef3c987/fcoemon.c:2894:12: branch_false: following ‘false’ branch...
fcoe-utils-b233050792cc5fa54ba1da257706ca2b5ef3c987/fcoemon.c:2900:20: branch_false: ...to here
fcoe-utils-b233050792cc5fa54ba1da257706ca2b5ef3c987/fcoemon.c:2900:12: branch_true: following ‘true’ branch...
fcoe-utils-b233050792cc5fa54ba1da257706ca2b5ef3c987/fcoemon.c:2901:17: branch_true: ...to here
fcoe-utils-b233050792cc5fa54ba1da257706ca2b5ef3c987/fcoemon.c:2901:17: throw: if ‘sa_log_err’ throws an exception...
fcoe-utils-b233050792cc5fa54ba1da257706ca2b5ef3c987/fcoemon.c:2901:17: danger: ‘fopen(path, "w")’ leaks here; was opened at [(1)](sarif:/runs/0/results/6/codeFlows/0/threadFlows/0/locations/0)
# 2899|   
# 2900|   	if (EOF == fputs(ifname, fp)) {
# 2901|-> 		FCM_LOG_ERR(errno, "%s: Failed to write %s to path %s.\n",
# 2902|   			    progname, ifname, path);
# 2903|   		goto out;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def35]
fcoe-utils-b233050792cc5fa54ba1da257706ca2b5ef3c987/fcoemon.c:2901:17: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(path, "w")’
fcoe-utils-b233050792cc5fa54ba1da257706ca2b5ef3c987/fcoemon.c:2893:14: acquire_memory: allocated here
fcoe-utils-b233050792cc5fa54ba1da257706ca2b5ef3c987/fcoemon.c:2894:12: branch_false: following ‘false’ branch...
fcoe-utils-b233050792cc5fa54ba1da257706ca2b5ef3c987/fcoemon.c:2900:20: branch_false: ...to here
fcoe-utils-b233050792cc5fa54ba1da257706ca2b5ef3c987/fcoemon.c:2900:12: branch_true: following ‘true’ branch...
fcoe-utils-b233050792cc5fa54ba1da257706ca2b5ef3c987/fcoemon.c:2901:17: branch_true: ...to here
fcoe-utils-b233050792cc5fa54ba1da257706ca2b5ef3c987/fcoemon.c:2901:17: throw: if ‘sa_log_err’ throws an exception...
fcoe-utils-b233050792cc5fa54ba1da257706ca2b5ef3c987/fcoemon.c:2901:17: danger: ‘fopen(path, "w")’ leaks here; was allocated at [(1)](sarif:/runs/0/results/7/codeFlows/0/threadFlows/0/locations/0)
# 2899|   
# 2900|   	if (EOF == fputs(ifname, fp)) {
# 2901|-> 		FCM_LOG_ERR(errno, "%s: Failed to write %s to path %s.\n",
# 2902|   			    progname, ifname, path);
# 2903|   		goto out;

Error: CPPCHECK_WARNING (CWE-457): [#def36]
fcoe-utils-b233050792cc5fa54ba1da257706ca2b5ef3c987/fcoemon.c:3242: error[uninitvar]: Uninitialized variables: ff.ff_enabled, ff.ff_dcb_state, ff.dcbx_cap, ff.ieee_state, ff.ieee_resp_pending, ff.ieee_pfc_info, ff.ieee_app_info, ff.ff_pfc_info, ff.ff_app_info, ff.ff_operstate, ff.ff_dcbd_state, ff.response_pending, ff.dcbd_retry_cnt, ff.dcbd_retry_timer
# 3240|   	 */
# 3241|   	TAILQ_FOREACH(ff, &fcm_netif_head, ff_list) {
# 3242|-> 		fcm_netif_advance(ff);
# 3243|   		fcm_netif_ieee_advance(ff);
# 3244|   	}

Error: GCC_ANALYZER_WARNING (CWE-775): [#def37]
fcoe-utils-b233050792cc5fa54ba1da257706ca2b5ef3c987/fcoemon.c:3689:13: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘*srv_info.srv_sock’
fcoe-utils-b233050792cc5fa54ba1da257706ca2b5ef3c987/fcoemon.c:3664:12: enter_function: entry to ‘fcm_srv_create’
fcoe-utils-b233050792cc5fa54ba1da257706ca2b5ef3c987/fcoemon.c:3671:12: branch_false: following ‘false’ branch...
fcoe-utils-b233050792cc5fa54ba1da257706ca2b5ef3c987/fcoemon.c:3676:30: branch_false: ...to here
fcoe-utils-b233050792cc5fa54ba1da257706ca2b5ef3c987/fcoemon.c:3677:12: branch_false: following ‘false’ branch...
fcoe-utils-b233050792cc5fa54ba1da257706ca2b5ef3c987/fcoemon.c:3683:9: call_function: inlined call to ‘memset’ from ‘fcm_srv_create’
fcoe-utils-b233050792cc5fa54ba1da257706ca2b5ef3c987/fcoemon.c:3689:13: danger: ‘*srv_info.srv_sock’ leaks here
# 3687|   		 "%s", CLIF_IFNAME);
# 3688|   	addrlen = sizeof(sa_family_t) + strlen(addr.sun_path + 1) + 1;
# 3689|-> 	if (bind(srv_info->srv_sock, (struct sockaddr *)&addr, addrlen) < 0) {
# 3690|   		FCM_LOG_ERR(errno, "Failed to bind socket\n");
# 3691|   		rc = errno;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def38]
fcoe-utils-b233050792cc5fa54ba1da257706ca2b5ef3c987/fcping.c:265:9: warning[-Wanalyzer-malloc-leak]: leak of ‘resp’
fcoe-utils-b233050792cc5fa54ba1da257706ca2b5ef3c987/fcping.c:865:12: enter_function: entry to ‘fp_send_ping’
fcoe-utils-b233050792cc5fa54ba1da257706ca2b5ef3c987/fcping.c:878:16: acquire_memory: allocated here
fcoe-utils-b233050792cc5fa54ba1da257706ca2b5ef3c987/fcping.c:879:12: branch_false: following ‘false’ branch (when ‘resp’ is non-NULL)...
fcoe-utils-b233050792cc5fa54ba1da257706ca2b5ef3c987/fcping.c:882:9: branch_false: ...to here
fcoe-utils-b233050792cc5fa54ba1da257706ca2b5ef3c987/fcping.c:887:19: call_function: calling ‘fp_get_time_usec’ from ‘fp_send_ping’
#  263|   {
#  264|   	fprintf(stderr, "%s", buf);
#  265|-> 	fflush(stderr);
#  266|   }
#  267|   

Error: CPPCHECK_WARNING (CWE-457): [#def39]
fcoe-utils-b233050792cc5fa54ba1da257706ca2b5ef3c987/fcping.c:287: warning[uninitvar]: Uninitialized variable: buf
#  285|   		sep = (i % group_len) ? "" : inter_group_sep;
#  286|   	}
#  287|-> 	return buf;
#  288|   }
#  289|   

Error: CPPCHECK_WARNING (CWE-457): [#def40]
fcoe-utils-b233050792cc5fa54ba1da257706ca2b5ef3c987/fcrls.c:267: error[uninitvar]: Uninitialized variable: reply->result
#  265|   	memset(sense, 0, sizeof(sense));
#  266|   	rc = ioctl(bsg, SG_IO, &sgio);
#  267|-> 	bsg_debug("ioctl returned %d: bsg_reply result=%d\n",
#  268|   		  rc, reply->result);
#  269|   	return rc;

Error: CPPCHECK_WARNING (CWE-457): [#def41]
fcoe-utils-b233050792cc5fa54ba1da257706ca2b5ef3c987/fipvlan.c:189: error[uninitvar]: Uninitialized variable: iff->ifindex
#  187|   
#  188|   	TAILQ_FOREACH(iff, &interfaces, list_node) {
#  189|-> 		if ((!ifindex || ifindex == iff->ifindex) &&
#  190|   		    (!ifname  || strcmp(ifname, iff->ifname) == 0))
#  191|   			return iff;

Error: CPPCHECK_WARNING (CWE-457): [#def42]
fcoe-utils-b233050792cc5fa54ba1da257706ca2b5ef3c987/fipvlan.c:216: error[uninitvar]: Uninitialized variable: real_dev->ifindex
#  214|   	struct iff *real_dev;
#  215|   	TAILQ_FOREACH(real_dev, &interfaces, list_node) {
#  216|-> 		if (real_dev->ifindex == vlan->iflink)
#  217|   			return real_dev;
#  218|   	}

Error: CPPCHECK_WARNING (CWE-457): [#def43]
fcoe-utils-b233050792cc5fa54ba1da257706ca2b5ef3c987/fipvlan.c:746: error[uninitvar]: Uninitialized variable: fcf->ifindex
#  744|   	printf("------------------------------------------\n");
#  745|   	TAILQ_FOREACH(fcf, list, list_node) {
#  746|-> 		iff = lookup_iff(fcf->ifindex, NULL);
#  747|   		printf("%-16.16s| %-5d| %2.2x:%2.2x:%2.2x:%2.2x:%2.2x:%2.2x\n",
#  748|   		       iff->ifname, fcf->vlan,

Error: CPPCHECK_WARNING (CWE-457): [#def44]
fcoe-utils-b233050792cc5fa54ba1da257706ca2b5ef3c987/fipvlan.c:864: error[uninitvar]: Uninitialized variables: iff.ps, iff.ifindex, iff.iflink, iff.running, iff.is_vlan, iff.vid, iff.linkup_sent, iff.req_sent, iff.resp_recv, iff.fip_ready, iff.fcoe_started, iff.vlans
#  862|   	if (config.automode) {
#  863|   		TAILQ_FOREACH(iff, &interfaces, list_node) {
#  864|-> 			skipped += probe_fip_interface(iff);
#  865|   		}
#  866|   	} else {

Error: CPPCHECK_WARNING (CWE-457): [#def45]
fcoe-utils-b233050792cc5fa54ba1da257706ca2b5ef3c987/fipvlan.c:920: error[uninitvar]: Uninitialized variable: vlan->running
#  918|   
#  919|   			TAILQ_FOREACH(vlan, &iff->vlans, list_node) {
#  920|-> 				if (!vlan->running) {
#  921|   					FIP_LOG_DBG("vlan %d: waiting for "
#  922|   						    "IFF_RUNNING [%d]",

Error: CPPCHECK_WARNING (CWE-457): [#def46]
fcoe-utils-b233050792cc5fa54ba1da257706ca2b5ef3c987/fipvlan.c:942: error[uninitvar]: Uninitialized variable: iff->linkup_sent
#  940|   
#  941|   	TAILQ_FOREACH(iff, &interfaces, list_node) {
#  942|-> 		if (iff->linkup_sent) {
#  943|   			if (config.link_up && iff->resp_recv)
#  944|   				continue;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def47]
fcoe-utils-b233050792cc5fa54ba1da257706ca2b5ef3c987/lib/fcoe_utils.c:153:9: warning[-Wanalyzer-malloc-leak]: leak of ‘opendir(dir)’
fcoe-utils-b233050792cc5fa54ba1da257706ca2b5ef3c987/lib/fcoe_utils.c:147:12: branch_false: following ‘false’ branch (when ‘dir’ is non-NULL)...
fcoe-utils-b233050792cc5fa54ba1da257706ca2b5ef3c987/lib/fcoe_utils.c:150:13: branch_false: ...to here
fcoe-utils-b233050792cc5fa54ba1da257706ca2b5ef3c987/lib/fcoe_utils.c:150:13: acquire_memory: allocated here
fcoe-utils-b233050792cc5fa54ba1da257706ca2b5ef3c987/lib/fcoe_utils.c:151:12: branch_false: following ‘false’ branch...
fcoe-utils-b233050792cc5fa54ba1da257706ca2b5ef3c987/lib/fcoe_utils.c:153:9: branch_false: ...to here
fcoe-utils-b233050792cc5fa54ba1da257706ca2b5ef3c987/lib/fcoe_utils.c:153:9: danger: ‘opendir(dir)’ leaks here; was allocated at [(3)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/2)
#  151|   	if (!d)
#  152|   		return -EINVAL;
#  153|-> 	closedir(d);
#  154|   	return 0;
#  155|   }

Error: GCC_ANALYZER_WARNING (CWE-775): [#def48]
fcoe-utils-b233050792cc5fa54ba1da257706ca2b5ef3c987/lib/fip.c:79:9: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘s’
fcoe-utils-b233050792cc5fa54ba1da257706ca2b5ef3c987/lib/fip.c:203:5: enter_function: entry to ‘fip_socket’
fcoe-utils-b233050792cc5fa54ba1da257706ca2b5ef3c987/lib/fip.c:213:13: acquire_resource: socket created here
fcoe-utils-b233050792cc5fa54ba1da257706ca2b5ef3c987/lib/fip.c:214:12: branch_false: following ‘false’ branch (when ‘s >= 0’)...
fcoe-utils-b233050792cc5fa54ba1da257706ca2b5ef3c987/lib/fip.c:219:14: branch_false: ...to here
fcoe-utils-b233050792cc5fa54ba1da257706ca2b5ef3c987/lib/fip.c:219:14: call_function: calling ‘fip_socket_sanmac’ from ‘fip_socket’
#   77|   	ifr.ifr_ifindex = ifindex;
#   78|   	rc = ioctl(s, SIOCGIFNAME, &ifr);
#   79|-> 	close(s);
#   80|   	if (rc)
#   81|   		return rc;

Error: GCC_ANALYZER_WARNING (CWE-775): [#def49]
fcoe-utils-b233050792cc5fa54ba1da257706ca2b5ef3c987/lib/fip.c:83:14: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘s’
fcoe-utils-b233050792cc5fa54ba1da257706ca2b5ef3c987/lib/fip.c:203:5: enter_function: entry to ‘fip_socket’
fcoe-utils-b233050792cc5fa54ba1da257706ca2b5ef3c987/lib/fip.c:213:13: acquire_resource: socket created here
fcoe-utils-b233050792cc5fa54ba1da257706ca2b5ef3c987/lib/fip.c:214:12: branch_false: following ‘false’ branch (when ‘s >= 0’)...
fcoe-utils-b233050792cc5fa54ba1da257706ca2b5ef3c987/lib/fip.c:219:14: branch_false: ...to here
fcoe-utils-b233050792cc5fa54ba1da257706ca2b5ef3c987/lib/fip.c:219:14: call_function: calling ‘fip_socket_sanmac’ from ‘fip_socket’
#   81|   		return rc;
#   82|   
#   83|-> 	rc = rtnl_get_sanmac(ifr.ifr_name, addr);
#   84|   	if (rc)
#   85|   		return rc;

Error: GCC_ANALYZER_WARNING (CWE-775): [#def50]
fcoe-utils-b233050792cc5fa54ba1da257706ca2b5ef3c987/lib/fip.c:130:17: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘s’
fcoe-utils-b233050792cc5fa54ba1da257706ca2b5ef3c987/lib/fip.c:203:5: enter_function: entry to ‘fip_socket’
fcoe-utils-b233050792cc5fa54ba1da257706ca2b5ef3c987/lib/fip.c:213:13: acquire_resource: socket created here
fcoe-utils-b233050792cc5fa54ba1da257706ca2b5ef3c987/lib/fip.c:214:12: branch_false: following ‘false’ branch (when ‘s >= 0’)...
fcoe-utils-b233050792cc5fa54ba1da257706ca2b5ef3c987/lib/fip.c:219:14: branch_false: ...to here
fcoe-utils-b233050792cc5fa54ba1da257706ca2b5ef3c987/lib/fip.c:219:14: call_function: calling ‘fip_socket_sanmac’ from ‘fip_socket’
#  128|   
#  129|   	if (fip_get_sanmac(ifindex, smac)) {
#  130|-> 		FIP_LOG_DBG("%s: no sanmac, ifindex %d\n", __func__, ifindex);
#  131|   		memcpy(smac, mac, ETHER_ADDR_LEN);
#  132|   	}

Error: GCC_ANALYZER_WARNING (CWE-775): [#def51]
fcoe-utils-b233050792cc5fa54ba1da257706ca2b5ef3c987/lib/fip.c:193:16: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘s’
fcoe-utils-b233050792cc5fa54ba1da257706ca2b5ef3c987/lib/fip.c:203:5: enter_function: entry to ‘fip_socket’
fcoe-utils-b233050792cc5fa54ba1da257706ca2b5ef3c987/lib/fip.c:213:13: acquire_resource: socket created here
fcoe-utils-b233050792cc5fa54ba1da257706ca2b5ef3c987/lib/fip.c:214:12: branch_false: following ‘false’ branch (when ‘s >= 0’)...
fcoe-utils-b233050792cc5fa54ba1da257706ca2b5ef3c987/lib/fip.c:219:14: branch_false: ...to here
fcoe-utils-b233050792cc5fa54ba1da257706ca2b5ef3c987/lib/fip.c:219:14: call_function: calling ‘fip_socket_sanmac’ from ‘fip_socket’
fcoe-utils-b233050792cc5fa54ba1da257706ca2b5ef3c987/lib/fip.c:219:14: return_function: returning to ‘fip_socket’ from ‘fip_socket_sanmac’
fcoe-utils-b233050792cc5fa54ba1da257706ca2b5ef3c987/lib/fip.c:220:12: branch_false: following ‘false’ branch...
fcoe-utils-b233050792cc5fa54ba1da257706ca2b5ef3c987/lib/fip.c:225:12: branch_false: ...to here
fcoe-utils-b233050792cc5fa54ba1da257706ca2b5ef3c987/lib/fip.c:229:12: branch_false: following ‘false’ branch (when ‘rc >= 0’)...
fcoe-utils-b233050792cc5fa54ba1da257706ca2b5ef3c987/lib/fip.c:240:9: branch_false: ...to here
fcoe-utils-b233050792cc5fa54ba1da257706ca2b5ef3c987/lib/fip.c:240:9: call_function: calling ‘drain_socket’ from ‘fip_socket’
#  191|   	};
#  192|   
#  193|-> 	while (recvmsg(s, &msg, MSG_DONTWAIT) > 0) {
#  194|   		/* Drop the packet */
#  195|   	}

Error: GCC_ANALYZER_WARNING (CWE-775): [#def52]
fcoe-utils-b233050792cc5fa54ba1da257706ca2b5ef3c987/lib/fip.c:230:17: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘s’
fcoe-utils-b233050792cc5fa54ba1da257706ca2b5ef3c987/lib/fip.c:203:5: enter_function: entry to ‘fip_socket’
fcoe-utils-b233050792cc5fa54ba1da257706ca2b5ef3c987/lib/fip.c:213:13: acquire_resource: socket created here
fcoe-utils-b233050792cc5fa54ba1da257706ca2b5ef3c987/lib/fip.c:214:12: branch_false: following ‘false’ branch (when ‘s >= 0’)...
fcoe-utils-b233050792cc5fa54ba1da257706ca2b5ef3c987/lib/fip.c:219:14: branch_false: ...to here
fcoe-utils-b233050792cc5fa54ba1da257706ca2b5ef3c987/lib/fip.c:219:14: call_function: calling ‘fip_socket_sanmac’ from ‘fip_socket’
fcoe-utils-b233050792cc5fa54ba1da257706ca2b5ef3c987/lib/fip.c:219:14: return_function: returning to ‘fip_socket’ from ‘fip_socket_sanmac’
fcoe-utils-b233050792cc5fa54ba1da257706ca2b5ef3c987/lib/fip.c:220:12: branch_false: following ‘false’ branch...
fcoe-utils-b233050792cc5fa54ba1da257706ca2b5ef3c987/lib/fip.c:225:12: branch_false: ...to here
fcoe-utils-b233050792cc5fa54ba1da257706ca2b5ef3c987/lib/fip.c:228:14: acquire_resource: socket created here
fcoe-utils-b233050792cc5fa54ba1da257706ca2b5ef3c987/lib/fip.c:229:12: branch_true: following ‘true’ branch (when ‘rc < 0’)...
fcoe-utils-b233050792cc5fa54ba1da257706ca2b5ef3c987/lib/fip.c:230:17: branch_true: ...to here
fcoe-utils-b233050792cc5fa54ba1da257706ca2b5ef3c987/lib/fip.c:230:17: throw: if ‘sa_log_err’ throws an exception...
fcoe-utils-b233050792cc5fa54ba1da257706ca2b5ef3c987/lib/fip.c:230:17: danger: ‘s’ leaks here
#  228|   	rc = bind(s, (struct sockaddr *) &sa, sizeof(sa));
#  229|   	if (rc < 0) {
#  230|-> 		FIP_LOG_ERR(errno, "Bind failed.\n");
#  231|   		close(s);
#  232|   		return rc;

Error: GCC_ANALYZER_WARNING (CWE-775): [#def53]
fcoe-utils-b233050792cc5fa54ba1da257706ca2b5ef3c987/lib/fip.c:231:17: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘s’
fcoe-utils-b233050792cc5fa54ba1da257706ca2b5ef3c987/lib/fip.c:203:5: enter_function: entry to ‘fip_socket’
fcoe-utils-b233050792cc5fa54ba1da257706ca2b5ef3c987/lib/fip.c:213:13: acquire_resource: socket created here
fcoe-utils-b233050792cc5fa54ba1da257706ca2b5ef3c987/lib/fip.c:214:12: branch_false: following ‘false’ branch (when ‘s >= 0’)...
fcoe-utils-b233050792cc5fa54ba1da257706ca2b5ef3c987/lib/fip.c:219:14: branch_false: ...to here
fcoe-utils-b233050792cc5fa54ba1da257706ca2b5ef3c987/lib/fip.c:219:14: call_function: calling ‘fip_socket_sanmac’ from ‘fip_socket’
fcoe-utils-b233050792cc5fa54ba1da257706ca2b5ef3c987/lib/fip.c:219:14: return_function: returning to ‘fip_socket’ from ‘fip_socket_sanmac’
fcoe-utils-b233050792cc5fa54ba1da257706ca2b5ef3c987/lib/fip.c:220:12: branch_false: following ‘false’ branch...
fcoe-utils-b233050792cc5fa54ba1da257706ca2b5ef3c987/lib/fip.c:225:12: branch_false: ...to here
fcoe-utils-b233050792cc5fa54ba1da257706ca2b5ef3c987/lib/fip.c:228:14: acquire_resource: socket created here
fcoe-utils-b233050792cc5fa54ba1da257706ca2b5ef3c987/lib/fip.c:229:12: branch_true: following ‘true’ branch (when ‘rc < 0’)...
fcoe-utils-b233050792cc5fa54ba1da257706ca2b5ef3c987/lib/fip.c:230:17: branch_true: ...to here
fcoe-utils-b233050792cc5fa54ba1da257706ca2b5ef3c987/lib/fip.c:231:17: throw: if ‘close’ throws an exception...
fcoe-utils-b233050792cc5fa54ba1da257706ca2b5ef3c987/lib/fip.c:231:17: danger: ‘s’ leaks here
#  229|   	if (rc < 0) {
#  230|   		FIP_LOG_ERR(errno, "Bind failed.\n");
#  231|-> 		close(s);
#  232|   		return rc;
#  233|   	}

Error: CPPCHECK_WARNING (CWE-457): [#def54]
fcoe-utils-b233050792cc5fa54ba1da257706ca2b5ef3c987/lib/fip.c:371: error[uninitvar]: Uninitialized variable: eh
#  369|   	}
#  370|   
#  371|-> 	if (fip_get_sanmac(ifindex, eh.h_source))
#  372|   		memcpy(eh.h_source, mac, ETHER_ADDR_LEN);
#  373|   	eh.h_proto = htons(ETH_P_FIP);

Error: GCC_ANALYZER_WARNING (CWE-775): [#def55]
fcoe-utils-b233050792cc5fa54ba1da257706ca2b5ef3c987/lib/rtnetlink.c:73:17: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘s’
fcoe-utils-b233050792cc5fa54ba1da257706ca2b5ef3c987/lib/rtnetlink.c:482:5: enter_function: entry to ‘rtnl_get_sanmac’
fcoe-utils-b233050792cc5fa54ba1da257706ca2b5ef3c987/lib/rtnetlink.c:511:9: call_function: calling ‘add_rtattr’ from ‘rtnl_get_sanmac’
fcoe-utils-b233050792cc5fa54ba1da257706ca2b5ef3c987/lib/rtnetlink.c:511:9: return_function: returning to ‘rtnl_get_sanmac’ from ‘add_rtattr’
fcoe-utils-b233050792cc5fa54ba1da257706ca2b5ef3c987/lib/rtnetlink.c:513:13: call_function: calling ‘rtnl_socket’ from ‘rtnl_get_sanmac’
#   71|   	rc = bind(s, (struct sockaddr *) &sa, sizeof(sa));
#   72|   	if (rc < 0) {
#   73|-> 		RTNL_LOG_ERRNO("netlink bind error");
#   74|   		close(s);
#   75|   		return rc;

Error: GCC_ANALYZER_WARNING (CWE-775): [#def56]
fcoe-utils-b233050792cc5fa54ba1da257706ca2b5ef3c987/lib/rtnetlink.c:74:17: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘s’
fcoe-utils-b233050792cc5fa54ba1da257706ca2b5ef3c987/lib/rtnetlink.c:482:5: enter_function: entry to ‘rtnl_get_sanmac’
fcoe-utils-b233050792cc5fa54ba1da257706ca2b5ef3c987/lib/rtnetlink.c:511:9: call_function: calling ‘add_rtattr’ from ‘rtnl_get_sanmac’
fcoe-utils-b233050792cc5fa54ba1da257706ca2b5ef3c987/lib/rtnetlink.c:511:9: return_function: returning to ‘rtnl_get_sanmac’ from ‘add_rtattr’
fcoe-utils-b233050792cc5fa54ba1da257706ca2b5ef3c987/lib/rtnetlink.c:513:13: call_function: calling ‘rtnl_socket’ from ‘rtnl_get_sanmac’
#   72|   	if (rc < 0) {
#   73|   		RTNL_LOG_ERRNO("netlink bind error");
#   74|-> 		close(s);
#   75|   		return rc;
#   76|   	}

Error: GCC_ANALYZER_WARNING (CWE-775): [#def57]
fcoe-utils-b233050792cc5fa54ba1da257706ca2b5ef3c987/lib/rtnetlink.c:102:9: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘s’
fcoe-utils-b233050792cc5fa54ba1da257706ca2b5ef3c987/lib/rtnetlink.c:452:5: enter_function: entry to ‘rtnl_find_vlan’
fcoe-utils-b233050792cc5fa54ba1da257706ca2b5ef3c987/lib/rtnetlink.c:462:13: acquire_resource: datagram socket created here
fcoe-utils-b233050792cc5fa54ba1da257706ca2b5ef3c987/lib/rtnetlink.c:463:12: branch_false: following ‘false’ branch (when ‘s >= 0’)...
fcoe-utils-b233050792cc5fa54ba1da257706ca2b5ef3c987/lib/rtnetlink.c:465:14: branch_false: ...to here
fcoe-utils-b233050792cc5fa54ba1da257706ca2b5ef3c987/lib/rtnetlink.c:465:14: call_function: calling ‘send_getlink_dump’ from ‘rtnl_find_vlan’
#  100|   	int rc;
#  101|   
#  102|-> 	RTNL_LOG_DBG("sending RTM_GETLINK dump request");
#  103|   	rc = send(s, &req, req.nh.nlmsg_len, 0);
#  104|   	if (rc < 0)

Error: GCC_ANALYZER_WARNING (CWE-775): [#def58]
fcoe-utils-b233050792cc5fa54ba1da257706ca2b5ef3c987/lib/rtnetlink.c:103:14: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘s’
fcoe-utils-b233050792cc5fa54ba1da257706ca2b5ef3c987/lib/rtnetlink.c:452:5: enter_function: entry to ‘rtnl_find_vlan’
fcoe-utils-b233050792cc5fa54ba1da257706ca2b5ef3c987/lib/rtnetlink.c:462:13: acquire_resource: datagram socket created here
fcoe-utils-b233050792cc5fa54ba1da257706ca2b5ef3c987/lib/rtnetlink.c:463:12: branch_false: following ‘false’ branch (when ‘s >= 0’)...
fcoe-utils-b233050792cc5fa54ba1da257706ca2b5ef3c987/lib/rtnetlink.c:465:14: branch_false: ...to here
fcoe-utils-b233050792cc5fa54ba1da257706ca2b5ef3c987/lib/rtnetlink.c:465:14: call_function: calling ‘send_getlink_dump’ from ‘rtnl_find_vlan’
#  101|   
#  102|   	RTNL_LOG_DBG("sending RTM_GETLINK dump request");
#  103|-> 	rc = send(s, &req, req.nh.nlmsg_len, 0);
#  104|   	if (rc < 0)
#  105|   		RTNL_LOG_ERRNO("netlink sendmsg error");

Error: GCC_ANALYZER_WARNING (CWE-775): [#def59]
fcoe-utils-b233050792cc5fa54ba1da257706ca2b5ef3c987/lib/rtnetlink.c:317:9: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘s’
fcoe-utils-b233050792cc5fa54ba1da257706ca2b5ef3c987/lib/rtnetlink.c:325:5: enter_function: entry to ‘vlan_create’
fcoe-utils-b233050792cc5fa54ba1da257706ca2b5ef3c987/lib/rtnetlink.c:330:13: acquire_resource: datagram socket created here
fcoe-utils-b233050792cc5fa54ba1da257706ca2b5ef3c987/lib/rtnetlink.c:331:12: branch_false: following ‘false’ branch (when ‘s >= 0’)...
fcoe-utils-b233050792cc5fa54ba1da257706ca2b5ef3c987/lib/rtnetlink.c:334:14: branch_false: ...to here
fcoe-utils-b233050792cc5fa54ba1da257706ca2b5ef3c987/lib/rtnetlink.c:334:14: call_function: calling ‘rtnl_send_vlan_newlink’ from ‘vlan_create’
#  315|   	end_rtattr_nest(&req.nh, linkinfo);
#  316|   
#  317|-> 	RTNL_LOG_DBG("sending RTM_NEWLINK request");
#  318|   	rc = send(s, &req, req.nh.nlmsg_len, 0);
#  319|   	if (rc < 0)

Error: GCC_ANALYZER_WARNING (CWE-775): [#def60]
fcoe-utils-b233050792cc5fa54ba1da257706ca2b5ef3c987/lib/rtnetlink.c:318:14: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘s’
fcoe-utils-b233050792cc5fa54ba1da257706ca2b5ef3c987/lib/rtnetlink.c:325:5: enter_function: entry to ‘vlan_create’
fcoe-utils-b233050792cc5fa54ba1da257706ca2b5ef3c987/lib/rtnetlink.c:330:13: acquire_resource: datagram socket created here
fcoe-utils-b233050792cc5fa54ba1da257706ca2b5ef3c987/lib/rtnetlink.c:331:12: branch_false: following ‘false’ branch (when ‘s >= 0’)...
fcoe-utils-b233050792cc5fa54ba1da257706ca2b5ef3c987/lib/rtnetlink.c:334:14: branch_false: ...to here
fcoe-utils-b233050792cc5fa54ba1da257706ca2b5ef3c987/lib/rtnetlink.c:334:14: call_function: calling ‘rtnl_send_vlan_newlink’ from ‘vlan_create’
#  316|   
#  317|   	RTNL_LOG_DBG("sending RTM_NEWLINK request");
#  318|-> 	rc = send(s, &req, req.nh.nlmsg_len, 0);
#  319|   	if (rc < 0)
#  320|   		RTNL_LOG_ERRNO("netlink send error");

Error: GCC_ANALYZER_WARNING (CWE-775): [#def61]
fcoe-utils-b233050792cc5fa54ba1da257706ca2b5ef3c987/lib/rtnetlink.c:368:9: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘s’
fcoe-utils-b233050792cc5fa54ba1da257706ca2b5ef3c987/lib/rtnetlink.c:390:5: enter_function: entry to ‘rtnl_get_linkname’
fcoe-utils-b233050792cc5fa54ba1da257706ca2b5ef3c987/lib/rtnetlink.c:395:13: acquire_resource: datagram socket created here
fcoe-utils-b233050792cc5fa54ba1da257706ca2b5ef3c987/lib/rtnetlink.c:396:12: branch_false: following ‘false’ branch (when ‘s >= 0’)...
fcoe-utils-b233050792cc5fa54ba1da257706ca2b5ef3c987/lib/rtnetlink.c:398:14: branch_false: ...to here
fcoe-utils-b233050792cc5fa54ba1da257706ca2b5ef3c987/lib/rtnetlink.c:398:14: call_function: calling ‘rtnl_send_getlink’ from ‘rtnl_get_linkname’
#  366|   		add_rtattr(&req.nh, IFLA_IFNAME, name, strlen(name));
#  367|   
#  368|-> 	RTNL_LOG_DBG("sending RTM_GETLINK");
#  369|   	rc = send(s, &req, req.nh.nlmsg_len, 0);
#  370|   	if (rc < 0)

Error: GCC_ANALYZER_WARNING (CWE-775): [#def62]
fcoe-utils-b233050792cc5fa54ba1da257706ca2b5ef3c987/lib/rtnetlink.c:369:14: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘s’
fcoe-utils-b233050792cc5fa54ba1da257706ca2b5ef3c987/lib/rtnetlink.c:390:5: enter_function: entry to ‘rtnl_get_linkname’
fcoe-utils-b233050792cc5fa54ba1da257706ca2b5ef3c987/lib/rtnetlink.c:395:13: acquire_resource: datagram socket created here
fcoe-utils-b233050792cc5fa54ba1da257706ca2b5ef3c987/lib/rtnetlink.c:396:12: branch_false: following ‘false’ branch (when ‘s >= 0’)...
fcoe-utils-b233050792cc5fa54ba1da257706ca2b5ef3c987/lib/rtnetlink.c:398:14: branch_false: ...to here
fcoe-utils-b233050792cc5fa54ba1da257706ca2b5ef3c987/lib/rtnetlink.c:398:14: call_function: calling ‘rtnl_send_getlink’ from ‘rtnl_get_linkname’
#  367|   
#  368|   	RTNL_LOG_DBG("sending RTM_GETLINK");
#  369|-> 	rc = send(s, &req, req.nh.nlmsg_len, 0);
#  370|   	if (rc < 0)
#  371|   		RTNL_LOG_ERRNO("netlink send error");

Error: GCC_ANALYZER_WARNING (CWE-775): [#def63]
fcoe-utils-b233050792cc5fa54ba1da257706ca2b5ef3c987/lib/rtnetlink.c:398:9: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘s’
fcoe-utils-b233050792cc5fa54ba1da257706ca2b5ef3c987/lib/rtnetlink.c:390:5: enter_function: entry to ‘rtnl_get_linkname’
fcoe-utils-b233050792cc5fa54ba1da257706ca2b5ef3c987/lib/rtnetlink.c:395:13: acquire_resource: datagram socket created here
fcoe-utils-b233050792cc5fa54ba1da257706ca2b5ef3c987/lib/rtnetlink.c:396:12: branch_false: following ‘false’ branch (when ‘s >= 0’)...
fcoe-utils-b233050792cc5fa54ba1da257706ca2b5ef3c987/lib/rtnetlink.c:398:14: branch_false: ...to here
fcoe-utils-b233050792cc5fa54ba1da257706ca2b5ef3c987/lib/rtnetlink.c:398:14: call_function: calling ‘rtnl_send_getlink’ from ‘rtnl_get_linkname’
fcoe-utils-b233050792cc5fa54ba1da257706ca2b5ef3c987/lib/rtnetlink.c:398:14: return_function: returning to ‘rtnl_get_linkname’ from ‘rtnl_send_getlink’
fcoe-utils-b233050792cc5fa54ba1da257706ca2b5ef3c987/lib/rtnetlink.c:399:12: branch_true: following ‘true’ branch...
fcoe-utils-b233050792cc5fa54ba1da257706ca2b5ef3c987/lib/rtnetlink.c:399:12: branch_true: ...to here
fcoe-utils-b233050792cc5fa54ba1da257706ca2b5ef3c987/lib/rtnetlink.c:398:9: danger: ‘s’ leaks here
#  396|   	if (s < 0)
#  397|   		return s;
#  398|-> 	rc = rtnl_send_getlink(s, ifindex, NULL);
#  399|   	if (rc < 0)
#  400|   		return rc;

Error: GCC_ANALYZER_WARNING (CWE-775): [#def64]
fcoe-utils-b233050792cc5fa54ba1da257706ca2b5ef3c987/lib/rtnetlink.c:519:34: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘rtnl_socket(0)’
fcoe-utils-b233050792cc5fa54ba1da257706ca2b5ef3c987/lib/rtnetlink.c:482:5: enter_function: entry to ‘rtnl_get_sanmac’
fcoe-utils-b233050792cc5fa54ba1da257706ca2b5ef3c987/lib/rtnetlink.c:511:9: call_function: calling ‘add_rtattr’ from ‘rtnl_get_sanmac’
fcoe-utils-b233050792cc5fa54ba1da257706ca2b5ef3c987/lib/rtnetlink.c:511:9: return_function: returning to ‘rtnl_get_sanmac’ from ‘add_rtattr’
fcoe-utils-b233050792cc5fa54ba1da257706ca2b5ef3c987/lib/rtnetlink.c:513:13: call_function: calling ‘rtnl_socket’ from ‘rtnl_get_sanmac’
fcoe-utils-b233050792cc5fa54ba1da257706ca2b5ef3c987/lib/rtnetlink.c:513:13: return_function: returning to ‘rtnl_get_sanmac’ from ‘rtnl_socket’
fcoe-utils-b233050792cc5fa54ba1da257706ca2b5ef3c987/lib/rtnetlink.c:514:12: branch_false: following ‘false’ branch...
fcoe-utils-b233050792cc5fa54ba1da257706ca2b5ef3c987/lib/rtnetlink.c:519:34: branch_false: ...to here
fcoe-utils-b233050792cc5fa54ba1da257706ca2b5ef3c987/lib/rtnetlink.c:519:14: throw: if ‘send’ throws an exception...
fcoe-utils-b233050792cc5fa54ba1da257706ca2b5ef3c987/lib/rtnetlink.c:519:34: danger: ‘rtnl_socket(0)’ leaks here
#  517|   	}
#  518|   
#  519|-> 	rc = send(s, (void *)nh, nh->nlmsg_len, 0);
#  520|   	if (rc < 0) {
#  521|   		RTNL_LOG_ERRNO("failed to send to the socket");

Error: GCC_ANALYZER_WARNING (CWE-401): [#def65]
fcoe-utils-b233050792cc5fa54ba1da257706ca2b5ef3c987/lib/sa_sys.c:177:30: warning[-Wanalyzer-malloc-leak]: leak of ‘opendir(dir_name)’
fcoe-utils-b233050792cc5fa54ba1da257706ca2b5ef3c987/lib/sa_sys.c:173:15: acquire_memory: allocated here
fcoe-utils-b233050792cc5fa54ba1da257706ca2b5ef3c987/lib/sa_sys.c:174:12: branch_false: following ‘false’ branch...
fcoe-utils-b233050792cc5fa54ba1da257706ca2b5ef3c987/lib/sa_sys.c:174:12: branch_false: ...to here
fcoe-utils-b233050792cc5fa54ba1da257706ca2b5ef3c987/lib/sa_sys.c:177:30: throw: if ‘readdir’ throws an exception...
fcoe-utils-b233050792cc5fa54ba1da257706ca2b5ef3c987/lib/sa_sys.c:177:30: danger: ‘opendir(dir_name)’ leaks here; was allocated at [(1)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/0)
#  175|   		error = errno;
#  176|   	else {
#  177|-> 		while ((dp = readdir(dir)) != NULL && error == 0) {
#  178|   			if (dp->d_name[0] == '.' && (dp->d_name[1] == '\0' ||
#  179|   			   (dp->d_name[1] == '.' && dp->d_name[2] == '\0')))

Error: GCC_ANALYZER_WARNING (CWE-688): [#def66]
fcoe-utils-b233050792cc5fa54ba1da257706ca2b5ef3c987/lib/sysfs_hba.c:62:14: warning[-Wanalyzer-null-argument]: use of NULL ‘host’ where non-null expected
fcoe-utils-b233050792cc5fa54ba1da257706ca2b5ef3c987/lib/sysfs_hba.c:56:12: branch_false: following ‘false’ branch (when ‘ret != -1’)...
fcoe-utils-b233050792cc5fa54ba1da257706ca2b5ef3c987/lib/sysfs_hba.c:59:16: branch_false: ...to here
fcoe-utils-b233050792cc5fa54ba1da257706ca2b5ef3c987/lib/sysfs_hba.c:62:14: danger: argument 1 (‘host’) NULL where non-null expected
#   60|   	rport = strstr(link, "rport");
#   61|   
#   62|-> 	host[strlen(host) - strlen(rport) - 1] = '\0';
#   63|   
#   64|   	return get_port_attribs(host);

Error: GCC_ANALYZER_WARNING (CWE-688): [#def67]
fcoe-utils-b233050792cc5fa54ba1da257706ca2b5ef3c987/lib/sysfs_hba.c:62:29: warning[-Wanalyzer-null-argument]: use of NULL ‘rport’ where non-null expected
fcoe-utils-b233050792cc5fa54ba1da257706ca2b5ef3c987/lib/sysfs_hba.c:56:12: branch_false: following ‘false’ branch (when ‘ret != -1’)...
fcoe-utils-b233050792cc5fa54ba1da257706ca2b5ef3c987/lib/sysfs_hba.c:59:16: branch_false: ...to here
fcoe-utils-b233050792cc5fa54ba1da257706ca2b5ef3c987/lib/sysfs_hba.c:62:29: danger: argument 1 (‘rport’) NULL where non-null expected
#   60|   	rport = strstr(link, "rport");
#   61|   
#   62|-> 	host[strlen(host) - strlen(rport) - 1] = '\0';
#   63|   
#   64|   	return get_port_attribs(host);

Error: GCC_ANALYZER_WARNING (CWE-688): [#def68]
fcoe-utils-b233050792cc5fa54ba1da257706ca2b5ef3c987/lib/sysfs_hba.c:81:15: warning[-Wanalyzer-null-argument]: use of NULL ‘rport’ where non-null expected
fcoe-utils-b233050792cc5fa54ba1da257706ca2b5ef3c987/lib/sysfs_hba.c:75:12: branch_false: following ‘false’ branch (when ‘ret != -1’)...
fcoe-utils-b233050792cc5fa54ba1da257706ca2b5ef3c987/lib/sysfs_hba.c:78:18: branch_false: ...to here
fcoe-utils-b233050792cc5fa54ba1da257706ca2b5ef3c987/lib/sysfs_hba.c:81:15: danger: argument 1 (‘rport’) NULL where non-null expected
#   79|   	rport = strstr(link, "rport");
#   80|   
#   81|-> 	rport[strlen(rport) - strlen(target) - 1] = '\0';
#   82|   
#   83|   	return get_rport_attribs(rport);

Error: GCC_ANALYZER_WARNING (CWE-688): [#def69]
fcoe-utils-b233050792cc5fa54ba1da257706ca2b5ef3c987/lib/sysfs_hba.c:81:31: warning[-Wanalyzer-null-argument]: use of NULL ‘target’ where non-null expected
fcoe-utils-b233050792cc5fa54ba1da257706ca2b5ef3c987/lib/sysfs_hba.c:75:12: branch_false: following ‘false’ branch (when ‘ret != -1’)...
fcoe-utils-b233050792cc5fa54ba1da257706ca2b5ef3c987/lib/sysfs_hba.c:78:18: branch_false: ...to here
fcoe-utils-b233050792cc5fa54ba1da257706ca2b5ef3c987/lib/sysfs_hba.c:81:31: danger: argument 1 (‘target’) NULL where non-null expected
#   79|   	rport = strstr(link, "rport");
#   80|   
#   81|-> 	rport[strlen(rport) - strlen(target) - 1] = '\0';
#   82|   
#   83|   	return get_rport_attribs(rport);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def70]
fcoe-utils-b233050792cc5fa54ba1da257706ca2b5ef3c987/lib/sysfs_hba.c:213:17: warning[-Wanalyzer-malloc-leak]: leak of ‘info’
fcoe-utils-b233050792cc5fa54ba1da257706ca2b5ef3c987/lib/sysfs_hba.c:268:18: enter_function: entry to ‘get_hbainfo_by_pcidev’
fcoe-utils-b233050792cc5fa54ba1da257706ca2b5ef3c987/lib/sysfs_hba.c:277:12: branch_false: following ‘false’ branch...
fcoe-utils-b233050792cc5fa54ba1da257706ca2b5ef3c987/lib/sysfs_hba.c:280:16: branch_false: ...to here
fcoe-utils-b233050792cc5fa54ba1da257706ca2b5ef3c987/lib/sysfs_hba.c:280:16: acquire_memory: allocated here
fcoe-utils-b233050792cc5fa54ba1da257706ca2b5ef3c987/lib/sysfs_hba.c:281:12: branch_false: following ‘false’ branch (when ‘info’ is non-NULL)...
fcoe-utils-b233050792cc5fa54ba1da257706ca2b5ef3c987/lib/sysfs_hba.c:284:9: branch_false: ...to here
fcoe-utils-b233050792cc5fa54ba1da257706ca2b5ef3c987/lib/sysfs_hba.c:288:12: branch_false: following ‘false’ branch...
fcoe-utils-b233050792cc5fa54ba1da257706ca2b5ef3c987/lib/sysfs_hba.c:288:12: branch_false: ...to here
fcoe-utils-b233050792cc5fa54ba1da257706ca2b5ef3c987/lib/sysfs_hba.c:295:20: branch_false: following ‘false’ branch...
fcoe-utils-b233050792cc5fa54ba1da257706ca2b5ef3c987/lib/sysfs_hba.c:297:17: branch_false: ...to here
fcoe-utils-b233050792cc5fa54ba1da257706ca2b5ef3c987/lib/sysfs_hba.c:297:17: call_function: calling ‘get_pci_device_info’ from ‘get_hbainfo_by_pcidev’
#  211|   	uint8_t revision;
#  212|   
#  213|-> 	vname = pci_device_get_vendor_name(dev);
#  214|   	if (!vname)
#  215|   		vname = unknown;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def71]
fcoe-utils-b233050792cc5fa54ba1da257706ca2b5ef3c987/lib/sysfs_hba.c:287:20: warning[-Wanalyzer-malloc-leak]: leak of ‘info’
fcoe-utils-b233050792cc5fa54ba1da257706ca2b5ef3c987/lib/sysfs_hba.c:277:12: branch_false: following ‘false’ branch...
fcoe-utils-b233050792cc5fa54ba1da257706ca2b5ef3c987/lib/sysfs_hba.c:280:16: branch_false: ...to here
fcoe-utils-b233050792cc5fa54ba1da257706ca2b5ef3c987/lib/sysfs_hba.c:280:16: acquire_memory: allocated here
fcoe-utils-b233050792cc5fa54ba1da257706ca2b5ef3c987/lib/sysfs_hba.c:281:12: branch_false: following ‘false’ branch (when ‘info’ is non-NULL)...
fcoe-utils-b233050792cc5fa54ba1da257706ca2b5ef3c987/lib/sysfs_hba.c:284:9: branch_false: ...to here
fcoe-utils-b233050792cc5fa54ba1da257706ca2b5ef3c987/lib/sysfs_hba.c:287:20: throw: if ‘pci_slot_match_iterator_create’ throws an exception...
fcoe-utils-b233050792cc5fa54ba1da257706ca2b5ef3c987/lib/sysfs_hba.c:287:20: danger: ‘info’ leaks here; was allocated at [(3)](sarif:/runs/0/results/5/codeFlows/0/threadFlows/0/locations/2)
#  285|   	       &match.func);
#  286|   
#  287|-> 	iterator = pci_slot_match_iterator_create(&match);
#  288|   	if (!iterator) {
#  289|   		free(info);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def72]
fcoe-utils-b233050792cc5fa54ba1da257706ca2b5ef3c987/lib/sysfs_hba.c:294:23: warning[-Wanalyzer-malloc-leak]: leak of ‘info’
fcoe-utils-b233050792cc5fa54ba1da257706ca2b5ef3c987/lib/sysfs_hba.c:277:12: branch_false: following ‘false’ branch...
fcoe-utils-b233050792cc5fa54ba1da257706ca2b5ef3c987/lib/sysfs_hba.c:280:16: branch_false: ...to here
fcoe-utils-b233050792cc5fa54ba1da257706ca2b5ef3c987/lib/sysfs_hba.c:280:16: acquire_memory: allocated here
fcoe-utils-b233050792cc5fa54ba1da257706ca2b5ef3c987/lib/sysfs_hba.c:281:12: branch_false: following ‘false’ branch (when ‘info’ is non-NULL)...
fcoe-utils-b233050792cc5fa54ba1da257706ca2b5ef3c987/lib/sysfs_hba.c:284:9: branch_false: ...to here
fcoe-utils-b233050792cc5fa54ba1da257706ca2b5ef3c987/lib/sysfs_hba.c:288:12: branch_false: following ‘false’ branch...
fcoe-utils-b233050792cc5fa54ba1da257706ca2b5ef3c987/lib/sysfs_hba.c:288:12: branch_false: ...to here
fcoe-utils-b233050792cc5fa54ba1da257706ca2b5ef3c987/lib/sysfs_hba.c:294:23: throw: if ‘pci_device_next’ throws an exception...
fcoe-utils-b233050792cc5fa54ba1da257706ca2b5ef3c987/lib/sysfs_hba.c:294:23: danger: ‘info’ leaks here; was allocated at [(3)](sarif:/runs/0/results/6/codeFlows/0/threadFlows/0/locations/2)
#  292|   
#  293|   	for (;;) {
#  294|-> 		dev = pci_device_next(iterator);
#  295|   		if (!dev)
#  296|   			break;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def73]
fcoe-utils-b233050792cc5fa54ba1da257706ca2b5ef3c987/lib/sysfs_hba.c:302:9: warning[-Wanalyzer-malloc-leak]: leak of ‘info’
fcoe-utils-b233050792cc5fa54ba1da257706ca2b5ef3c987/lib/sysfs_hba.c:277:12: branch_false: following ‘false’ branch...
fcoe-utils-b233050792cc5fa54ba1da257706ca2b5ef3c987/lib/sysfs_hba.c:280:16: branch_false: ...to here
fcoe-utils-b233050792cc5fa54ba1da257706ca2b5ef3c987/lib/sysfs_hba.c:280:16: acquire_memory: allocated here
fcoe-utils-b233050792cc5fa54ba1da257706ca2b5ef3c987/lib/sysfs_hba.c:281:12: branch_false: following ‘false’ branch (when ‘info’ is non-NULL)...
fcoe-utils-b233050792cc5fa54ba1da257706ca2b5ef3c987/lib/sysfs_hba.c:284:9: branch_false: ...to here
fcoe-utils-b233050792cc5fa54ba1da257706ca2b5ef3c987/lib/sysfs_hba.c:288:12: branch_false: following ‘false’ branch...
fcoe-utils-b233050792cc5fa54ba1da257706ca2b5ef3c987/lib/sysfs_hba.c:288:12: branch_false: ...to here
fcoe-utils-b233050792cc5fa54ba1da257706ca2b5ef3c987/lib/sysfs_hba.c:295:20: branch_true: following ‘true’ branch...
fcoe-utils-b233050792cc5fa54ba1da257706ca2b5ef3c987/lib/sysfs_hba.c:301:9: branch_true: ...to here
fcoe-utils-b233050792cc5fa54ba1da257706ca2b5ef3c987/lib/sysfs_hba.c:302:9: throw: if ‘pci_system_cleanup’ throws an exception...
fcoe-utils-b233050792cc5fa54ba1da257706ca2b5ef3c987/lib/sysfs_hba.c:302:9: danger: ‘info’ leaks here; was allocated at [(3)](sarif:/runs/0/results/7/codeFlows/0/threadFlows/0/locations/2)
#  300|   
#  301|   	free(iterator);
#  302|-> 	pci_system_cleanup();
#  303|   
#  304|   	return info;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def74]
fcoe-utils-b233050792cc5fa54ba1da257706ca2b5ef3c987/lib/sysfs_hba.c:359:9: warning[-Wanalyzer-malloc-leak]: leak of ‘ps’
fcoe-utils-b233050792cc5fa54ba1da257706ca2b5ef3c987/lib/sysfs_hba.c:352:12: branch_false: following ‘false’ branch...
fcoe-utils-b233050792cc5fa54ba1da257706ca2b5ef3c987/lib/sysfs_hba.c:355:14: branch_false: ...to here
fcoe-utils-b233050792cc5fa54ba1da257706ca2b5ef3c987/lib/sysfs_hba.c:355:14: acquire_memory: allocated here
fcoe-utils-b233050792cc5fa54ba1da257706ca2b5ef3c987/lib/sysfs_hba.c:356:12: branch_false: following ‘false’ branch (when ‘ps’ is non-NULL)...
fcoe-utils-b233050792cc5fa54ba1da257706ca2b5ef3c987/lib/sysfs_hba.c:360:25: branch_false: ...to here
fcoe-utils-b233050792cc5fa54ba1da257706ca2b5ef3c987/lib/sysfs_hba.c:359:9: throw: if ‘sa_sys_read_u64’ throws an exception...
fcoe-utils-b233050792cc5fa54ba1da257706ca2b5ef3c987/lib/sysfs_hba.c:359:9: danger: ‘ps’ leaks here; was allocated at [(3)](sarif:/runs/0/results/8/codeFlows/0/threadFlows/0/locations/2)
#  357|   		goto free_path;
#  358|   
#  359|-> 	sa_sys_read_u64(path, "seconds_since_last_reset",
#  360|   			&ps->seconds_since_last_reset);
#  361|   	sa_sys_read_u64(path, "tx_frames", &ps->tx_frames);

Error: GCC_ANALYZER_WARNING (CWE-457): [#def75]
fcoe-utils-b233050792cc5fa54ba1da257706ca2b5ef3c987/lib/sysfs_hba.c:482:15: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘func’
fcoe-utils-b233050792cc5fa54ba1da257706ca2b5ef3c987/lib/sysfs_hba.c:437:12: branch_false: following ‘false’ branch...
fcoe-utils-b233050792cc5fa54ba1da257706ca2b5ef3c987/lib/sysfs_hba.c:440:15: branch_false: ...to here
fcoe-utils-b233050792cc5fa54ba1da257706ca2b5ef3c987/lib/sysfs_hba.c:442:12: branch_false: following ‘false’ branch (when ‘ret != -1’)...
fcoe-utils-b233050792cc5fa54ba1da257706ca2b5ef3c987/lib/sysfs_hba.c:442:12: branch_false: ...to here
fcoe-utils-b233050792cc5fa54ba1da257706ca2b5ef3c987/lib/sysfs_hba.c:472:20: branch_true: following ‘true’ branch (when ‘cp’ is NULL)...
fcoe-utils-b233050792cc5fa54ba1da257706ca2b5ef3c987/lib/sysfs_hba.c:482:15: branch_true: ...to here
fcoe-utils-b233050792cc5fa54ba1da257706ca2b5ef3c987/lib/sysfs_hba.c:482:15: danger: use of uninitialized value ‘func’ here
#  480|   	} while (cp && cp > buf);
#  481|   
#  482|-> 	ret = asprintf(&pcidev, "%04x:%02x:%02x.%x", dom, bus, dev, func);
#  483|   	if (ret == -1)
#  484|   		return NULL;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def76]
fcoe-utils-b233050792cc5fa54ba1da257706ca2b5ef3c987/lib/sysfs_hba.c:502:19: warning[-Wanalyzer-malloc-leak]: leak of ‘opendir("/sys/class/fc_host")’
fcoe-utils-b233050792cc5fa54ba1da257706ca2b5ef3c987/lib/sysfs_hba.c:498:15: acquire_memory: allocated here
fcoe-utils-b233050792cc5fa54ba1da257706ca2b5ef3c987/lib/sysfs_hba.c:499:12: branch_false: following ‘false’ branch...
fcoe-utils-b233050792cc5fa54ba1da257706ca2b5ef3c987/lib/sysfs_hba.c:502:19: branch_false: ...to here
fcoe-utils-b233050792cc5fa54ba1da257706ca2b5ef3c987/lib/sysfs_hba.c:502:19: throw: if ‘readdir’ throws an exception...
fcoe-utils-b233050792cc5fa54ba1da257706ca2b5ef3c987/lib/sysfs_hba.c:502:19: danger: ‘opendir("/sys/class/fc_host")’ leaks here; was allocated at [(1)](sarif:/runs/0/results/10/codeFlows/0/threadFlows/0/locations/0)
#  500|   		return NULL;
#  501|   
#  502|-> 	for (dp = readdir(dir); dp != NULL; dp = readdir(dir)) {
#  503|   		if (dp->d_name[0] == '.' && dp->d_name[1] == '\0')
#  504|   			continue;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def77]
fcoe-utils-b233050792cc5fa54ba1da257706ca2b5ef3c987/lib/sysfs_hba.c:520:9: warning[-Wanalyzer-malloc-leak]: leak of ‘host’
fcoe-utils-b233050792cc5fa54ba1da257706ca2b5ef3c987/lib/sysfs_hba.c:499:12: branch_false: following ‘false’ branch...
fcoe-utils-b233050792cc5fa54ba1da257706ca2b5ef3c987/lib/sysfs_hba.c:502:19: branch_false: ...to here
fcoe-utils-b233050792cc5fa54ba1da257706ca2b5ef3c987/lib/sysfs_hba.c:502:33: branch_true: following ‘true’ branch (when ‘dp’ is non-NULL)...
fcoe-utils-b233050792cc5fa54ba1da257706ca2b5ef3c987/lib/sysfs_hba.c:503:21: branch_true: ...to here
fcoe-utils-b233050792cc5fa54ba1da257706ca2b5ef3c987/lib/sysfs_hba.c:516:24: acquire_memory: allocated here
fcoe-utils-b233050792cc5fa54ba1da257706ca2b5ef3c987/lib/sysfs_hba.c:520:9: throw: if ‘closedir’ throws an exception...
fcoe-utils-b233050792cc5fa54ba1da257706ca2b5ef3c987/lib/sysfs_hba.c:520:9: danger: ‘host’ leaks here; was allocated at [(5)](sarif:/runs/0/results/11/codeFlows/0/threadFlows/0/locations/4)
#  518|   	}
#  519|   
#  520|-> 	closedir(dir);
#  521|   
#  522|   	return host;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def78]
fcoe-utils-b233050792cc5fa54ba1da257706ca2b5ef3c987/lib/sysfs_hba.c:537:19: warning[-Wanalyzer-malloc-leak]: leak of ‘opendir("/sys/class/fc_host")’
fcoe-utils-b233050792cc5fa54ba1da257706ca2b5ef3c987/lib/sysfs_hba.c:533:15: acquire_memory: allocated here
fcoe-utils-b233050792cc5fa54ba1da257706ca2b5ef3c987/lib/sysfs_hba.c:534:12: branch_false: following ‘false’ branch...
fcoe-utils-b233050792cc5fa54ba1da257706ca2b5ef3c987/lib/sysfs_hba.c:537:19: branch_false: ...to here
fcoe-utils-b233050792cc5fa54ba1da257706ca2b5ef3c987/lib/sysfs_hba.c:537:19: throw: if ‘readdir’ throws an exception...
fcoe-utils-b233050792cc5fa54ba1da257706ca2b5ef3c987/lib/sysfs_hba.c:537:19: danger: ‘opendir("/sys/class/fc_host")’ leaks here; was allocated at [(1)](sarif:/runs/0/results/12/codeFlows/0/threadFlows/0/locations/0)
#  535|   		return NULL;
#  536|   
#  537|-> 	for (dp = readdir(dir); dp != NULL; dp = readdir(dir)) {
#  538|   		if (dp->d_name[0] == '.' && dp->d_name[1] == '\0')
#  539|   			continue;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def79]
fcoe-utils-b233050792cc5fa54ba1da257706ca2b5ef3c987/lib/sysfs_hba.c:554:9: warning[-Wanalyzer-malloc-leak]: leak of ‘host’
fcoe-utils-b233050792cc5fa54ba1da257706ca2b5ef3c987/lib/sysfs_hba.c:534:12: branch_false: following ‘false’ branch...
fcoe-utils-b233050792cc5fa54ba1da257706ca2b5ef3c987/lib/sysfs_hba.c:537:19: branch_false: ...to here
fcoe-utils-b233050792cc5fa54ba1da257706ca2b5ef3c987/lib/sysfs_hba.c:537:33: branch_true: following ‘true’ branch (when ‘dp’ is non-NULL)...
fcoe-utils-b233050792cc5fa54ba1da257706ca2b5ef3c987/lib/sysfs_hba.c:538:21: branch_true: ...to here
fcoe-utils-b233050792cc5fa54ba1da257706ca2b5ef3c987/lib/sysfs_hba.c:550:24: acquire_memory: allocated here
fcoe-utils-b233050792cc5fa54ba1da257706ca2b5ef3c987/lib/sysfs_hba.c:554:9: throw: if ‘closedir’ throws an exception...
fcoe-utils-b233050792cc5fa54ba1da257706ca2b5ef3c987/lib/sysfs_hba.c:554:9: danger: ‘host’ leaks here; was allocated at [(5)](sarif:/runs/0/results/13/codeFlows/0/threadFlows/0/locations/4)
#  552|   	}
#  553|   
#  554|-> 	closedir(dir);
#  555|   
#  556|   	return host;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def80]
fcoe-utils-b233050792cc5fa54ba1da257706ca2b5ef3c987/lib/sysfs_hba.c:571:19: warning[-Wanalyzer-malloc-leak]: leak of ‘opendir("/sys/class/fc_remote_ports")’
fcoe-utils-b233050792cc5fa54ba1da257706ca2b5ef3c987/lib/sysfs_hba.c:567:15: acquire_memory: allocated here
fcoe-utils-b233050792cc5fa54ba1da257706ca2b5ef3c987/lib/sysfs_hba.c:568:12: branch_false: following ‘false’ branch...
fcoe-utils-b233050792cc5fa54ba1da257706ca2b5ef3c987/lib/sysfs_hba.c:571:19: branch_false: ...to here
fcoe-utils-b233050792cc5fa54ba1da257706ca2b5ef3c987/lib/sysfs_hba.c:571:19: throw: if ‘readdir’ throws an exception...
fcoe-utils-b233050792cc5fa54ba1da257706ca2b5ef3c987/lib/sysfs_hba.c:571:19: danger: ‘opendir("/sys/class/fc_remote_ports")’ leaks here; was allocated at [(1)](sarif:/runs/0/results/14/codeFlows/0/threadFlows/0/locations/0)
#  569|   		return NULL;
#  570|   
#  571|-> 	for (dp = readdir(dir); dp != NULL; dp = readdir(dir)) {
#  572|   		if (dp->d_name[0] == '.' && dp->d_name[1] == '\0')
#  573|   			continue;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def81]
fcoe-utils-b233050792cc5fa54ba1da257706ca2b5ef3c987/lib/sysfs_hba.c:588:9: warning[-Wanalyzer-malloc-leak]: leak of ‘rport’
fcoe-utils-b233050792cc5fa54ba1da257706ca2b5ef3c987/lib/sysfs_hba.c:568:12: branch_false: following ‘false’ branch...
fcoe-utils-b233050792cc5fa54ba1da257706ca2b5ef3c987/lib/sysfs_hba.c:571:19: branch_false: ...to here
fcoe-utils-b233050792cc5fa54ba1da257706ca2b5ef3c987/lib/sysfs_hba.c:571:33: branch_true: following ‘true’ branch (when ‘dp’ is non-NULL)...
fcoe-utils-b233050792cc5fa54ba1da257706ca2b5ef3c987/lib/sysfs_hba.c:572:21: branch_true: ...to here
fcoe-utils-b233050792cc5fa54ba1da257706ca2b5ef3c987/lib/sysfs_hba.c:584:25: acquire_memory: allocated here
fcoe-utils-b233050792cc5fa54ba1da257706ca2b5ef3c987/lib/sysfs_hba.c:588:9: throw: if ‘closedir’ throws an exception...
fcoe-utils-b233050792cc5fa54ba1da257706ca2b5ef3c987/lib/sysfs_hba.c:588:9: danger: ‘rport’ leaks here; was allocated at [(5)](sarif:/runs/0/results/15/codeFlows/0/threadFlows/0/locations/4)
#  586|   	}
#  587|   
#  588|-> 	closedir(dir);
#  589|   
#  590|   	return rport;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def82]
fcoe-utils-b233050792cc5fa54ba1da257706ca2b5ef3c987/lib/sysfs_hba.c:607:19: warning[-Wanalyzer-malloc-leak]: leak of ‘opendir(&path)’
fcoe-utils-b233050792cc5fa54ba1da257706ca2b5ef3c987/lib/sysfs_hba.c:603:15: acquire_memory: allocated here
fcoe-utils-b233050792cc5fa54ba1da257706ca2b5ef3c987/lib/sysfs_hba.c:604:12: branch_false: following ‘false’ branch...
fcoe-utils-b233050792cc5fa54ba1da257706ca2b5ef3c987/lib/sysfs_hba.c:607:19: branch_false: ...to here
fcoe-utils-b233050792cc5fa54ba1da257706ca2b5ef3c987/lib/sysfs_hba.c:607:19: throw: if ‘readdir’ throws an exception...
fcoe-utils-b233050792cc5fa54ba1da257706ca2b5ef3c987/lib/sysfs_hba.c:607:19: danger: ‘opendir(&path)’ leaks here; was allocated at [(1)](sarif:/runs/0/results/16/codeFlows/0/threadFlows/0/locations/0)
#  605|   		return -1;
#  606|   
#  607|-> 	for (dp = readdir(dir); dp != NULL; dp = readdir(dir)) {
#  608|   		if (dp->d_name[0] == '.' && dp->d_name[1] == '\0')
#  609|   			continue;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def83]
fcoe-utils-b233050792cc5fa54ba1da257706ca2b5ef3c987/lib/sysfs_hba.c:645:9: warning[-Wanalyzer-malloc-leak]: leak of ‘opendir(path)’
fcoe-utils-b233050792cc5fa54ba1da257706ca2b5ef3c987/lib/sysfs_hba.c:626:7: enter_function: entry to ‘get_host_from_netdev’
fcoe-utils-b233050792cc5fa54ba1da257706ca2b5ef3c987/lib/sysfs_hba.c:635:20: call_function: calling ‘get_ctlr_num’ from ‘get_host_from_netdev’
fcoe-utils-b233050792cc5fa54ba1da257706ca2b5ef3c987/lib/sysfs_hba.c:635:20: return_function: returning to ‘get_host_from_netdev’ from ‘get_ctlr_num’
fcoe-utils-b233050792cc5fa54ba1da257706ca2b5ef3c987/lib/sysfs_hba.c:636:12: branch_false: following ‘false’ branch...
fcoe-utils-b233050792cc5fa54ba1da257706ca2b5ef3c987/lib/sysfs_hba.c:639:15: call_function: inlined call to ‘asprintf’ from ‘get_host_from_netdev’
fcoe-utils-b233050792cc5fa54ba1da257706ca2b5ef3c987/lib/sysfs_hba.c:641:12: branch_false: following ‘false’ branch...
fcoe-utils-b233050792cc5fa54ba1da257706ca2b5ef3c987/lib/sysfs_hba.c:644:15: branch_false: ...to here
fcoe-utils-b233050792cc5fa54ba1da257706ca2b5ef3c987/lib/sysfs_hba.c:644:15: acquire_memory: allocated here
fcoe-utils-b233050792cc5fa54ba1da257706ca2b5ef3c987/lib/sysfs_hba.c:648:12: branch_false: following ‘false’ branch...
fcoe-utils-b233050792cc5fa54ba1da257706ca2b5ef3c987/lib/sysfs_hba.c:651:19: branch_false: ...to here
fcoe-utils-b233050792cc5fa54ba1da257706ca2b5ef3c987/lib/sysfs_hba.c:651:19: throw: if ‘readdir’ throws an exception...
fcoe-utils-b233050792cc5fa54ba1da257706ca2b5ef3c987/lib/sysfs_hba.c:645:9: danger: ‘opendir(path)’ leaks here; was allocated at [(15)](sarif:/runs/0/results/17/codeFlows/0/threadFlows/0/locations/14)
#  643|   
#  644|   	dir = opendir(path);
#  645|-> 	free(path);
#  646|   	path = NULL;
#  647|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def84]
fcoe-utils-b233050792cc5fa54ba1da257706ca2b5ef3c987/lib/sysfs_hba.c:693:19: warning[-Wanalyzer-malloc-leak]: leak of ‘opendir("/sys/class/fc_host")’
fcoe-utils-b233050792cc5fa54ba1da257706ca2b5ef3c987/lib/sysfs_hba.c:689:15: acquire_memory: allocated here
fcoe-utils-b233050792cc5fa54ba1da257706ca2b5ef3c987/lib/sysfs_hba.c:690:12: branch_false: following ‘false’ branch...
fcoe-utils-b233050792cc5fa54ba1da257706ca2b5ef3c987/lib/sysfs_hba.c:693:19: branch_false: ...to here
fcoe-utils-b233050792cc5fa54ba1da257706ca2b5ef3c987/lib/sysfs_hba.c:693:19: throw: if ‘readdir’ throws an exception...
fcoe-utils-b233050792cc5fa54ba1da257706ca2b5ef3c987/lib/sysfs_hba.c:693:19: danger: ‘opendir("/sys/class/fc_host")’ leaks here; was allocated at [(1)](sarif:/runs/0/results/18/codeFlows/0/threadFlows/0/locations/0)
#  691|   		return errno;
#  692|   
#  693|-> 	for (dp = readdir(dir); dp != NULL; dp = readdir(dir)) {
#  694|   		if (dp->d_name[0] == '.' && dp->d_name[1] == '\0')
#  695|   			continue;

Scan Properties

analyzer-version-clippy1.92.0
analyzer-version-cppcheck2.19.1
analyzer-version-gcc16.0.0
analyzer-version-gcc-analyzer16.0.0
analyzer-version-shellcheck0.11.0
analyzer-version-unicontrol0.0.2
enabled-pluginsclippy, cppcheck, gcc, shellcheck, unicontrol
exit-code0
hostip-172-16-1-244.us-west-2.compute.internal
known-false-positives/usr/share/csmock/known-false-positives.js
known-false-positives-rpmknown-false-positives-0.0.0.20250521.132812.g8eff701.main-1.el9.noarch
mock-configfedora-rawhide-x86_64
project-namefcoe-utils-1.0.34-13.gitb233050.fc44
store-results-to/tmp/tmpuael157i/fcoe-utils-1.0.34-13.gitb233050.fc44.tar.xz
time-created2026-01-08 16:13:47
time-finished2026-01-08 16:15:03
toolcsmock
tool-args'/usr/bin/csmock' '-r' 'fedora-rawhide-x86_64' '-t' 'gcc,cppcheck,clippy,shellcheck,unicontrol' '-o' '/tmp/tmpuael157i/fcoe-utils-1.0.34-13.gitb233050.fc44.tar.xz' '--gcc-analyze' '--unicontrol-notests' '--unicontrol-bidi-only' '--install' 'pam' '--gcc-analyzer-bin=/usr/bin/gcc' '/tmp/tmpuael157i/fcoe-utils-1.0.34-13.gitb233050.fc44.src.rpm'
tool-versioncsmock-3.8.3.20251215.161544.g62de9a5-1.el9