iw-6.17-1.fc44

List of Findings

Error: GCC_ANALYZER_WARNING (CWE-775): [#def1]
iw-6.17/coalesce.c:37:20: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(*argv, "r")’
iw-6.17/coalesce.c:26:19: acquire_resource: opened here
iw-6.17/coalesce.c:34:12: branch_false: following ‘false’ branch...
iw-6.17/coalesce.c:37:20: branch_false: ...to here
iw-6.17/coalesce.c:37:20: throw: if ‘nla_nest_start’ throws an exception...
iw-6.17/coalesce.c:37:20: danger: ‘fopen(*argv, "r")’ leaks here; was opened at [(1)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/0)
#   35|   		return 1;
#   36|   
#   37|-> 	nl_rules = nla_nest_start(msg, NL80211_ATTR_COALESCE_RULE);
#   38|   	if (!nl_rules) {
#   39|   		fclose(f);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def2]
iw-6.17/coalesce.c:37:20: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(*argv, "r")’
iw-6.17/coalesce.c:26:19: acquire_memory: allocated here
iw-6.17/coalesce.c:34:12: branch_false: following ‘false’ branch...
iw-6.17/coalesce.c:37:20: branch_false: ...to here
iw-6.17/coalesce.c:37:20: throw: if ‘nla_nest_start’ throws an exception...
iw-6.17/coalesce.c:37:20: danger: ‘fopen(*argv, "r")’ leaks here; was allocated at [(1)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/0)
#   35|   		return 1;
#   36|   
#   37|-> 	nl_rules = nla_nest_start(msg, NL80211_ATTR_COALESCE_RULE);
#   38|   	if (!nl_rules) {
#   39|   		fclose(f);

Error: GCC_ANALYZER_WARNING (CWE-775): [#def3]
iw-6.17/coalesce.c:62:43: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(*argv, "r")’
iw-6.17/coalesce.c:26:19: acquire_resource: opened here
iw-6.17/coalesce.c:34:12: branch_false: following ‘false’ branch...
iw-6.17/coalesce.c:37:20: branch_false: ...to here
iw-6.17/coalesce.c:38:12: branch_false: following ‘false’ branch...
iw-6.17/coalesce.c:38:12: branch_false: ...to here
iw-6.17/coalesce.c:43:16: branch_true: following ‘true’ branch...
iw-6.17/coalesce.c:46:22: branch_true: ...to here
iw-6.17/coalesce.c:46:20: branch_false: following ‘false’ branch...
iw-6.17/coalesce.c:49:23: branch_false: ...to here
iw-6.17/coalesce.c:50:20: branch_false: following ‘false’ branch (when ‘eol’ is NULL)...
iw-6.17/coalesce.c:52:23: branch_false: ...to here
iw-6.17/coalesce.c:53:20: branch_false: following ‘false’ branch (when ‘eol’ is NULL)...
iw-6.17/coalesce.c:56:17: branch_false: ...to here
iw-6.17/coalesce.c:58:28: branch_true: following ‘true’ branch...
iw-6.17/coalesce.c:61:33: branch_true: ...to here
iw-6.17/coalesce.c:62:43: throw: if ‘nla_nest_start’ throws an exception...
iw-6.17/coalesce.c:62:43: danger: ‘fopen(*argv, "r")’ leaks here; was opened at [(1)](sarif:/runs/0/results/2/codeFlows/0/threadFlows/0/locations/0)
#   60|   
#   61|   				rule_num++;
#   62|-> 				nl_rule = nla_nest_start(msg, rule_num);
#   63|   				if (!nl_rule)
#   64|   					goto close;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def4]
iw-6.17/coalesce.c:62:43: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(*argv, "r")’
iw-6.17/coalesce.c:26:19: acquire_memory: allocated here
iw-6.17/coalesce.c:34:12: branch_false: following ‘false’ branch...
iw-6.17/coalesce.c:37:20: branch_false: ...to here
iw-6.17/coalesce.c:38:12: branch_false: following ‘false’ branch...
iw-6.17/coalesce.c:38:12: branch_false: ...to here
iw-6.17/coalesce.c:43:16: branch_true: following ‘true’ branch...
iw-6.17/coalesce.c:46:22: branch_true: ...to here
iw-6.17/coalesce.c:46:20: branch_false: following ‘false’ branch...
iw-6.17/coalesce.c:49:23: branch_false: ...to here
iw-6.17/coalesce.c:50:20: branch_false: following ‘false’ branch (when ‘eol’ is NULL)...
iw-6.17/coalesce.c:52:23: branch_false: ...to here
iw-6.17/coalesce.c:53:20: branch_false: following ‘false’ branch (when ‘eol’ is NULL)...
iw-6.17/coalesce.c:56:17: branch_false: ...to here
iw-6.17/coalesce.c:58:28: branch_true: following ‘true’ branch...
iw-6.17/coalesce.c:61:33: branch_true: ...to here
iw-6.17/coalesce.c:62:43: throw: if ‘nla_nest_start’ throws an exception...
iw-6.17/coalesce.c:62:43: danger: ‘fopen(*argv, "r")’ leaks here; was allocated at [(1)](sarif:/runs/0/results/3/codeFlows/0/threadFlows/0/locations/0)
#   60|   
#   61|   				rule_num++;
#   62|-> 				nl_rule = nla_nest_start(msg, rule_num);
#   63|   				if (!nl_rule)
#   64|   					goto close;

Error: GCC_ANALYZER_WARNING (CWE-775): [#def5]
iw-6.17/coalesce.c:66:33: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(*argv, "r")’
iw-6.17/coalesce.c:26:19: acquire_resource: opened here
iw-6.17/coalesce.c:34:12: branch_false: following ‘false’ branch...
iw-6.17/coalesce.c:37:20: branch_false: ...to here
iw-6.17/coalesce.c:38:12: branch_false: following ‘false’ branch...
iw-6.17/coalesce.c:38:12: branch_false: ...to here
iw-6.17/coalesce.c:43:16: branch_true: following ‘true’ branch...
iw-6.17/coalesce.c:46:22: branch_true: ...to here
iw-6.17/coalesce.c:46:20: branch_false: following ‘false’ branch...
iw-6.17/coalesce.c:49:23: branch_false: ...to here
iw-6.17/coalesce.c:50:20: branch_false: following ‘false’ branch (when ‘eol’ is NULL)...
iw-6.17/coalesce.c:52:23: branch_false: ...to here
iw-6.17/coalesce.c:53:20: branch_false: following ‘false’ branch (when ‘eol’ is NULL)...
iw-6.17/coalesce.c:56:17: branch_false: ...to here
iw-6.17/coalesce.c:58:28: branch_true: following ‘true’ branch...
iw-6.17/coalesce.c:61:33: branch_true: ...to here
iw-6.17/coalesce.c:63:36: branch_false: following ‘false’ branch...
iw-6.17/coalesce.c:66:33: branch_false: ...to here
iw-6.17/coalesce.c:66:33: throw: if ‘nla_put’ throws an exception...
iw-6.17/coalesce.c:66:33: danger: ‘fopen(*argv, "r")’ leaks here; was opened at [(1)](sarif:/runs/0/results/4/codeFlows/0/threadFlows/0/locations/0)
#   64|   					goto close;
#   65|   
#   66|-> 				NLA_PUT_U32(msg, NL80211_ATTR_COALESCE_RULE_DELAY,
#   67|   					    strtoul(delay, &end, 10));
#   68|   				if (*end != '\0')

Error: GCC_ANALYZER_WARNING (CWE-401): [#def6]
iw-6.17/coalesce.c:66:33: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(*argv, "r")’
iw-6.17/coalesce.c:26:19: acquire_memory: allocated here
iw-6.17/coalesce.c:34:12: branch_false: following ‘false’ branch...
iw-6.17/coalesce.c:37:20: branch_false: ...to here
iw-6.17/coalesce.c:38:12: branch_false: following ‘false’ branch...
iw-6.17/coalesce.c:38:12: branch_false: ...to here
iw-6.17/coalesce.c:43:16: branch_true: following ‘true’ branch...
iw-6.17/coalesce.c:46:22: branch_true: ...to here
iw-6.17/coalesce.c:46:20: branch_false: following ‘false’ branch...
iw-6.17/coalesce.c:49:23: branch_false: ...to here
iw-6.17/coalesce.c:50:20: branch_false: following ‘false’ branch (when ‘eol’ is NULL)...
iw-6.17/coalesce.c:52:23: branch_false: ...to here
iw-6.17/coalesce.c:53:20: branch_false: following ‘false’ branch (when ‘eol’ is NULL)...
iw-6.17/coalesce.c:56:17: branch_false: ...to here
iw-6.17/coalesce.c:58:28: branch_true: following ‘true’ branch...
iw-6.17/coalesce.c:61:33: branch_true: ...to here
iw-6.17/coalesce.c:63:36: branch_false: following ‘false’ branch...
iw-6.17/coalesce.c:66:33: branch_false: ...to here
iw-6.17/coalesce.c:66:33: throw: if ‘nla_put’ throws an exception...
iw-6.17/coalesce.c:66:33: danger: ‘fopen(*argv, "r")’ leaks here; was allocated at [(1)](sarif:/runs/0/results/5/codeFlows/0/threadFlows/0/locations/0)
#   64|   					goto close;
#   65|   
#   66|-> 				NLA_PUT_U32(msg, NL80211_ATTR_COALESCE_RULE_DELAY,
#   67|   					    strtoul(delay, &end, 10));
#   68|   				if (*end != '\0')

Error: GCC_ANALYZER_WARNING (CWE-401): [#def7]
iw-6.17/connect.c:157:15: warning[-Wanalyzer-malloc-leak]: leak of ‘conn_argv’
iw-6.17/connect.c:144:12: branch_false: following ‘false’ branch...
iw-6.17/connect.c:147:9: branch_false: ...to here
iw-6.17/connect.c:148:21: acquire_memory: allocated here
iw-6.17/connect.c:149:12: branch_false: following ‘false’ branch (when ‘conn_argv’ is non-NULL)...
iw-6.17/connect.c:152:9: branch_false: ...to here
iw-6.17/connect.c:157:15: throw: if ‘handle_cmd’ throws an exception...
iw-6.17/connect.c:157:15: danger: ‘conn_argv’ leaks here; was allocated at [(3)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/2)
#  155|   	for (i = 0; i < argc; i++)
#  156|   		conn_argv[i + 3] = argv[i];
#  157|-> 	err = handle_cmd(state, id, conn_argc, conn_argv);
#  158|   	free(conn_argv);
#  159|   	if (err)

Error: CPPCHECK_WARNING (CWE-758): [#def8]
iw-6.17/event.c:322: error[subtractPointers]: Subtracting pointers that point to different objects
#  320|   	printf("vendor event %.6x:%d", vendor_id, subcmd);
#  321|   
#  322|-> 	for (i = 0; i < &__stop_vendor_event - __start_vendor_event; i++) {
#  323|   		struct vendor_event *ev = __start_vendor_event[i];
#  324|   

Error: GCC_ANALYZER_WARNING (CWE-469): [#def9]
iw-6.17/event.c:322:46: warning[-Wanalyzer-undefined-behavior-ptrdiff]: undefined behavior when subtracting pointers
iw-6.17/event.c:313:12: branch_false: following ‘false’ branch...
iw-6.17/event.c:314:14: branch_false: ...to here
iw-6.17/event.c:313:13: branch_false: following ‘false’ branch...
iw-6.17/event.c:317:21: branch_false: ...to here
iw-6.17/event.c:322:46: danger: subtraction of pointers has undefined behavior if they do not point into the same array object
#  320|   	printf("vendor event %.6x:%d", vendor_id, subcmd);
#  321|   
#  322|-> 	for (i = 0; i < &__stop_vendor_event - __start_vendor_event; i++) {
#  323|   		struct vendor_event *ev = __start_vendor_event[i];
#  324|   

Error: CPPCHECK_WARNING (CWE-758): [#def10]
iw-6.17/info.c:365: error[shiftTooManyBitsSigned]: Shifting signed 32-bit value by 31 bits is undefined behaviour
#  363|   			printf(", radar detect widths: {");
#  364|   			for (width = 0; width < 32; width++)
#  365|-> 				if (widths & (1 << width)) {
#  366|   					printf("%s %s",
#  367|   					       first ? "":",",

Error: CPPCHECK_WARNING (CWE-758): [#def11]
iw-6.17/iw.c:197: error[subtractPointers]: Subtracting pointers that point to different objects
#  195|   	printf("\t--version\tshow version (%s)\n", iw_version);
#  196|   	printf("Commands:\n");
#  197|-> 	for_each_cmd(section, i) {
#  198|   		if (section->parent)
#  199|   			continue;

Error: GCC_ANALYZER_WARNING (CWE-469): [#def12]
iw-6.17/iw.c:197:9: warning[-Wanalyzer-undefined-behavior-ptrdiff]: undefined behavior when subtracting pointers
iw-6.17/iw.c:548:5: enter_function: entry to ‘main’
iw-6.17/iw.c:571:17: call_function: calling ‘usage’ from ‘main’
#  195|   	printf("\t--version\tshow version (%s)\n", iw_version);
#  196|   	printf("Commands:\n");
#  197|-> 	for_each_cmd(section, i) {
#  198|   		if (section->parent)
#  199|   			continue;

Error: CPPCHECK_WARNING (CWE-758): [#def13]
iw-6.17/iw.c:207: error[subtractPointers]: Subtracting pointers that point to different objects
#  205|   			__usage_cmd(section, "\t", full);
#  206|   
#  207|-> 		for_each_cmd(cmd, j) {
#  208|   			if (section != cmd->parent)
#  209|   				continue;

Error: GCC_ANALYZER_WARNING (CWE-775): [#def14]
iw-6.17/iw.c:262:17: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘open(&buf, 0)’
iw-6.17/iw.c:348:12: enter_function: entry to ‘__handle_cmd’
iw-6.17/iw.c:378:26: call_function: calling ‘phy_lookup’ from ‘__handle_cmd’
#  260|   	pos = read(fd, buf, sizeof(buf) - 1);
#  261|   	if (pos < 0) {
#  262|-> 		close(fd);
#  263|   		return -1;
#  264|   	}

Error: GCC_ANALYZER_WARNING (CWE-775): [#def15]
iw-6.17/iw.c:266:9: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘open(&buf, 0)’
iw-6.17/iw.c:348:12: enter_function: entry to ‘__handle_cmd’
iw-6.17/iw.c:378:26: call_function: calling ‘phy_lookup’ from ‘__handle_cmd’
#  264|   	}
#  265|   	buf[pos] = '\0';
#  266|-> 	close(fd);
#  267|   	return atoi(buf);
#  268|   }

Error: CPPCHECK_WARNING (CWE-758): [#def16]
iw-6.17/iw.c:408: error[subtractPointers]: Subtracting pointers that point to different objects
#  406|   	argv++;
#  407|   
#  408|-> 	for_each_cmd(sectcmd, i) {
#  409|   		if (sectcmd->parent)
#  410|   			continue;

Error: GCC_ANALYZER_WARNING (CWE-469): [#def17]
iw-6.17/iw.c:408:9: warning[-Wanalyzer-undefined-behavior-ptrdiff]: undefined behavior when subtracting pointers
#  406|   	argv++;
#  407|   
#  408|-> 	for_each_cmd(sectcmd, i) {
#  409|   		if (sectcmd->parent)
#  410|   			continue;

Error: CPPCHECK_WARNING (CWE-758): [#def18]
iw-6.17/iw.c:426: error[subtractPointers]: Subtracting pointers that point to different objects
#  424|   		command = *argv;
#  425|   
#  426|-> 		for_each_cmd(cmd, i) {
#  427|   			if (!cmd->handler)
#  428|   				continue;

Error: GCC_ANALYZER_WARNING (CWE-775): [#def19]
iw-6.17/measurements.c:240:28: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(file, "r")’
iw-6.17/measurements.c:232:17: acquire_resource: opened here
iw-6.17/measurements.c:233:12: branch_false: following ‘false’ branch...
iw-6.17/measurements.c:233:12: branch_false: ...to here
iw-6.17/measurements.c:240:28: danger: ‘fopen(file, "r")’ leaks here; was opened at [(1)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/0)
#  238|   	}
#  239|   
#  240|-> 	for (line_num = 1; fgets(line, sizeof(line), input); line_num++) {
#  241|   		if (line[0] == '#')
#  242|   			continue;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def20]
iw-6.17/measurements.c:240:28: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(file, "r")’
iw-6.17/measurements.c:232:17: acquire_memory: allocated here
iw-6.17/measurements.c:233:12: branch_false: following ‘false’ branch...
iw-6.17/measurements.c:233:12: branch_false: ...to here
iw-6.17/measurements.c:240:28: danger: ‘fopen(file, "r")’ leaks here; was allocated at [(1)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/0)
#  238|   	}
#  239|   
#  240|-> 	for (line_num = 1; fgets(line, sizeof(line), input); line_num++) {
#  241|   		if (line[0] == '#')
#  242|   			continue;

Error: GCC_ANALYZER_WARNING (CWE-775): [#def21]
iw-6.17/measurements.c:241:21: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(file, "r")’
iw-6.17/measurements.c:226:12: enter_function: entry to ‘parse_ftm_config’
iw-6.17/measurements.c:232:17: acquire_resource: opened here
iw-6.17/measurements.c:233:12: branch_false: following ‘false’ branch...
iw-6.17/measurements.c:233:12: branch_false: ...to here
iw-6.17/measurements.c:240:28: branch_true: following ‘true’ branch...
iw-6.17/measurements.c:241:21: branch_true: ...to here
iw-6.17/measurements.c:244:21: call_function: calling ‘parse_ftm_target’ from ‘parse_ftm_config’
#  239|   
#  240|   	for (line_num = 1; fgets(line, sizeof(line), input); line_num++) {
#  241|-> 		if (line[0] == '#')
#  242|   			continue;
#  243|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def22]
iw-6.17/measurements.c:241:21: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(file, "r")’
iw-6.17/measurements.c:226:12: enter_function: entry to ‘parse_ftm_config’
iw-6.17/measurements.c:232:17: acquire_memory: allocated here
iw-6.17/measurements.c:233:12: branch_false: following ‘false’ branch...
iw-6.17/measurements.c:233:12: branch_false: ...to here
iw-6.17/measurements.c:240:28: branch_true: following ‘true’ branch...
iw-6.17/measurements.c:241:21: branch_true: ...to here
iw-6.17/measurements.c:244:21: call_function: calling ‘parse_ftm_target’ from ‘parse_ftm_config’
#  239|   
#  240|   	for (line_num = 1; fgets(line, sizeof(line), input); line_num++) {
#  241|-> 		if (line[0] == '#')
#  242|   			continue;
#  243|   

Error: CPPCHECK_WARNING (CWE-476): [#def23]
iw-6.17/measurements.c:269: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: req_argv
#  267|   
#  268|   	req_argv = calloc(argc + 1, sizeof(req_argv[0]));
#  269|-> 	req_argv[0] = argv[0];
#  270|   	req_argv[1] = "measurement";
#  271|   	req_argv[2] = "ftm_request_send";

Error: GCC_ANALYZER_WARNING (CWE-476): [#def24]
iw-6.17/measurements.c:269:9: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘req_argv’
iw-6.17/measurements.c:268:20: acquire_memory: this call could return NULL
iw-6.17/measurements.c:269:9: danger: ‘calloc((long unsigned int)(argc + 1), 8)’ could be NULL: unchecked value from [(1)](sarif:/runs/0/results/18/codeFlows/0/threadFlows/0/locations/0)
#  267|   
#  268|   	req_argv = calloc(argc + 1, sizeof(req_argv[0]));
#  269|-> 	req_argv[0] = argv[0];
#  270|   	req_argv[1] = "measurement";
#  271|   	req_argv[2] = "ftm_request_send";

Error: CPPCHECK_WARNING (CWE-476): [#def25]
iw-6.17/measurements.c:270: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: req_argv
#  268|   	req_argv = calloc(argc + 1, sizeof(req_argv[0]));
#  269|   	req_argv[0] = argv[0];
#  270|-> 	req_argv[1] = "measurement";
#  271|   	req_argv[2] = "ftm_request_send";
#  272|   	for (i = 3; i < argc; i++)

Error: CPPCHECK_WARNING (CWE-476): [#def26]
iw-6.17/measurements.c:271: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: req_argv
#  269|   	req_argv[0] = argv[0];
#  270|   	req_argv[1] = "measurement";
#  271|-> 	req_argv[2] = "ftm_request_send";
#  272|   	for (i = 3; i < argc; i++)
#  273|   		req_argv[i] = argv[i];

Error: CPPCHECK_WARNING (CWE-476): [#def27]
iw-6.17/measurements.c:273: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: req_argv
#  271|   	req_argv[2] = "ftm_request_send";
#  272|   	for (i = 3; i < argc; i++)
#  273|-> 		req_argv[i] = argv[i];
#  274|   
#  275|   	err = handle_cmd(state, id, argc, req_argv);

Error: COMPILER_WARNING (CWE-704): [#def28]
iw-6.17/mesh.c: scope_hint: In function ‘set_interface_meshparam’
iw-6.17/mesh.c:327:23: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type
#  327 |                 value = strchr(name, '=');
#      |                       ^
#  325|   
#  326|   		name = argv[0];
#  327|-> 		value = strchr(name, '=');
#  328|   		if (value) {
#  329|   			*value = '\0';

Error: COMPILER_WARNING (CWE-704): [#def29]
iw-6.17/mesh.c:327:23: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type
#  325|   
#  326|   		name = argv[0];
#  327|-> 		value = strchr(name, '=');
#  328|   		if (value) {
#  329|   			*value = '\0';

Error: GCC_ANALYZER_WARNING (CWE-401): [#def30]
iw-6.17/mgmt.c:130:23: warning[-Wanalyzer-malloc-leak]: leak of ‘mgmt_argv’
iw-6.17/mgmt.c:103:21: acquire_memory: allocated here
iw-6.17/mgmt.c:104:12: branch_false: following ‘false’ branch (when ‘mgmt_argv’ is non-NULL)...
iw-6.17/mgmt.c:107:9: branch_false: ...to here
iw-6.17/mgmt.c:111:12: branch_false: following ‘false’ branch (when ‘argc > 5’)...
iw-6.17/mgmt.c:116:9: branch_false: ...to here
iw-6.17/mgmt.c:118:16: branch_true: following ‘true’ branch (when ‘argc > 2’)...
iw-6.17/mgmt.c:119:21: branch_true: ...to here
iw-6.17/mgmt.c:119:20: branch_false: following ‘false’ branch (when the strings are equal)...
iw-6.17/mgmt.c:124:17: branch_false: ...to here
iw-6.17/mgmt.c:130:23: throw: if ‘handle_cmd’ throws an exception...
iw-6.17/mgmt.c:130:23: danger: ‘mgmt_argv’ leaks here; was allocated at [(1)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/0)
#  128|   		argv += 3;
#  129|   
#  130|-> 		err = handle_cmd(state, II_NETDEV, mgmt_argc, mgmt_argv);
#  131|   		if (err)
#  132|   			goto out;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def31]
iw-6.17/nan.c:233:29: warning[-Wanalyzer-malloc-leak]: leak of ‘srf’
iw-6.17/nan.c:197:17: branch_false: following ‘false’ branch...
iw-6.17/nan.c:203:13: branch_false: ...to here
iw-6.17/nan.c:203:12: branch_true: following ‘true’ branch (when the strings are equal)...
iw-6.17/nan.c:212:20: branch_true: ...to here
iw-6.17/nan.c:212:20: branch_false: following ‘false’ branch (when ‘argc > 4’)...
iw-6.17/nan.c:215:26: branch_false: ...to here
iw-6.17/nan.c:216:17: branch_false: following ‘false’ branch...
iw-6.17/nan.c:276:1: branch_false: ...to here
iw-6.17/nan.c:221:20: branch_false: following ‘false’ branch...
iw-6.17/nan.c:226:23: branch_false: ...to here
iw-6.17/nan.c:226:23: acquire_memory: allocated here
iw-6.17/nan.c:227:20: branch_false: following ‘false’ branch (when ‘srf’ is non-NULL)...
iw-6.17/nan.c:230:17: branch_false: ...to here
iw-6.17/nan.c:232:24: branch_true: following ‘true’ branch (when ‘cur_mac’ is non-NULL)...
iw-6.17/nan.c:233:29: branch_true: ...to here
iw-6.17/nan.c:233:29: throw: if ‘mac_addr_a2n’ throws an exception...
iw-6.17/nan.c:233:29: danger: ‘srf’ leaks here; was allocated at [(11)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/10)
#  231|   		cur_mac = strtok_r(argv[0], ";", &sptr);
#  232|   		while (cur_mac) {
#  233|-> 			if (mac_addr_a2n(mac_addr, cur_mac)) {
#  234|   				printf("mac format error %s\n", cur_mac);
#  235|   				free(srf);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def32]
iw-6.17/nan.c:239:25: warning[-Wanalyzer-malloc-leak]: leak of ‘srf’
iw-6.17/nan.c:197:17: branch_false: following ‘false’ branch...
iw-6.17/nan.c:203:13: branch_false: ...to here
iw-6.17/nan.c:203:12: branch_true: following ‘true’ branch (when the strings are equal)...
iw-6.17/nan.c:212:20: branch_true: ...to here
iw-6.17/nan.c:212:20: branch_false: following ‘false’ branch (when ‘argc > 4’)...
iw-6.17/nan.c:215:26: branch_false: ...to here
iw-6.17/nan.c:216:17: branch_false: following ‘false’ branch...
iw-6.17/nan.c:276:1: branch_false: ...to here
iw-6.17/nan.c:221:20: branch_false: following ‘false’ branch...
iw-6.17/nan.c:226:23: branch_false: ...to here
iw-6.17/nan.c:226:23: acquire_memory: allocated here
iw-6.17/nan.c:227:20: branch_false: following ‘false’ branch (when ‘srf’ is non-NULL)...
iw-6.17/nan.c:230:17: branch_false: ...to here
iw-6.17/nan.c:232:24: branch_true: following ‘true’ branch (when ‘cur_mac’ is non-NULL)...
iw-6.17/nan.c:233:29: branch_true: ...to here
iw-6.17/nan.c:233:28: branch_false: following ‘false’ branch...
iw-6.17/nan.c:239:25: branch_false: ...to here
iw-6.17/nan.c:239:25: throw: if ‘nan_bf’ throws an exception...
iw-6.17/nan.c:239:25: danger: ‘srf’ leaks here; was allocated at [(11)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/10)
#  237|   			}
#  238|   
#  239|-> 			nan_bf(bf_idx, srf, srf_len, mac_addr, ETH_ALEN);
#  240|   			cur_mac = strtok_r(NULL, ";", &sptr);
#  241|   		}

Error: GCC_ANALYZER_WARNING (CWE-401): [#def33]
iw-6.17/nan.c:243:23: warning[-Wanalyzer-malloc-leak]: leak of ‘srf’
iw-6.17/nan.c:197:17: branch_false: following ‘false’ branch...
iw-6.17/nan.c:203:13: branch_false: ...to here
iw-6.17/nan.c:203:12: branch_true: following ‘true’ branch (when the strings are equal)...
iw-6.17/nan.c:212:20: branch_true: ...to here
iw-6.17/nan.c:212:20: branch_false: following ‘false’ branch (when ‘argc > 4’)...
iw-6.17/nan.c:215:26: branch_false: ...to here
iw-6.17/nan.c:216:17: branch_false: following ‘false’ branch...
iw-6.17/nan.c:276:1: branch_false: ...to here
iw-6.17/nan.c:221:20: branch_false: following ‘false’ branch...
iw-6.17/nan.c:226:23: branch_false: ...to here
iw-6.17/nan.c:226:23: acquire_memory: allocated here
iw-6.17/nan.c:227:20: branch_false: following ‘false’ branch (when ‘srf’ is non-NULL)...
iw-6.17/nan.c:230:17: branch_false: ...to here
iw-6.17/nan.c:232:24: branch_false: following ‘false’ branch (when ‘cur_mac’ is NULL)...
iw-6.17/nan.c:243:23: branch_false: ...to here
iw-6.17/nan.c:243:23: throw: if ‘nla_put’ throws an exception...
iw-6.17/nan.c:243:23: danger: ‘srf’ leaks here; was allocated at [(11)](sarif:/runs/0/results/2/codeFlows/0/threadFlows/0/locations/10)
#  241|   		}
#  242|   
#  243|-> 		err = nla_put(srf_attrs, NL80211_NAN_SRF_BF, srf_len, srf);
#  244|   		free(srf);
#  245|   		if (err)

Error: GCC_ANALYZER_WARNING (CWE-401): [#def34]
iw-6.17/phy.c:373:15: warning[-Wanalyzer-malloc-leak]: leak of ‘cac_trigger_argv’
iw-6.17/phy.c:346:12: branch_false: following ‘false’ branch...
iw-6.17/phy.c:349:12: branch_false: ...to here
iw-6.17/phy.c:349:12: branch_false: following ‘false’ branch (when ‘argc > 2’)...
iw-6.17/phy.c:352:13: branch_false: ...to here
iw-6.17/phy.c:359:12: branch_false: following ‘false’ branch (when ‘err == 0’)...
iw-6.17/phy.c:362:35: branch_false: ...to here
iw-6.17/phy.c:362:28: acquire_memory: allocated here
iw-6.17/phy.c:363:12: branch_false: following ‘false’ branch (when ‘cac_trigger_argv’ is non-NULL)...
iw-6.17/phy.c:368:31: branch_false: ...to here
iw-6.17/phy.c:373:15: throw: if ‘handle_cmd’ throws an exception...
iw-6.17/phy.c:373:15: danger: ‘cac_trigger_argv’ leaks here; was allocated at [(7)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/6)
#  371|   	memcpy(&cac_trigger_argv[3], &argv[2], (argc - 2) * sizeof(char*));
#  372|   
#  373|-> 	err = handle_cmd(state, id, argc + 1, cac_trigger_argv);
#  374|   	if (err)
#  375|   		goto err_out;

Error: GCC_ANALYZER_WARNING (CWE-775): [#def35]
iw-6.17/phy.c:605:17: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘netns_get_fd(argv[1])’
iw-6.17/phy.c:580:12: enter_function: entry to ‘handle_netns’
iw-6.17/phy.c:588:12: branch_false: following ‘false’ branch...
iw-6.17/phy.c:591:12: branch_false: following ‘false’ branch (when ‘argc != 1’)...
iw-6.17/phy.c:601:12: branch_false: ...to here
iw-6.17/phy.c:601:12: branch_false: following ‘false’ branch...
iw-6.17/phy.c:604:19: call_function: calling ‘netns_get_fd’ from ‘handle_netns’
iw-6.17/phy.c:604:19: return_function: returning to ‘handle_netns’ from ‘netns_get_fd’
iw-6.17/phy.c:604:12: branch_true: following ‘true’ branch...
iw-6.17/phy.c:605:17: branch_true: ...to here
iw-6.17/phy.c:605:17: throw: if ‘nla_put’ throws an exception...
iw-6.17/phy.c:605:17: danger: ‘netns_get_fd(argv[1])’ leaks here; was opened at [(13)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/12)
#  603|   
#  604|   	if ((fd = netns_get_fd(argv[1])) >= 0) {
#  605|-> 		NLA_PUT_U32(msg, NL80211_ATTR_NETNS_FD, fd);
#  606|   		return 0;
#  607|   	} else {

Error: GCC_ANALYZER_WARNING (CWE-401): [#def36]
iw-6.17/scan.c:2809:15: warning[-Wanalyzer-malloc-leak]: leak of ‘trig_argv’
iw-6.17/scan.c:2800:21: acquire_memory: allocated here
iw-6.17/scan.c:2801:12: branch_false: following ‘false’ branch (when ‘trig_argv’ is non-NULL)...
iw-6.17/scan.c:2803:24: branch_false: ...to here
iw-6.17/scan.c:2809:15: throw: if ‘handle_cmd’ throws an exception...
iw-6.17/scan.c:2809:15: danger: ‘trig_argv’ leaks here; was allocated at [(1)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/0)
# 2807|   	for (i = 0; i < argc - 2 - (dump_argc - 3); i++)
# 2808|   		trig_argv[i + 3] = argv[i + 2 + (dump_argc - 3)];
# 2809|-> 	err = handle_cmd(state, id, trig_argc, trig_argv);
# 2810|   	free(trig_argv);
# 2811|   	if (err)

Error: GCC_ANALYZER_WARNING (CWE-775): [#def37]
iw-6.17/vendor.c:105:9: warning[-Wanalyzer-file-leak]: leak of FILE ‘file’
iw-6.17/vendor.c:137:12: enter_function: entry to ‘handle_vendor_recv_bin’
iw-6.17/vendor.c:142:16: call_function: calling ‘handle_vendor’ from ‘handle_vendor_recv_bin’
#  103|   		file = fopen(argv[2], "r");
#  104|   
#  105|-> 	NLA_PUT_U32(msg, NL80211_ATTR_VENDOR_ID, oui);
#  106|   	NLA_PUT_U32(msg, NL80211_ATTR_VENDOR_SUBCMD, subcmd);
#  107|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def38]
iw-6.17/vendor.c:105:9: warning[-Wanalyzer-malloc-leak]: leak of ‘file’
iw-6.17/vendor.c:137:12: enter_function: entry to ‘handle_vendor_recv_bin’
iw-6.17/vendor.c:142:16: call_function: calling ‘handle_vendor’ from ‘handle_vendor_recv_bin’
#  103|   		file = fopen(argv[2], "r");
#  104|   
#  105|-> 	NLA_PUT_U32(msg, NL80211_ATTR_VENDOR_ID, oui);
#  106|   	NLA_PUT_U32(msg, NL80211_ATTR_VENDOR_SUBCMD, subcmd);
#  107|   

Error: GCC_ANALYZER_WARNING (CWE-775): [#def39]
iw-6.17/vendor.c:106:9: warning[-Wanalyzer-file-leak]: leak of FILE ‘file’
iw-6.17/vendor.c:137:12: enter_function: entry to ‘handle_vendor_recv_bin’
iw-6.17/vendor.c:142:16: call_function: calling ‘handle_vendor’ from ‘handle_vendor_recv_bin’
#  104|   
#  105|   	NLA_PUT_U32(msg, NL80211_ATTR_VENDOR_ID, oui);
#  106|-> 	NLA_PUT_U32(msg, NL80211_ATTR_VENDOR_SUBCMD, subcmd);
#  107|   
#  108|   	if (file) {

Error: GCC_ANALYZER_WARNING (CWE-401): [#def40]
iw-6.17/vendor.c:106:9: warning[-Wanalyzer-malloc-leak]: leak of ‘file’
iw-6.17/vendor.c:137:12: enter_function: entry to ‘handle_vendor_recv_bin’
iw-6.17/vendor.c:142:16: call_function: calling ‘handle_vendor’ from ‘handle_vendor_recv_bin’
#  104|   
#  105|   	NLA_PUT_U32(msg, NL80211_ATTR_VENDOR_ID, oui);
#  106|-> 	NLA_PUT_U32(msg, NL80211_ATTR_VENDOR_SUBCMD, subcmd);
#  107|   
#  108|   	if (file) {

Error: GCC_ANALYZER_WARNING (CWE-775): [#def41]
iw-6.17/wowlan.c:27:15: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(fn, "r")’
iw-6.17/wowlan.c:22:19: acquire_resource: opened here
iw-6.17/wowlan.c:25:12: branch_false: following ‘false’ branch...
iw-6.17/wowlan.c:27:15: branch_false: ...to here
iw-6.17/wowlan.c:27:15: throw: if ‘nla_nest_start’ throws an exception...
iw-6.17/wowlan.c:27:15: danger: ‘fopen(fn, "r")’ leaks here; was opened at [(1)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/0)
#   25|   	if (!f)
#   26|   		return 1;
#   27|-> 	tcp = nla_nest_start(msg, NL80211_WOWLAN_TRIG_TCP_CONNECTION);
#   28|   	if (!tcp)
#   29|   		goto nla_put_failure;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def42]
iw-6.17/wowlan.c:27:15: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(fn, "r")’
iw-6.17/wowlan.c:22:19: acquire_memory: allocated here
iw-6.17/wowlan.c:25:12: branch_false: following ‘false’ branch...
iw-6.17/wowlan.c:27:15: branch_false: ...to here
iw-6.17/wowlan.c:27:15: throw: if ‘nla_nest_start’ throws an exception...
iw-6.17/wowlan.c:27:15: danger: ‘fopen(fn, "r")’ leaks here; was allocated at [(1)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/0)
#   25|   	if (!f)
#   26|   		return 1;
#   27|-> 	tcp = nla_nest_start(msg, NL80211_WOWLAN_TRIG_TCP_CONNECTION);
#   28|   	if (!tcp)
#   29|   		goto nla_put_failure;

Error: GCC_ANALYZER_WARNING (CWE-775): [#def43]
iw-6.17/wowlan.c:55:25: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(fn, "r")’
iw-6.17/wowlan.c:22:19: acquire_resource: opened here
iw-6.17/wowlan.c:25:12: branch_false: following ‘false’ branch...
iw-6.17/wowlan.c:27:15: branch_false: ...to here
iw-6.17/wowlan.c:28:12: branch_false: following ‘false’ branch...
iw-6.17/wowlan.c:28:12: branch_false: ...to here
iw-6.17/wowlan.c:31:16: branch_true: following ‘true’ branch...
iw-6.17/wowlan.c:34:22: branch_true: ...to here
iw-6.17/wowlan.c:34:20: branch_false: following ‘false’ branch...
iw-6.17/wowlan.c:37:23: branch_false: ...to here
iw-6.17/wowlan.c:38:20: branch_false: following ‘false’ branch (when ‘eol’ is NULL)...
iw-6.17/wowlan.c:40:23: branch_false: ...to here
iw-6.17/wowlan.c:41:20: branch_false: following ‘false’ branch (when ‘eol’ is NULL)...
iw-6.17/wowlan.c:44:21: branch_false: ...to here
iw-6.17/wowlan.c:44:20: branch_true: following ‘true’ branch...
iw-6.17/wowlan.c:47:38: branch_true: ...to here
iw-6.17/wowlan.c:49:28: branch_false: following ‘false’ branch (when ‘port’ is NULL)...
iw-6.17/wowlan.c:53:29: branch_false: ...to here
iw-6.17/wowlan.c:53:28: branch_false: following ‘false’ branch...
iw-6.17/wowlan.c:55:25: branch_false: ...to here
iw-6.17/wowlan.c:55:25: throw: if ‘nla_put’ throws an exception...
iw-6.17/wowlan.c:55:25: danger: ‘fopen(fn, "r")’ leaks here; was opened at [(1)](sarif:/runs/0/results/2/codeFlows/0/threadFlows/0/locations/0)
#   53|   			if (inet_aton(addr, &in_addr) == 0)
#   54|   				goto close;
#   55|-> 			NLA_PUT_U32(msg, NL80211_WOWLAN_TCP_SRC_IPV4,
#   56|   				    in_addr.s_addr);
#   57|   			if (port)

Error: GCC_ANALYZER_WARNING (CWE-401): [#def44]
iw-6.17/wowlan.c:55:25: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(fn, "r")’
iw-6.17/wowlan.c:22:19: acquire_memory: allocated here
iw-6.17/wowlan.c:25:12: branch_false: following ‘false’ branch...
iw-6.17/wowlan.c:27:15: branch_false: ...to here
iw-6.17/wowlan.c:28:12: branch_false: following ‘false’ branch...
iw-6.17/wowlan.c:28:12: branch_false: ...to here
iw-6.17/wowlan.c:31:16: branch_true: following ‘true’ branch...
iw-6.17/wowlan.c:34:22: branch_true: ...to here
iw-6.17/wowlan.c:34:20: branch_false: following ‘false’ branch...
iw-6.17/wowlan.c:37:23: branch_false: ...to here
iw-6.17/wowlan.c:38:20: branch_false: following ‘false’ branch (when ‘eol’ is NULL)...
iw-6.17/wowlan.c:40:23: branch_false: ...to here
iw-6.17/wowlan.c:41:20: branch_false: following ‘false’ branch (when ‘eol’ is NULL)...
iw-6.17/wowlan.c:44:21: branch_false: ...to here
iw-6.17/wowlan.c:44:20: branch_true: following ‘true’ branch...
iw-6.17/wowlan.c:47:38: branch_true: ...to here
iw-6.17/wowlan.c:49:28: branch_false: following ‘false’ branch (when ‘port’ is NULL)...
iw-6.17/wowlan.c:53:29: branch_false: ...to here
iw-6.17/wowlan.c:53:28: branch_false: following ‘false’ branch...
iw-6.17/wowlan.c:55:25: branch_false: ...to here
iw-6.17/wowlan.c:55:25: throw: if ‘nla_put’ throws an exception...
iw-6.17/wowlan.c:55:25: danger: ‘fopen(fn, "r")’ leaks here; was allocated at [(1)](sarif:/runs/0/results/3/codeFlows/0/threadFlows/0/locations/0)
#   53|   			if (inet_aton(addr, &in_addr) == 0)
#   54|   				goto close;
#   55|-> 			NLA_PUT_U32(msg, NL80211_WOWLAN_TCP_SRC_IPV4,
#   56|   				    in_addr.s_addr);
#   57|   			if (port)

Error: GCC_ANALYZER_WARNING (CWE-775): [#def45]
iw-6.17/wowlan.c:78:25: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(fn, "r")’
iw-6.17/wowlan.c:22:19: acquire_resource: opened here
iw-6.17/wowlan.c:25:12: branch_false: following ‘false’ branch...
iw-6.17/wowlan.c:27:15: branch_false: ...to here
iw-6.17/wowlan.c:28:12: branch_false: following ‘false’ branch...
iw-6.17/wowlan.c:28:12: branch_false: ...to here
iw-6.17/wowlan.c:31:16: branch_true: following ‘true’ branch...
iw-6.17/wowlan.c:34:22: branch_true: ...to here
iw-6.17/wowlan.c:34:20: branch_false: following ‘false’ branch...
iw-6.17/wowlan.c:37:23: branch_false: ...to here
iw-6.17/wowlan.c:38:20: branch_false: following ‘false’ branch (when ‘eol’ is NULL)...
iw-6.17/wowlan.c:40:23: branch_false: ...to here
iw-6.17/wowlan.c:41:20: branch_false: following ‘false’ branch (when ‘eol’ is NULL)...
iw-6.17/wowlan.c:44:21: branch_false: ...to here
iw-6.17/wowlan.c:60:27: branch_true: following ‘true’ branch...
iw-6.17/wowlan.c:63:38: branch_true: ...to here
iw-6.17/wowlan.c:67:28: branch_false: following ‘false’ branch (when ‘port’ is non-NULL)...
iw-6.17/wowlan.c:69:25: branch_false: ...to here
iw-6.17/wowlan.c:72:28: branch_false: following ‘false’ branch (when ‘mac’ is non-NULL)...
iw-6.17/wowlan.c:74:25: branch_false: ...to here
iw-6.17/wowlan.c:76:28: branch_false: following ‘false’ branch...
iw-6.17/wowlan.c:78:25: branch_false: ...to here
iw-6.17/wowlan.c:78:25: throw: if ‘nla_put’ throws an exception...
iw-6.17/wowlan.c:78:25: danger: ‘fopen(fn, "r")’ leaks here; was opened at [(1)](sarif:/runs/0/results/6/codeFlows/0/threadFlows/0/locations/0)
#   76|   			if (inet_aton(addr, &in_addr) == 0)
#   77|   				goto close;
#   78|-> 			NLA_PUT_U32(msg, NL80211_WOWLAN_TCP_DST_IPV4,
#   79|   				    in_addr.s_addr);
#   80|   			NLA_PUT_U16(msg, NL80211_WOWLAN_TCP_DST_PORT,

Error: GCC_ANALYZER_WARNING (CWE-401): [#def46]
iw-6.17/wowlan.c:78:25: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(fn, "r")’
iw-6.17/wowlan.c:22:19: acquire_memory: allocated here
iw-6.17/wowlan.c:25:12: branch_false: following ‘false’ branch...
iw-6.17/wowlan.c:27:15: branch_false: ...to here
iw-6.17/wowlan.c:28:12: branch_false: following ‘false’ branch...
iw-6.17/wowlan.c:28:12: branch_false: ...to here
iw-6.17/wowlan.c:31:16: branch_true: following ‘true’ branch...
iw-6.17/wowlan.c:34:22: branch_true: ...to here
iw-6.17/wowlan.c:34:20: branch_false: following ‘false’ branch...
iw-6.17/wowlan.c:37:23: branch_false: ...to here
iw-6.17/wowlan.c:38:20: branch_false: following ‘false’ branch (when ‘eol’ is NULL)...
iw-6.17/wowlan.c:40:23: branch_false: ...to here
iw-6.17/wowlan.c:41:20: branch_false: following ‘false’ branch (when ‘eol’ is NULL)...
iw-6.17/wowlan.c:44:21: branch_false: ...to here
iw-6.17/wowlan.c:60:27: branch_true: following ‘true’ branch...
iw-6.17/wowlan.c:63:38: branch_true: ...to here
iw-6.17/wowlan.c:67:28: branch_false: following ‘false’ branch (when ‘port’ is non-NULL)...
iw-6.17/wowlan.c:69:25: branch_false: ...to here
iw-6.17/wowlan.c:72:28: branch_false: following ‘false’ branch (when ‘mac’ is non-NULL)...
iw-6.17/wowlan.c:74:25: branch_false: ...to here
iw-6.17/wowlan.c:76:28: branch_false: following ‘false’ branch...
iw-6.17/wowlan.c:78:25: branch_false: ...to here
iw-6.17/wowlan.c:78:25: throw: if ‘nla_put’ throws an exception...
iw-6.17/wowlan.c:78:25: danger: ‘fopen(fn, "r")’ leaks here; was allocated at [(1)](sarif:/runs/0/results/7/codeFlows/0/threadFlows/0/locations/0)
#   76|   			if (inet_aton(addr, &in_addr) == 0)
#   77|   				goto close;
#   78|-> 			NLA_PUT_U32(msg, NL80211_WOWLAN_TCP_DST_IPV4,
#   79|   				    in_addr.s_addr);
#   80|   			NLA_PUT_U16(msg, NL80211_WOWLAN_TCP_DST_PORT,

Error: GCC_ANALYZER_WARNING (CWE-775): [#def47]
iw-6.17/wowlan.c:88:46: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(fn, "r")’
iw-6.17/wowlan.c:22:19: acquire_resource: opened here
iw-6.17/wowlan.c:25:12: branch_false: following ‘false’ branch...
iw-6.17/wowlan.c:27:15: branch_false: ...to here
iw-6.17/wowlan.c:28:12: branch_false: following ‘false’ branch...
iw-6.17/wowlan.c:28:12: branch_false: ...to here
iw-6.17/wowlan.c:31:16: branch_true: following ‘true’ branch...
iw-6.17/wowlan.c:34:22: branch_true: ...to here
iw-6.17/wowlan.c:34:20: branch_false: following ‘false’ branch...
iw-6.17/wowlan.c:37:23: branch_false: ...to here
iw-6.17/wowlan.c:38:20: branch_false: following ‘false’ branch (when ‘eol’ is NULL)...
iw-6.17/wowlan.c:40:23: branch_false: ...to here
iw-6.17/wowlan.c:41:20: branch_false: following ‘false’ branch (when ‘eol’ is NULL)...
iw-6.17/wowlan.c:44:21: branch_false: ...to here
iw-6.17/wowlan.c:60:27: branch_false: following ‘false’ branch...
iw-6.17/wowlan.c:86:28: branch_false: ...to here
iw-6.17/wowlan.c:86:27: branch_true: following ‘true’ branch...
iw-6.17/wowlan.c:88:46: branch_true: ...to here
iw-6.17/wowlan.c:88:46: throw: if ‘parse_hex’ throws an exception...
iw-6.17/wowlan.c:88:46: danger: ‘fopen(fn, "r")’ leaks here; was opened at [(1)](sarif:/runs/0/results/14/codeFlows/0/threadFlows/0/locations/0)
#   86|   		} else if (strncmp(buf, "data=", 5) == 0) {
#   87|   			size_t len;
#   88|-> 			unsigned char *pkt = parse_hex(buf + 5, &len);
#   89|   
#   90|   			if (!pkt)

Error: GCC_ANALYZER_WARNING (CWE-401): [#def48]
iw-6.17/wowlan.c:88:46: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(fn, "r")’
iw-6.17/wowlan.c:22:19: acquire_memory: allocated here
iw-6.17/wowlan.c:25:12: branch_false: following ‘false’ branch...
iw-6.17/wowlan.c:27:15: branch_false: ...to here
iw-6.17/wowlan.c:28:12: branch_false: following ‘false’ branch...
iw-6.17/wowlan.c:28:12: branch_false: ...to here
iw-6.17/wowlan.c:31:16: branch_true: following ‘true’ branch...
iw-6.17/wowlan.c:34:22: branch_true: ...to here
iw-6.17/wowlan.c:34:20: branch_false: following ‘false’ branch...
iw-6.17/wowlan.c:37:23: branch_false: ...to here
iw-6.17/wowlan.c:38:20: branch_false: following ‘false’ branch (when ‘eol’ is NULL)...
iw-6.17/wowlan.c:40:23: branch_false: ...to here
iw-6.17/wowlan.c:41:20: branch_false: following ‘false’ branch (when ‘eol’ is NULL)...
iw-6.17/wowlan.c:44:21: branch_false: ...to here
iw-6.17/wowlan.c:60:27: branch_false: following ‘false’ branch...
iw-6.17/wowlan.c:86:28: branch_false: ...to here
iw-6.17/wowlan.c:86:27: branch_true: following ‘true’ branch...
iw-6.17/wowlan.c:88:46: branch_true: ...to here
iw-6.17/wowlan.c:88:46: throw: if ‘parse_hex’ throws an exception...
iw-6.17/wowlan.c:88:46: danger: ‘fopen(fn, "r")’ leaks here; was allocated at [(1)](sarif:/runs/0/results/15/codeFlows/0/threadFlows/0/locations/0)
#   86|   		} else if (strncmp(buf, "data=", 5) == 0) {
#   87|   			size_t len;
#   88|-> 			unsigned char *pkt = parse_hex(buf + 5, &len);
#   89|   
#   90|   			if (!pkt)

Error: GCC_ANALYZER_WARNING (CWE-775): [#def49]
iw-6.17/wowlan.c:92:25: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(fn, "r")’
iw-6.17/wowlan.c:22:19: acquire_resource: opened here
iw-6.17/wowlan.c:25:12: branch_false: following ‘false’ branch...
iw-6.17/wowlan.c:27:15: branch_false: ...to here
iw-6.17/wowlan.c:28:12: branch_false: following ‘false’ branch...
iw-6.17/wowlan.c:28:12: branch_false: ...to here
iw-6.17/wowlan.c:31:16: branch_true: following ‘true’ branch...
iw-6.17/wowlan.c:34:22: branch_true: ...to here
iw-6.17/wowlan.c:34:20: branch_false: following ‘false’ branch...
iw-6.17/wowlan.c:37:23: branch_false: ...to here
iw-6.17/wowlan.c:38:20: branch_false: following ‘false’ branch (when ‘eol’ is NULL)...
iw-6.17/wowlan.c:40:23: branch_false: ...to here
iw-6.17/wowlan.c:41:20: branch_false: following ‘false’ branch (when ‘eol’ is NULL)...
iw-6.17/wowlan.c:44:21: branch_false: ...to here
iw-6.17/wowlan.c:60:27: branch_false: following ‘false’ branch...
iw-6.17/wowlan.c:86:28: branch_false: ...to here
iw-6.17/wowlan.c:86:27: branch_true: following ‘true’ branch...
iw-6.17/wowlan.c:88:46: branch_true: ...to here
iw-6.17/wowlan.c:90:28: branch_false: following ‘false’ branch...
iw-6.17/wowlan.c:92:25: branch_false: ...to here
iw-6.17/wowlan.c:92:25: throw: if ‘nla_put’ throws an exception...
iw-6.17/wowlan.c:92:25: danger: ‘fopen(fn, "r")’ leaks here; was opened at [(1)](sarif:/runs/0/results/16/codeFlows/0/threadFlows/0/locations/0)
#   90|   			if (!pkt)
#   91|   				goto close;
#   92|-> 			NLA_PUT(msg, NL80211_WOWLAN_TCP_DATA_PAYLOAD, len, pkt);
#   93|   			free(pkt);
#   94|   		} else if (strncmp(buf, "data.interval=", 14) == 0) {

Error: GCC_ANALYZER_WARNING (CWE-401): [#def50]
iw-6.17/wowlan.c:92:25: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(fn, "r")’
iw-6.17/wowlan.c:22:19: acquire_memory: allocated here
iw-6.17/wowlan.c:25:12: branch_false: following ‘false’ branch...
iw-6.17/wowlan.c:27:15: branch_false: ...to here
iw-6.17/wowlan.c:28:12: branch_false: following ‘false’ branch...
iw-6.17/wowlan.c:28:12: branch_false: ...to here
iw-6.17/wowlan.c:31:16: branch_true: following ‘true’ branch...
iw-6.17/wowlan.c:34:22: branch_true: ...to here
iw-6.17/wowlan.c:34:20: branch_false: following ‘false’ branch...
iw-6.17/wowlan.c:37:23: branch_false: ...to here
iw-6.17/wowlan.c:38:20: branch_false: following ‘false’ branch (when ‘eol’ is NULL)...
iw-6.17/wowlan.c:40:23: branch_false: ...to here
iw-6.17/wowlan.c:41:20: branch_false: following ‘false’ branch (when ‘eol’ is NULL)...
iw-6.17/wowlan.c:44:21: branch_false: ...to here
iw-6.17/wowlan.c:60:27: branch_false: following ‘false’ branch...
iw-6.17/wowlan.c:86:28: branch_false: ...to here
iw-6.17/wowlan.c:86:27: branch_true: following ‘true’ branch...
iw-6.17/wowlan.c:88:46: branch_true: ...to here
iw-6.17/wowlan.c:90:28: branch_false: following ‘false’ branch...
iw-6.17/wowlan.c:92:25: branch_false: ...to here
iw-6.17/wowlan.c:92:25: throw: if ‘nla_put’ throws an exception...
iw-6.17/wowlan.c:92:25: danger: ‘fopen(fn, "r")’ leaks here; was allocated at [(1)](sarif:/runs/0/results/17/codeFlows/0/threadFlows/0/locations/0)
#   90|   			if (!pkt)
#   91|   				goto close;
#   92|-> 			NLA_PUT(msg, NL80211_WOWLAN_TCP_DATA_PAYLOAD, len, pkt);
#   93|   			free(pkt);
#   94|   		} else if (strncmp(buf, "data.interval=", 14) == 0) {

Error: GCC_ANALYZER_WARNING (CWE-775): [#def51]
iw-6.17/wowlan.c:95:25: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(fn, "r")’
iw-6.17/wowlan.c:18:12: enter_function: entry to ‘wowlan_parse_tcp_file’
iw-6.17/wowlan.c:22:19: acquire_resource: opened here
iw-6.17/wowlan.c:25:12: branch_false: following ‘false’ branch...
iw-6.17/wowlan.c:27:15: branch_false: ...to here
iw-6.17/wowlan.c:28:12: branch_false: following ‘false’ branch...
iw-6.17/wowlan.c:28:12: branch_false: ...to here
iw-6.17/wowlan.c:31:16: branch_true: following ‘true’ branch...
iw-6.17/wowlan.c:34:22: branch_true: ...to here
iw-6.17/wowlan.c:34:20: branch_false: following ‘false’ branch...
iw-6.17/wowlan.c:37:23: branch_false: ...to here
iw-6.17/wowlan.c:38:20: branch_false: following ‘false’ branch (when ‘eol’ is NULL)...
iw-6.17/wowlan.c:40:23: branch_false: ...to here
iw-6.17/wowlan.c:41:20: branch_false: following ‘false’ branch (when ‘eol’ is NULL)...
iw-6.17/wowlan.c:44:21: branch_false: ...to here
iw-6.17/wowlan.c:60:27: branch_false: following ‘false’ branch...
iw-6.17/wowlan.c:86:28: branch_false: ...to here
iw-6.17/wowlan.c:86:27: branch_false: following ‘false’ branch...
iw-6.17/wowlan.c:94:28: branch_false: ...to here
iw-6.17/wowlan.c:94:27: branch_true: following ‘true’ branch...
iw-6.17/wowlan.c:95:25: call_function: inlined call to ‘atoi’ from ‘wowlan_parse_tcp_file’
iw-6.17/wowlan.c:95:25: throw: if ‘nla_put’ throws an exception...
iw-6.17/wowlan.c:95:25: danger: ‘fopen(fn, "r")’ leaks here; was opened at [(2)](sarif:/runs/0/results/46/codeFlows/0/threadFlows/0/locations/1)
#   93|   			free(pkt);
#   94|   		} else if (strncmp(buf, "data.interval=", 14) == 0) {
#   95|-> 			NLA_PUT_U32(msg, NL80211_WOWLAN_TCP_DATA_INTERVAL,
#   96|   				    atoi(buf + 14));
#   97|   		} else if (strncmp(buf, "wake=", 5) == 0) {

Error: GCC_ANALYZER_WARNING (CWE-401): [#def52]
iw-6.17/wowlan.c:95:25: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(fn, "r")’
iw-6.17/wowlan.c:18:12: enter_function: entry to ‘wowlan_parse_tcp_file’
iw-6.17/wowlan.c:22:19: acquire_memory: allocated here
iw-6.17/wowlan.c:25:12: branch_false: following ‘false’ branch...
iw-6.17/wowlan.c:27:15: branch_false: ...to here
iw-6.17/wowlan.c:28:12: branch_false: following ‘false’ branch...
iw-6.17/wowlan.c:28:12: branch_false: ...to here
iw-6.17/wowlan.c:31:16: branch_true: following ‘true’ branch...
iw-6.17/wowlan.c:34:22: branch_true: ...to here
iw-6.17/wowlan.c:34:20: branch_false: following ‘false’ branch...
iw-6.17/wowlan.c:37:23: branch_false: ...to here
iw-6.17/wowlan.c:38:20: branch_false: following ‘false’ branch (when ‘eol’ is NULL)...
iw-6.17/wowlan.c:40:23: branch_false: ...to here
iw-6.17/wowlan.c:41:20: branch_false: following ‘false’ branch (when ‘eol’ is NULL)...
iw-6.17/wowlan.c:44:21: branch_false: ...to here
iw-6.17/wowlan.c:60:27: branch_false: following ‘false’ branch...
iw-6.17/wowlan.c:86:28: branch_false: ...to here
iw-6.17/wowlan.c:86:27: branch_false: following ‘false’ branch...
iw-6.17/wowlan.c:94:28: branch_false: ...to here
iw-6.17/wowlan.c:94:27: branch_true: following ‘true’ branch...
iw-6.17/wowlan.c:95:25: call_function: inlined call to ‘atoi’ from ‘wowlan_parse_tcp_file’
iw-6.17/wowlan.c:95:25: throw: if ‘nla_put’ throws an exception...
iw-6.17/wowlan.c:95:25: danger: ‘fopen(fn, "r")’ leaks here; was allocated at [(2)](sarif:/runs/0/results/47/codeFlows/0/threadFlows/0/locations/1)
#   93|   			free(pkt);
#   94|   		} else if (strncmp(buf, "data.interval=", 14) == 0) {
#   95|-> 			NLA_PUT_U32(msg, NL80211_WOWLAN_TCP_DATA_INTERVAL,
#   96|   				    atoi(buf + 14));
#   97|   		} else if (strncmp(buf, "wake=", 5) == 0) {

Error: GCC_ANALYZER_WARNING (CWE-775): [#def53]
iw-6.17/wowlan.c:101:29: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(fn, "r")’
iw-6.17/wowlan.c:22:19: acquire_resource: opened here
iw-6.17/wowlan.c:25:12: branch_false: following ‘false’ branch...
iw-6.17/wowlan.c:27:15: branch_false: ...to here
iw-6.17/wowlan.c:28:12: branch_false: following ‘false’ branch...
iw-6.17/wowlan.c:28:12: branch_false: ...to here
iw-6.17/wowlan.c:31:16: branch_true: following ‘true’ branch...
iw-6.17/wowlan.c:34:22: branch_true: ...to here
iw-6.17/wowlan.c:34:20: branch_false: following ‘false’ branch...
iw-6.17/wowlan.c:37:23: branch_false: ...to here
iw-6.17/wowlan.c:38:20: branch_false: following ‘false’ branch (when ‘eol’ is NULL)...
iw-6.17/wowlan.c:40:23: branch_false: ...to here
iw-6.17/wowlan.c:41:20: branch_false: following ‘false’ branch (when ‘eol’ is NULL)...
iw-6.17/wowlan.c:44:21: branch_false: ...to here
iw-6.17/wowlan.c:60:27: branch_false: following ‘false’ branch...
iw-6.17/wowlan.c:86:28: branch_false: ...to here
iw-6.17/wowlan.c:86:27: branch_false: following ‘false’ branch...
iw-6.17/wowlan.c:94:28: branch_false: ...to here
iw-6.17/wowlan.c:94:27: branch_false: following ‘false’ branch...
iw-6.17/wowlan.c:97:28: branch_false: ...to here
iw-6.17/wowlan.c:97:27: branch_true: following ‘true’ branch...
iw-6.17/wowlan.c:101:29: branch_true: ...to here
iw-6.17/wowlan.c:101:29: throw: if ‘parse_hex_mask’ throws an exception...
iw-6.17/wowlan.c:101:29: danger: ‘fopen(fn, "r")’ leaks here; was opened at [(1)](sarif:/runs/0/results/48/codeFlows/0/threadFlows/0/locations/0)
#   99|   			size_t patlen;
#  100|   
#  101|-> 			if (parse_hex_mask(buf + 5, &pat, &patlen, &mask))
#  102|   				goto close;
#  103|   			NLA_PUT(msg, NL80211_WOWLAN_TCP_WAKE_MASK,

Error: GCC_ANALYZER_WARNING (CWE-401): [#def54]
iw-6.17/wowlan.c:101:29: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(fn, "r")’
iw-6.17/wowlan.c:22:19: acquire_memory: allocated here
iw-6.17/wowlan.c:25:12: branch_false: following ‘false’ branch...
iw-6.17/wowlan.c:27:15: branch_false: ...to here
iw-6.17/wowlan.c:28:12: branch_false: following ‘false’ branch...
iw-6.17/wowlan.c:28:12: branch_false: ...to here
iw-6.17/wowlan.c:31:16: branch_true: following ‘true’ branch...
iw-6.17/wowlan.c:34:22: branch_true: ...to here
iw-6.17/wowlan.c:34:20: branch_false: following ‘false’ branch...
iw-6.17/wowlan.c:37:23: branch_false: ...to here
iw-6.17/wowlan.c:38:20: branch_false: following ‘false’ branch (when ‘eol’ is NULL)...
iw-6.17/wowlan.c:40:23: branch_false: ...to here
iw-6.17/wowlan.c:41:20: branch_false: following ‘false’ branch (when ‘eol’ is NULL)...
iw-6.17/wowlan.c:44:21: branch_false: ...to here
iw-6.17/wowlan.c:60:27: branch_false: following ‘false’ branch...
iw-6.17/wowlan.c:86:28: branch_false: ...to here
iw-6.17/wowlan.c:86:27: branch_false: following ‘false’ branch...
iw-6.17/wowlan.c:94:28: branch_false: ...to here
iw-6.17/wowlan.c:94:27: branch_false: following ‘false’ branch...
iw-6.17/wowlan.c:97:28: branch_false: ...to here
iw-6.17/wowlan.c:97:27: branch_true: following ‘true’ branch...
iw-6.17/wowlan.c:101:29: branch_true: ...to here
iw-6.17/wowlan.c:101:29: throw: if ‘parse_hex_mask’ throws an exception...
iw-6.17/wowlan.c:101:29: danger: ‘fopen(fn, "r")’ leaks here; was allocated at [(1)](sarif:/runs/0/results/49/codeFlows/0/threadFlows/0/locations/0)
#   99|   			size_t patlen;
#  100|   
#  101|-> 			if (parse_hex_mask(buf + 5, &pat, &patlen, &mask))
#  102|   				goto close;
#  103|   			NLA_PUT(msg, NL80211_WOWLAN_TCP_WAKE_MASK,

Error: GCC_ANALYZER_WARNING (CWE-775): [#def55]
iw-6.17/wowlan.c:103:25: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(fn, "r")’
iw-6.17/wowlan.c:22:19: acquire_resource: opened here
iw-6.17/wowlan.c:25:12: branch_false: following ‘false’ branch...
iw-6.17/wowlan.c:27:15: branch_false: ...to here
iw-6.17/wowlan.c:28:12: branch_false: following ‘false’ branch...
iw-6.17/wowlan.c:28:12: branch_false: ...to here
iw-6.17/wowlan.c:31:16: branch_true: following ‘true’ branch...
iw-6.17/wowlan.c:34:22: branch_true: ...to here
iw-6.17/wowlan.c:34:20: branch_false: following ‘false’ branch...
iw-6.17/wowlan.c:37:23: branch_false: ...to here
iw-6.17/wowlan.c:38:20: branch_false: following ‘false’ branch (when ‘eol’ is NULL)...
iw-6.17/wowlan.c:40:23: branch_false: ...to here
iw-6.17/wowlan.c:41:20: branch_false: following ‘false’ branch (when ‘eol’ is NULL)...
iw-6.17/wowlan.c:44:21: branch_false: ...to here
iw-6.17/wowlan.c:60:27: branch_false: following ‘false’ branch...
iw-6.17/wowlan.c:86:28: branch_false: ...to here
iw-6.17/wowlan.c:86:27: branch_false: following ‘false’ branch...
iw-6.17/wowlan.c:94:28: branch_false: ...to here
iw-6.17/wowlan.c:94:27: branch_false: following ‘false’ branch...
iw-6.17/wowlan.c:97:28: branch_false: ...to here
iw-6.17/wowlan.c:97:27: branch_true: following ‘true’ branch...
iw-6.17/wowlan.c:101:29: branch_true: ...to here
iw-6.17/wowlan.c:101:28: branch_false: following ‘false’ branch...
iw-6.17/wowlan.c:103:25: branch_false: ...to here
iw-6.17/wowlan.c:103:25: throw: if ‘nla_put’ throws an exception...
iw-6.17/wowlan.c:103:25: danger: ‘fopen(fn, "r")’ leaks here; was opened at [(1)](sarif:/runs/0/results/50/codeFlows/0/threadFlows/0/locations/0)
#  101|   			if (parse_hex_mask(buf + 5, &pat, &patlen, &mask))
#  102|   				goto close;
#  103|-> 			NLA_PUT(msg, NL80211_WOWLAN_TCP_WAKE_MASK,
#  104|   				DIV_ROUND_UP(patlen, 8), mask);
#  105|   			NLA_PUT(msg, NL80211_WOWLAN_TCP_WAKE_PAYLOAD,

Error: GCC_ANALYZER_WARNING (CWE-401): [#def56]
iw-6.17/wowlan.c:103:25: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(fn, "r")’
iw-6.17/wowlan.c:22:19: acquire_memory: allocated here
iw-6.17/wowlan.c:25:12: branch_false: following ‘false’ branch...
iw-6.17/wowlan.c:27:15: branch_false: ...to here
iw-6.17/wowlan.c:28:12: branch_false: following ‘false’ branch...
iw-6.17/wowlan.c:28:12: branch_false: ...to here
iw-6.17/wowlan.c:31:16: branch_true: following ‘true’ branch...
iw-6.17/wowlan.c:34:22: branch_true: ...to here
iw-6.17/wowlan.c:34:20: branch_false: following ‘false’ branch...
iw-6.17/wowlan.c:37:23: branch_false: ...to here
iw-6.17/wowlan.c:38:20: branch_false: following ‘false’ branch (when ‘eol’ is NULL)...
iw-6.17/wowlan.c:40:23: branch_false: ...to here
iw-6.17/wowlan.c:41:20: branch_false: following ‘false’ branch (when ‘eol’ is NULL)...
iw-6.17/wowlan.c:44:21: branch_false: ...to here
iw-6.17/wowlan.c:60:27: branch_false: following ‘false’ branch...
iw-6.17/wowlan.c:86:28: branch_false: ...to here
iw-6.17/wowlan.c:86:27: branch_false: following ‘false’ branch...
iw-6.17/wowlan.c:94:28: branch_false: ...to here
iw-6.17/wowlan.c:94:27: branch_false: following ‘false’ branch...
iw-6.17/wowlan.c:97:28: branch_false: ...to here
iw-6.17/wowlan.c:97:27: branch_true: following ‘true’ branch...
iw-6.17/wowlan.c:101:29: branch_true: ...to here
iw-6.17/wowlan.c:101:28: branch_false: following ‘false’ branch...
iw-6.17/wowlan.c:103:25: branch_false: ...to here
iw-6.17/wowlan.c:103:25: throw: if ‘nla_put’ throws an exception...
iw-6.17/wowlan.c:103:25: danger: ‘fopen(fn, "r")’ leaks here; was allocated at [(1)](sarif:/runs/0/results/51/codeFlows/0/threadFlows/0/locations/0)
#  101|   			if (parse_hex_mask(buf + 5, &pat, &patlen, &mask))
#  102|   				goto close;
#  103|-> 			NLA_PUT(msg, NL80211_WOWLAN_TCP_WAKE_MASK,
#  104|   				DIV_ROUND_UP(patlen, 8), mask);
#  105|   			NLA_PUT(msg, NL80211_WOWLAN_TCP_WAKE_PAYLOAD,

Error: GCC_ANALYZER_WARNING (CWE-775): [#def57]
iw-6.17/wowlan.c:125:35: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(fn, "r")’
iw-6.17/wowlan.c:18:12: enter_function: entry to ‘wowlan_parse_tcp_file’
iw-6.17/wowlan.c:22:19: acquire_resource: opened here
iw-6.17/wowlan.c:25:12: branch_false: following ‘false’ branch...
iw-6.17/wowlan.c:27:15: branch_false: ...to here
iw-6.17/wowlan.c:28:12: branch_false: following ‘false’ branch...
iw-6.17/wowlan.c:28:12: branch_false: ...to here
iw-6.17/wowlan.c:31:16: branch_true: following ‘true’ branch...
iw-6.17/wowlan.c:34:22: branch_true: ...to here
iw-6.17/wowlan.c:34:20: branch_false: following ‘false’ branch...
iw-6.17/wowlan.c:37:23: branch_false: ...to here
iw-6.17/wowlan.c:38:20: branch_false: following ‘false’ branch (when ‘eol’ is NULL)...
iw-6.17/wowlan.c:40:23: branch_false: ...to here
iw-6.17/wowlan.c:41:20: branch_false: following ‘false’ branch (when ‘eol’ is NULL)...
iw-6.17/wowlan.c:44:21: branch_false: ...to here
iw-6.17/wowlan.c:60:27: branch_false: following ‘false’ branch...
iw-6.17/wowlan.c:86:28: branch_false: ...to here
iw-6.17/wowlan.c:86:27: branch_false: following ‘false’ branch...
iw-6.17/wowlan.c:94:28: branch_false: ...to here
iw-6.17/wowlan.c:94:27: branch_false: following ‘false’ branch...
iw-6.17/wowlan.c:97:28: branch_false: ...to here
iw-6.17/wowlan.c:97:27: branch_false: following ‘false’ branch...
iw-6.17/wowlan.c:109:28: branch_false: ...to here
iw-6.17/wowlan.c:109:27: branch_true: following ‘true’ branch...
iw-6.17/wowlan.c:110:60: branch_true: ...to here
iw-6.17/wowlan.c:115:28: branch_false: following ‘false’ branch (when ‘offs’ is non-NULL)...
iw-6.17/wowlan.c:117:25: branch_false: ...to here
iw-6.17/wowlan.c:120:28: branch_false: following ‘false’ branch (when ‘start’ is NULL)...
iw-6.17/wowlan.c:125:35: call_function: inlined call to ‘atoi’ from ‘wowlan_parse_tcp_file’
iw-6.17/wowlan.c:128:25: throw: if ‘nla_put’ throws an exception...
iw-6.17/wowlan.c:125:35: danger: ‘fopen(fn, "r")’ leaks here; was opened at [(2)](sarif:/runs/0/results/54/codeFlows/0/threadFlows/0/locations/1)
#  123|   				seq.start = atoi(start);
#  124|   			}
#  125|-> 			seq.len = atoi(len);
#  126|   			seq.offset = atoi(offs);
#  127|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def58]
iw-6.17/wowlan.c:125:35: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(fn, "r")’
iw-6.17/wowlan.c:18:12: enter_function: entry to ‘wowlan_parse_tcp_file’
iw-6.17/wowlan.c:22:19: acquire_memory: allocated here
iw-6.17/wowlan.c:25:12: branch_false: following ‘false’ branch...
iw-6.17/wowlan.c:27:15: branch_false: ...to here
iw-6.17/wowlan.c:28:12: branch_false: following ‘false’ branch...
iw-6.17/wowlan.c:28:12: branch_false: ...to here
iw-6.17/wowlan.c:31:16: branch_true: following ‘true’ branch...
iw-6.17/wowlan.c:34:22: branch_true: ...to here
iw-6.17/wowlan.c:34:20: branch_false: following ‘false’ branch...
iw-6.17/wowlan.c:37:23: branch_false: ...to here
iw-6.17/wowlan.c:38:20: branch_false: following ‘false’ branch (when ‘eol’ is NULL)...
iw-6.17/wowlan.c:40:23: branch_false: ...to here
iw-6.17/wowlan.c:41:20: branch_false: following ‘false’ branch (when ‘eol’ is NULL)...
iw-6.17/wowlan.c:44:21: branch_false: ...to here
iw-6.17/wowlan.c:60:27: branch_false: following ‘false’ branch...
iw-6.17/wowlan.c:86:28: branch_false: ...to here
iw-6.17/wowlan.c:86:27: branch_false: following ‘false’ branch...
iw-6.17/wowlan.c:94:28: branch_false: ...to here
iw-6.17/wowlan.c:94:27: branch_false: following ‘false’ branch...
iw-6.17/wowlan.c:97:28: branch_false: ...to here
iw-6.17/wowlan.c:97:27: branch_false: following ‘false’ branch...
iw-6.17/wowlan.c:109:28: branch_false: ...to here
iw-6.17/wowlan.c:109:27: branch_true: following ‘true’ branch...
iw-6.17/wowlan.c:110:60: branch_true: ...to here
iw-6.17/wowlan.c:115:28: branch_false: following ‘false’ branch (when ‘offs’ is non-NULL)...
iw-6.17/wowlan.c:117:25: branch_false: ...to here
iw-6.17/wowlan.c:120:28: branch_false: following ‘false’ branch (when ‘start’ is NULL)...
iw-6.17/wowlan.c:125:35: call_function: inlined call to ‘atoi’ from ‘wowlan_parse_tcp_file’
iw-6.17/wowlan.c:128:25: throw: if ‘nla_put’ throws an exception...
iw-6.17/wowlan.c:125:35: danger: ‘fopen(fn, "r")’ leaks here; was allocated at [(2)](sarif:/runs/0/results/55/codeFlows/0/threadFlows/0/locations/1)
#  123|   				seq.start = atoi(start);
#  124|   			}
#  125|-> 			seq.len = atoi(len);
#  126|   			seq.offset = atoi(offs);
#  127|   

Error: GCC_ANALYZER_WARNING (CWE-775): [#def59]
iw-6.17/wowlan.c:148:34: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(fn, "r")’
iw-6.17/wowlan.c:22:19: acquire_resource: opened here
iw-6.17/wowlan.c:25:12: branch_false: following ‘false’ branch...
iw-6.17/wowlan.c:27:15: branch_false: ...to here
iw-6.17/wowlan.c:28:12: branch_false: following ‘false’ branch...
iw-6.17/wowlan.c:28:12: branch_false: ...to here
iw-6.17/wowlan.c:31:16: branch_true: following ‘true’ branch...
iw-6.17/wowlan.c:34:22: branch_true: ...to here
iw-6.17/wowlan.c:34:20: branch_false: following ‘false’ branch...
iw-6.17/wowlan.c:37:23: branch_false: ...to here
iw-6.17/wowlan.c:38:20: branch_false: following ‘false’ branch (when ‘eol’ is NULL)...
iw-6.17/wowlan.c:40:23: branch_false: ...to here
iw-6.17/wowlan.c:41:20: branch_false: following ‘false’ branch (when ‘eol’ is NULL)...
iw-6.17/wowlan.c:44:21: branch_false: ...to here
iw-6.17/wowlan.c:60:27: branch_false: following ‘false’ branch...
iw-6.17/wowlan.c:86:28: branch_false: ...to here
iw-6.17/wowlan.c:86:27: branch_false: following ‘false’ branch...
iw-6.17/wowlan.c:94:28: branch_false: ...to here
iw-6.17/wowlan.c:94:27: branch_false: following ‘false’ branch...
iw-6.17/wowlan.c:97:28: branch_false: ...to here
iw-6.17/wowlan.c:97:27: branch_false: following ‘false’ branch...
iw-6.17/wowlan.c:109:28: branch_false: ...to here
iw-6.17/wowlan.c:109:27: branch_false: following ‘false’ branch...
iw-6.17/wowlan.c:130:28: branch_false: ...to here
iw-6.17/wowlan.c:130:27: branch_true: following ‘true’ branch...
iw-6.17/wowlan.c:137:32: branch_true: ...to here
iw-6.17/wowlan.c:138:28: branch_false: following ‘false’ branch (when ‘offs’ is non-NULL)...
iw-6.17/wowlan.c:140:25: branch_false: ...to here
iw-6.17/wowlan.c:143:28: branch_false: following ‘false’ branch (when ‘toks’ is non-NULL)...
iw-6.17/wowlan.c:145:25: branch_false: ...to here
iw-6.17/wowlan.c:148:34: throw: if ‘parse_hex’ throws an exception...
iw-6.17/wowlan.c:148:34: danger: ‘fopen(fn, "r")’ leaks here; was opened at [(1)](sarif:/runs/0/results/56/codeFlows/0/threadFlows/0/locations/0)
#  146|   			toks++;
#  147|   
#  148|-> 			stream = parse_hex(toks, &stream_len);
#  149|   			if (!stream)
#  150|   				goto close;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def60]
iw-6.17/wowlan.c:148:34: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(fn, "r")’
iw-6.17/wowlan.c:22:19: acquire_memory: allocated here
iw-6.17/wowlan.c:25:12: branch_false: following ‘false’ branch...
iw-6.17/wowlan.c:27:15: branch_false: ...to here
iw-6.17/wowlan.c:28:12: branch_false: following ‘false’ branch...
iw-6.17/wowlan.c:28:12: branch_false: ...to here
iw-6.17/wowlan.c:31:16: branch_true: following ‘true’ branch...
iw-6.17/wowlan.c:34:22: branch_true: ...to here
iw-6.17/wowlan.c:34:20: branch_false: following ‘false’ branch...
iw-6.17/wowlan.c:37:23: branch_false: ...to here
iw-6.17/wowlan.c:38:20: branch_false: following ‘false’ branch (when ‘eol’ is NULL)...
iw-6.17/wowlan.c:40:23: branch_false: ...to here
iw-6.17/wowlan.c:41:20: branch_false: following ‘false’ branch (when ‘eol’ is NULL)...
iw-6.17/wowlan.c:44:21: branch_false: ...to here
iw-6.17/wowlan.c:60:27: branch_false: following ‘false’ branch...
iw-6.17/wowlan.c:86:28: branch_false: ...to here
iw-6.17/wowlan.c:86:27: branch_false: following ‘false’ branch...
iw-6.17/wowlan.c:94:28: branch_false: ...to here
iw-6.17/wowlan.c:94:27: branch_false: following ‘false’ branch...
iw-6.17/wowlan.c:97:28: branch_false: ...to here
iw-6.17/wowlan.c:97:27: branch_false: following ‘false’ branch...
iw-6.17/wowlan.c:109:28: branch_false: ...to here
iw-6.17/wowlan.c:109:27: branch_false: following ‘false’ branch...
iw-6.17/wowlan.c:130:28: branch_false: ...to here
iw-6.17/wowlan.c:130:27: branch_true: following ‘true’ branch...
iw-6.17/wowlan.c:137:32: branch_true: ...to here
iw-6.17/wowlan.c:138:28: branch_false: following ‘false’ branch (when ‘offs’ is non-NULL)...
iw-6.17/wowlan.c:140:25: branch_false: ...to here
iw-6.17/wowlan.c:143:28: branch_false: following ‘false’ branch (when ‘toks’ is non-NULL)...
iw-6.17/wowlan.c:145:25: branch_false: ...to here
iw-6.17/wowlan.c:148:34: throw: if ‘parse_hex’ throws an exception...
iw-6.17/wowlan.c:148:34: danger: ‘fopen(fn, "r")’ leaks here; was allocated at [(1)](sarif:/runs/0/results/57/codeFlows/0/threadFlows/0/locations/0)
#  146|   			toks++;
#  147|   
#  148|-> 			stream = parse_hex(toks, &stream_len);
#  149|   			if (!stream)
#  150|   				goto close;

Error: GCC_ANALYZER_WARNING (CWE-775): [#def61]
iw-6.17/wowlan.c:151:31: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(fn, "r")’
iw-6.17/wowlan.c:18:12: enter_function: entry to ‘wowlan_parse_tcp_file’
iw-6.17/wowlan.c:22:19: acquire_resource: opened here
iw-6.17/wowlan.c:25:12: branch_false: following ‘false’ branch...
iw-6.17/wowlan.c:27:15: branch_false: ...to here
iw-6.17/wowlan.c:28:12: branch_false: following ‘false’ branch...
iw-6.17/wowlan.c:28:12: branch_false: ...to here
iw-6.17/wowlan.c:31:16: branch_true: following ‘true’ branch...
iw-6.17/wowlan.c:34:22: branch_true: ...to here
iw-6.17/wowlan.c:34:20: branch_false: following ‘false’ branch...
iw-6.17/wowlan.c:37:23: branch_false: ...to here
iw-6.17/wowlan.c:38:20: branch_false: following ‘false’ branch (when ‘eol’ is NULL)...
iw-6.17/wowlan.c:40:23: branch_false: ...to here
iw-6.17/wowlan.c:41:20: branch_false: following ‘false’ branch (when ‘eol’ is NULL)...
iw-6.17/wowlan.c:44:21: branch_false: ...to here
iw-6.17/wowlan.c:60:27: branch_false: following ‘false’ branch...
iw-6.17/wowlan.c:86:28: branch_false: ...to here
iw-6.17/wowlan.c:86:27: branch_false: following ‘false’ branch...
iw-6.17/wowlan.c:94:28: branch_false: ...to here
iw-6.17/wowlan.c:94:27: branch_false: following ‘false’ branch...
iw-6.17/wowlan.c:97:28: branch_false: ...to here
iw-6.17/wowlan.c:97:27: branch_false: following ‘false’ branch...
iw-6.17/wowlan.c:109:28: branch_false: ...to here
iw-6.17/wowlan.c:109:27: branch_false: following ‘false’ branch...
iw-6.17/wowlan.c:130:28: branch_false: ...to here
iw-6.17/wowlan.c:130:27: branch_true: following ‘true’ branch...
iw-6.17/wowlan.c:137:32: branch_true: ...to here
iw-6.17/wowlan.c:138:28: branch_false: following ‘false’ branch (when ‘offs’ is non-NULL)...
iw-6.17/wowlan.c:140:25: branch_false: ...to here
iw-6.17/wowlan.c:143:28: branch_false: following ‘false’ branch (when ‘toks’ is non-NULL)...
iw-6.17/wowlan.c:145:25: branch_false: ...to here
iw-6.17/wowlan.c:149:28: branch_false: following ‘false’ branch...
iw-6.17/wowlan.c:151:31: branch_false: ...to here
iw-6.17/wowlan.c:152:28: branch_false: following ‘false’ branch (when ‘tok’ is non-NULL)...
iw-6.17/wowlan.c:158:36: call_function: inlined call to ‘atoi’ from ‘wowlan_parse_tcp_file’
iw-6.17/wowlan.c:162:29: throw: if ‘nla_put’ throws an exception...
iw-6.17/wowlan.c:151:31: danger: ‘fopen(fn, "r")’ leaks here; was opened at [(2)](sarif:/runs/0/results/58/codeFlows/0/threadFlows/0/locations/1)
#  149|   			if (!stream)
#  150|   				goto close;
#  151|-> 			tok = malloc(sizeof(*tok) + stream_len);
#  152|   			if (!tok) {
#  153|   				free(stream);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def62]
iw-6.17/wowlan.c:151:31: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(fn, "r")’
iw-6.17/wowlan.c:18:12: enter_function: entry to ‘wowlan_parse_tcp_file’
iw-6.17/wowlan.c:22:19: acquire_memory: allocated here
iw-6.17/wowlan.c:25:12: branch_false: following ‘false’ branch...
iw-6.17/wowlan.c:27:15: branch_false: ...to here
iw-6.17/wowlan.c:28:12: branch_false: following ‘false’ branch...
iw-6.17/wowlan.c:28:12: branch_false: ...to here
iw-6.17/wowlan.c:31:16: branch_true: following ‘true’ branch...
iw-6.17/wowlan.c:34:22: branch_true: ...to here
iw-6.17/wowlan.c:34:20: branch_false: following ‘false’ branch...
iw-6.17/wowlan.c:37:23: branch_false: ...to here
iw-6.17/wowlan.c:38:20: branch_false: following ‘false’ branch (when ‘eol’ is NULL)...
iw-6.17/wowlan.c:40:23: branch_false: ...to here
iw-6.17/wowlan.c:41:20: branch_false: following ‘false’ branch (when ‘eol’ is NULL)...
iw-6.17/wowlan.c:44:21: branch_false: ...to here
iw-6.17/wowlan.c:60:27: branch_false: following ‘false’ branch...
iw-6.17/wowlan.c:86:28: branch_false: ...to here
iw-6.17/wowlan.c:86:27: branch_false: following ‘false’ branch...
iw-6.17/wowlan.c:94:28: branch_false: ...to here
iw-6.17/wowlan.c:94:27: branch_false: following ‘false’ branch...
iw-6.17/wowlan.c:97:28: branch_false: ...to here
iw-6.17/wowlan.c:97:27: branch_false: following ‘false’ branch...
iw-6.17/wowlan.c:109:28: branch_false: ...to here
iw-6.17/wowlan.c:109:27: branch_false: following ‘false’ branch...
iw-6.17/wowlan.c:130:28: branch_false: ...to here
iw-6.17/wowlan.c:130:27: branch_true: following ‘true’ branch...
iw-6.17/wowlan.c:137:32: branch_true: ...to here
iw-6.17/wowlan.c:138:28: branch_false: following ‘false’ branch (when ‘offs’ is non-NULL)...
iw-6.17/wowlan.c:140:25: branch_false: ...to here
iw-6.17/wowlan.c:143:28: branch_false: following ‘false’ branch (when ‘toks’ is non-NULL)...
iw-6.17/wowlan.c:145:25: branch_false: ...to here
iw-6.17/wowlan.c:149:28: branch_false: following ‘false’ branch...
iw-6.17/wowlan.c:151:31: branch_false: ...to here
iw-6.17/wowlan.c:152:28: branch_false: following ‘false’ branch (when ‘tok’ is non-NULL)...
iw-6.17/wowlan.c:158:36: call_function: inlined call to ‘atoi’ from ‘wowlan_parse_tcp_file’
iw-6.17/wowlan.c:162:29: throw: if ‘nla_put’ throws an exception...
iw-6.17/wowlan.c:151:31: danger: ‘fopen(fn, "r")’ leaks here; was allocated at [(2)](sarif:/runs/0/results/59/codeFlows/0/threadFlows/0/locations/1)
#  149|   			if (!stream)
#  150|   				goto close;
#  151|-> 			tok = malloc(sizeof(*tok) + stream_len);
#  152|   			if (!tok) {
#  153|   				free(stream);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def63]
iw-6.17/wowlan.c:162:29: warning[-Wanalyzer-malloc-leak]: leak of ‘tok’
iw-6.17/wowlan.c:18:12: enter_function: entry to ‘wowlan_parse_tcp_file’
iw-6.17/wowlan.c:25:12: branch_false: following ‘false’ branch...
iw-6.17/wowlan.c:27:15: branch_false: ...to here
iw-6.17/wowlan.c:28:12: branch_false: following ‘false’ branch...
iw-6.17/wowlan.c:28:12: branch_false: ...to here
iw-6.17/wowlan.c:31:16: branch_true: following ‘true’ branch...
iw-6.17/wowlan.c:34:22: branch_true: ...to here
iw-6.17/wowlan.c:34:20: branch_false: following ‘false’ branch...
iw-6.17/wowlan.c:37:23: branch_false: ...to here
iw-6.17/wowlan.c:38:20: branch_false: following ‘false’ branch (when ‘eol’ is NULL)...
iw-6.17/wowlan.c:40:23: branch_false: ...to here
iw-6.17/wowlan.c:41:20: branch_false: following ‘false’ branch (when ‘eol’ is NULL)...
iw-6.17/wowlan.c:44:21: branch_false: ...to here
iw-6.17/wowlan.c:60:27: branch_false: following ‘false’ branch...
iw-6.17/wowlan.c:86:28: branch_false: ...to here
iw-6.17/wowlan.c:86:27: branch_false: following ‘false’ branch...
iw-6.17/wowlan.c:94:28: branch_false: ...to here
iw-6.17/wowlan.c:94:27: branch_false: following ‘false’ branch...
iw-6.17/wowlan.c:97:28: branch_false: ...to here
iw-6.17/wowlan.c:97:27: branch_false: following ‘false’ branch...
iw-6.17/wowlan.c:109:28: branch_false: ...to here
iw-6.17/wowlan.c:109:27: branch_false: following ‘false’ branch...
iw-6.17/wowlan.c:130:28: branch_false: ...to here
iw-6.17/wowlan.c:130:27: branch_true: following ‘true’ branch...
iw-6.17/wowlan.c:137:32: branch_true: ...to here
iw-6.17/wowlan.c:138:28: branch_false: following ‘false’ branch (when ‘offs’ is non-NULL)...
iw-6.17/wowlan.c:140:25: branch_false: ...to here
iw-6.17/wowlan.c:143:28: branch_false: following ‘false’ branch (when ‘toks’ is non-NULL)...
iw-6.17/wowlan.c:145:25: branch_false: ...to here
iw-6.17/wowlan.c:149:28: branch_false: following ‘false’ branch...
iw-6.17/wowlan.c:151:31: branch_false: ...to here
iw-6.17/wowlan.c:151:31: acquire_memory: allocated here
iw-6.17/wowlan.c:152:28: branch_false: following ‘false’ branch (when ‘tok’ is non-NULL)...
iw-6.17/wowlan.c:158:36: call_function: inlined call to ‘atoi’ from ‘wowlan_parse_tcp_file’
iw-6.17/wowlan.c:162:29: throw: if ‘nla_put’ throws an exception...
iw-6.17/wowlan.c:162:29: danger: ‘tok’ leaks here; was allocated at [(36)](sarif:/runs/0/results/60/codeFlows/0/threadFlows/0/locations/35)
#  160|   			memcpy(tok->token_stream, stream, stream_len);
#  161|   
#  162|-> 			if (nla_put(msg, NL80211_WOWLAN_TCP_DATA_PAYLOAD_TOKEN,
#  163|   				sizeof(*tok) + stream_len, tok) < 0) {
#  164|   				free(stream);

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-63.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-nameiw-6.17-1.fc44
store-results-to/tmp/tmpqugv5p33/iw-6.17-1.fc44.tar.xz
time-created2026-01-08 17:16:08
time-finished2026-01-08 17:17:26
toolcsmock
tool-args'/usr/bin/csmock' '-r' 'fedora-rawhide-x86_64' '-t' 'gcc,cppcheck,clippy,shellcheck,unicontrol' '-o' '/tmp/tmpqugv5p33/iw-6.17-1.fc44.tar.xz' '--gcc-analyze' '--unicontrol-notests' '--unicontrol-bidi-only' '--install' 'pam' '--gcc-analyzer-bin=/usr/bin/gcc' '/tmp/tmpqugv5p33/iw-6.17-1.fc44.src.rpm'
tool-versioncsmock-3.8.3.20251215.161544.g62de9a5-1.el9