lldpad-1.1.0-15.git85e5583.fc44

List of Findings

Error: GCC_ANALYZER_WARNING (CWE-775): [#def1]
lldpad-1.1.0/clif.c:69:17: warning[-Wanalyzer-fd-leak]: leak of file descriptor
lldpad-1.1.0/clif.c:243:7: enter_function: entry to 'clif_getpid'
lldpad-1.1.0/clif.c:252:21: call_function: calling 'clif_open' from 'clif_getpid'
#   67|   	addrlen = sizeof(sa_family_t) + strlen(clif->local.sun_path + 1) + 1;
#   68|   	if (bind(clif->s, (struct sockaddr *) &clif->local, addrlen) < 0) {
#   69|-> 		perror("bind");
#   70|   		close(clif->s);
#   71|   		free(clif);

Error: GCC_ANALYZER_WARNING (CWE-775): [#def2]
lldpad-1.1.0/clif.c:76:9: warning[-Wanalyzer-fd-leak]: leak of file descriptor
lldpad-1.1.0/clif.c:243:7: enter_function: entry to 'clif_getpid'
lldpad-1.1.0/clif.c:252:21: call_function: calling 'clif_open' from 'clif_getpid'
#   74|   
#   75|   	clif->dest.sun_family = AF_LOCAL;
#   76|-> 	clif->dest.sun_path[0] = '\0';
#   77|   	snprintf(&clif->dest.sun_path[1], sizeof(clif->dest.sun_path) - 1,
#   78|   		    "%s", LLDP_CLIF_SOCK);

Error: GCC_ANALYZER_WARNING (CWE-775): [#def3]
lldpad-1.1.0/clif.c:82:17: warning[-Wanalyzer-fd-leak]: leak of file descriptor
lldpad-1.1.0/clif.c:243:7: enter_function: entry to 'clif_getpid'
lldpad-1.1.0/clif.c:252:21: call_function: calling 'clif_open' from 'clif_getpid'
#   80|   
#   81|   	if (connect(clif->s, (struct sockaddr *) &clif->dest, addrlen) < 0) {
#   82|-> 		perror("connect");
#   83|   		close(clif->s);
#   84|   		free(clif);

Error: CPPCHECK_WARNING (CWE-457): [#def4]
lldpad-1.1.0/config.c:189: error[uninitvar]: Uninitialized variable: np->ops
#  187|   				   __func__, agent);
#  188|   			LIST_FOREACH(np, &lldp_mod_head, lldp) {
#  189|-> 				ops = np->ops;
#  190|   				if (ops->lldp_mod_ifdown)
#  191|   					ops->lldp_mod_ifdown(ifname, agent);

Error: CPPCHECK_WARNING (CWE-682): [#def5]
lldpad-1.1.0/ctrl_iface.c:183: error[nullPointerArithmeticOutOfMemory]: If memory allocation fails: pointer addition with NULL pointer.
#  181|   		tlv = strdup(ibuf);
#  182|   		str = tlv;
#  183|-> 		str++;
#  184|   		/* Count number of TLV Modules */
#  185|   		tokenize = strtok(str, delim);

Error: CPPCHECK_WARNING (CWE-457): [#def6]
lldpad-1.1.0/dcb_protocol.c:3064: error[legacyUninitvar]: Uninitialized variable: mask
# 3062|   		local_change = false;
# 3063|   		mask = DCB_SET_ALL_FLAGS(LOCAL);
# 3064|-> 		if (EventFlag & mask) {
# 3065|   			local_change = true;
# 3066|   			LLDPAD_DBG("  Local change*0x%x:", EventFlag);

Error: CPPCHECK_WARNING (CWE-457): [#def7]
lldpad-1.1.0/dcb_protocol.c:3765: error[uninitvar]: Uninitialized variable: mask
# 3763|   		/* Process local change if any. */
# 3764|   		mask = DCB_SET_ALL_FLAGS(LOCAL);
# 3765|-> 		if (EventFlag & mask) {
# 3766|   			LLDPAD_DBG("  Local change detected: ");
# 3767|   			LLDPAD_DBG(" %s", (EventFlag & DCB_LOCAL_CHANGE_PG) ?

Error: GCC_ANALYZER_WARNING (CWE-479): [#def8]
lldpad-1.1.0/dcbtool.c:470:9: warning[-Wanalyzer-unsafe-call-within-signal-handler]: call to ‘exit’ from within signal handler
lldpad-1.1.0/dcbtool.c:496:5: enter_function: entry to ‘main’
lldpad-1.1.0/dcbtool.c:470:9: danger: call to ‘exit’ from within signal handler
#  468|   {
#  469|   	cli_close_connection();
#  470|-> 	exit(0);
#  471|   }
#  472|   

Error: GCC_ANALYZER_WARNING (CWE-479): [#def9]
lldpad-1.1.0/eloop.c:378:9: warning[-Wanalyzer-unsafe-call-within-signal-handler]: call to ‘exit’ from within signal handler
lldpad-1.1.0/eloop.c:382:13: enter_function: entry to ‘eloop_handle_signal’
lldpad-1.1.0/eloop.c:386:12: branch_true: following ‘true’ branch...
lldpad-1.1.0/eloop.c:370:13: enter_function: entry to ‘eloop_handle_alarm’
lldpad-1.1.0/eloop.c:378:9: danger: call to ‘exit’ from within signal handler
#  376|   		"Killing program forcefully.\n"
#  377|   		"sig is %d.\n", sig);
#  378|-> 	exit(1);
#  379|   }
#  380|   

Error: CPPCHECK_WARNING (CWE-457): [#def10]
lldpad-1.1.0/event_iface.c:220: error[uninitvar]: Uninitialized variable: np->ops
#  218|   			   __func__, agent);
#  219|   		LIST_FOREACH(np, &lldp_mod_head, lldp) {
#  220|-> 			if (np->ops->lldp_mod_ifup)
#  221|   				np->ops->lldp_mod_ifup(device_name, agent);
#  222|   		}

Error: GCC_ANALYZER_WARNING (CWE-775): [#def11]
lldpad-1.1.0/event_iface.c:439:17: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘fd’
lldpad-1.1.0/event_iface.c:418:5: enter_function: entry to ‘event_iface_init’
lldpad-1.1.0/event_iface.c:424:14: acquire_resource: socket created here
lldpad-1.1.0/event_iface.c:426:12: branch_false: following ‘false’ branch (when ‘fd >= 0’)...
lldpad-1.1.0/event_iface.c:429:13: branch_false: ...to here
lldpad-1.1.0/event_iface.c:429:12: branch_false: following ‘false’ branch...
lldpad-1.1.0/event_iface.c:434:9: call_function: inlined call to ‘memset’ from ‘event_iface_init’
lldpad-1.1.0/event_iface.c:438:13: acquire_resource: socket created here
lldpad-1.1.0/event_iface.c:438:12: branch_true: following ‘true’ branch...
lldpad-1.1.0/event_iface.c:439:17: branch_true: ...to here
lldpad-1.1.0/event_iface.c:439:17: throw: if ‘close’ throws an exception...
lldpad-1.1.0/event_iface.c:439:17: danger: ‘fd’ leaks here
#  437|   
#  438|   	if (bind(fd, (struct sockaddr *)&snl, sizeof(struct sockaddr_nl)) < 0) {
#  439|-> 		close(fd);
#  440|   		return -EIO;
#  441|   	}

Error: GCC_ANALYZER_WARNING (CWE-775): [#def12]
lldpad-1.1.0/event_iface.c:443:16: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘fd’
lldpad-1.1.0/event_iface.c:418:5: enter_function: entry to ‘event_iface_init’
lldpad-1.1.0/event_iface.c:424:14: acquire_resource: socket created here
lldpad-1.1.0/event_iface.c:426:12: branch_false: following ‘false’ branch (when ‘fd >= 0’)...
lldpad-1.1.0/event_iface.c:429:13: branch_false: ...to here
lldpad-1.1.0/event_iface.c:429:12: branch_false: following ‘false’ branch...
lldpad-1.1.0/event_iface.c:434:9: call_function: inlined call to ‘memset’ from ‘event_iface_init’
lldpad-1.1.0/event_iface.c:438:12: branch_false: following ‘false’ branch...
lldpad-1.1.0/event_iface.c:443:16: branch_false: ...to here
lldpad-1.1.0/event_iface.c:443:16: throw: if ‘eloop_register_read_sock’ throws an exception...
lldpad-1.1.0/event_iface.c:443:16: danger: ‘fd’ leaks here
#  441|   	}
#  442|   
#  443|-> 	return eloop_register_read_sock(fd, event_iface_receive, NULL, NULL);
#  444|   }
#  445|   

Error: GCC_ANALYZER_WARNING (CWE-775): [#def13]
lldpad-1.1.0/event_iface.c:468:17: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘fd’
lldpad-1.1.0/event_iface.c:446:5: enter_function: entry to ‘event_iface_init_user_space’
lldpad-1.1.0/event_iface.c:452:14: acquire_resource: socket created here
lldpad-1.1.0/event_iface.c:454:12: branch_false: following ‘false’ branch (when ‘fd >= 0’)...
lldpad-1.1.0/event_iface.c:457:13: branch_false: ...to here
lldpad-1.1.0/event_iface.c:457:12: branch_false: following ‘false’ branch...
lldpad-1.1.0/event_iface.c:462:9: call_function: inlined call to ‘memset’ from ‘event_iface_init_user_space’
lldpad-1.1.0/event_iface.c:467:13: acquire_resource: socket created here
lldpad-1.1.0/event_iface.c:467:12: branch_true: following ‘true’ branch...
lldpad-1.1.0/event_iface.c:468:17: branch_true: ...to here
lldpad-1.1.0/event_iface.c:468:17: throw: if ‘close’ throws an exception...
lldpad-1.1.0/event_iface.c:468:17: danger: ‘fd’ leaks here
#  466|   
#  467|   	if (bind(fd, (struct sockaddr *)&snl, sizeof(struct sockaddr_nl)) < 0) {
#  468|-> 		close(fd);
#  469|   		LLDPAD_ERR("Error binding to netlink socket (%s) !\n", strerror(errno));
#  470|   		return -EIO;

Error: CPPCHECK_WARNING (CWE-457): [#def14]
lldpad-1.1.0/include/lldp_mod.h:106: error[uninitvar]: Uninitialized variable: mod->id
#  104|   
#  105|   	LIST_FOREACH(mod, head, lldp) {
#  106|-> 		if (mod->id == id)
#  107|   			return mod;
#  108|   	}

Error: CPPCHECK_WARNING (CWE-457): [#def15]
lldpad-1.1.0/lldp/agent.c:66: error[uninitvar]: Uninitialized variable: agent->type
#   64|   
#   65|   	LIST_FOREACH(agent, &port->agent_head, entry) {
#   66|-> 		if (agent->type == type)
#   67|   			return agent;
#   68|   	}

Error: CPPCHECK_WARNING (CWE-457): [#def16]
lldpad-1.1.0/lldp/agent.c:125: error[uninitvar]: Uninitialized variable: agent->type
#  123|   	LIST_FOREACH(agent, &port->agent_head, entry) {
#  124|   		count++;
#  125|-> 		if (agent->type != type)
#  126|   			continue;
#  127|   		return -1;

Error: CPPCHECK_WARNING (CWE-457): [#def17]
lldpad-1.1.0/lldp/agent.c:167: error[uninitvar]: Uninitialized variable: n->ops
#  165|   
#  166|   			LIST_FOREACH(n, &lldp_mod_head, lldp) {
#  167|-> 				if (n->ops && n->ops->timer)
#  168|   					n->ops->timer(port, agent);
#  169|   			}

Error: CPPCHECK_WARNING (CWE-457): [#def18]
lldpad-1.1.0/lldp/ports.c:241: error[uninitvar]: Uninitialized variables: agent.adminStatus, agent.pad, agent.stats, agent.rxChanges, agent.type
#  239|   
#  240|   		/* init & enable RX path */
#  241|-> 		rxInitializeLLDP(port, agent);
#  242|   
#  243|   		/* init TX path */

Error: CPPCHECK_WARNING (CWE-457): [#def19]
lldpad-1.1.0/lldp/rx.c:77: error[uninitvar]: Uninitialized variable: agent->rx.framein
#   75|   	 * can find a matching agent */
#   76|   	LIST_FOREACH(agent, &port->agent_head, entry) {
#   77|-> 		if (agent->rx.framein &&
#   78|   		    agent->rx.sizein == len &&
#   79|   		    (memcmp(buf, agent->rx.framein, len) == 0)) {

Error: CPPCHECK_WARNING (CWE-457): [#def20]
lldpad-1.1.0/lldp/rx.c:415: error[uninitvar]: Uninitialized variable: np->ops
#  413|   
#  414|   	LIST_FOREACH(np, &lldp_mod_head, lldp) {
#  415|-> 		if (!np->ops || !np->ops->lldp_mod_mibdelete)
#  416|   			continue;
#  417|   		np->ops->lldp_mod_mibdelete(port, agent);

Error: CPPCHECK_WARNING (CWE-457): [#def21]
lldpad-1.1.0/lldp/tx.c:75: error[uninitvar]: Uninitialized variable: np->ops
#   73|   	/* Generic TLV Pack */
#   74|   	LIST_FOREACH(np, &lldp_mod_head, lldp) {
#   75|-> 		if (!np->ops || !np->ops->lldp_mod_gettlv)
#   76|   			continue;
#   77|   

Error: COMPILER_WARNING: [#def22]
lldpad-1.1.0/lldp_8021qaz.c: scope_hint: In function ‘set_ets_tsa_map’
lldpad-1.1.0/lldp_8021qaz.c:178:13: warning[-Wunused-but-set-variable=]: variable ‘i’ set but not used
#  178 |         int i, type, tc;
#      |             ^
#  176|   static void set_ets_tsa_map(const char *arg, u8 *tsa_map)
#  177|   {
#  178|-> 	int i, type, tc;
#  179|   	char *argcpy = strdup(arg);
#  180|   	char *tokens;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def23]
lldpad-1.1.0/lldp_8021qaz.c:1566:21: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’
lldpad-1.1.0/lldp_8021qaz.c:1925:5: enter_function: entry to ‘ieee8021qaz_rchange’
lldpad-1.1.0/lldp_8021qaz.c:1932:12: branch_false: following ‘false’ branch...
lldpad-1.1.0/lldp_8021qaz.c:1935:37: branch_false: ...to here
lldpad-1.1.0/lldp_8021qaz.c:1935:20: call_function: calling ‘ieee8021qaz_data’ from ‘ieee8021qaz_rchange’
lldpad-1.1.0/lldp_8021qaz.c:1935:20: return_function: returning to ‘ieee8021qaz_rchange’ from ‘ieee8021qaz_data’
lldpad-1.1.0/lldp_8021qaz.c:1936:12: branch_false: following ‘false’ branch...
lldpad-1.1.0/lldp_8021qaz.c:1944:13: branch_false: ...to here
lldpad-1.1.0/lldp_8021qaz.c:1956:12: branch_true: following ‘true’ branch...
lldpad-1.1.0/lldp_8021qaz.c:1957:21: branch_true: ...to here
lldpad-1.1.0/lldp_8021qaz.c:1957:20: branch_false: following ‘false’ branch...
lldpad-1.1.0/lldp_8021qaz.c:1960:29: branch_false: ...to here
lldpad-1.1.0/lldp_8021qaz.c:1960:20: branch_false: following ‘false’ branch...
lldpad-1.1.0/lldp_8021qaz.c:1963:53: branch_false: ...to here
lldpad-1.1.0/lldp_8021qaz.c:1964:21: call_function: calling ‘unpack_ieee8021qaz_tlvs’ from ‘ieee8021qaz_rchange’
# 1564|   	switch (tlv->info[OUI_SIZE]) {
# 1565|   	case IEEE8021QAZ_ETSCFG_TLV:
# 1566|-> 		if (tlvs->rx->etscfg == NULL) {
# 1567|   			tlvs->ieee8021qazdu |= RCVD_IEEE8021QAZ_TLV_ETSCFG;
# 1568|   			tlvs->rx->etscfg = tlv;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def24]
lldpad-1.1.0/lldp_8021qaz.c:1577:21: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’
lldpad-1.1.0/lldp_8021qaz.c:1925:5: enter_function: entry to ‘ieee8021qaz_rchange’
lldpad-1.1.0/lldp_8021qaz.c:1932:12: branch_false: following ‘false’ branch...
lldpad-1.1.0/lldp_8021qaz.c:1935:37: branch_false: ...to here
lldpad-1.1.0/lldp_8021qaz.c:1935:20: call_function: calling ‘ieee8021qaz_data’ from ‘ieee8021qaz_rchange’
lldpad-1.1.0/lldp_8021qaz.c:1935:20: return_function: returning to ‘ieee8021qaz_rchange’ from ‘ieee8021qaz_data’
lldpad-1.1.0/lldp_8021qaz.c:1936:12: branch_false: following ‘false’ branch...
lldpad-1.1.0/lldp_8021qaz.c:1944:13: branch_false: ...to here
lldpad-1.1.0/lldp_8021qaz.c:1956:12: branch_true: following ‘true’ branch...
lldpad-1.1.0/lldp_8021qaz.c:1957:21: branch_true: ...to here
lldpad-1.1.0/lldp_8021qaz.c:1957:20: branch_false: following ‘false’ branch...
lldpad-1.1.0/lldp_8021qaz.c:1960:29: branch_false: ...to here
lldpad-1.1.0/lldp_8021qaz.c:1960:20: branch_false: following ‘false’ branch...
lldpad-1.1.0/lldp_8021qaz.c:1963:53: branch_false: ...to here
lldpad-1.1.0/lldp_8021qaz.c:1964:21: call_function: calling ‘unpack_ieee8021qaz_tlvs’ from ‘ieee8021qaz_rchange’
# 1575|   		break;
# 1576|   	case IEEE8021QAZ_ETSREC_TLV:
# 1577|-> 		if (tlvs->rx->etsrec == NULL) {
# 1578|   			tlvs->ieee8021qazdu |= RCVD_IEEE8021QAZ_TLV_ETSREC;
# 1579|   			tlvs->rx->etsrec = tlv;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def25]
lldpad-1.1.0/lldp_8021qaz.c:1589:21: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’
lldpad-1.1.0/lldp_8021qaz.c:1925:5: enter_function: entry to ‘ieee8021qaz_rchange’
lldpad-1.1.0/lldp_8021qaz.c:1932:12: branch_false: following ‘false’ branch...
lldpad-1.1.0/lldp_8021qaz.c:1935:37: branch_false: ...to here
lldpad-1.1.0/lldp_8021qaz.c:1935:20: call_function: calling ‘ieee8021qaz_data’ from ‘ieee8021qaz_rchange’
lldpad-1.1.0/lldp_8021qaz.c:1935:20: return_function: returning to ‘ieee8021qaz_rchange’ from ‘ieee8021qaz_data’
lldpad-1.1.0/lldp_8021qaz.c:1936:12: branch_false: following ‘false’ branch...
lldpad-1.1.0/lldp_8021qaz.c:1944:13: branch_false: ...to here
lldpad-1.1.0/lldp_8021qaz.c:1956:12: branch_true: following ‘true’ branch...
lldpad-1.1.0/lldp_8021qaz.c:1957:21: branch_true: ...to here
lldpad-1.1.0/lldp_8021qaz.c:1957:20: branch_false: following ‘false’ branch...
lldpad-1.1.0/lldp_8021qaz.c:1960:29: branch_false: ...to here
lldpad-1.1.0/lldp_8021qaz.c:1960:20: branch_false: following ‘false’ branch...
lldpad-1.1.0/lldp_8021qaz.c:1963:53: branch_false: ...to here
lldpad-1.1.0/lldp_8021qaz.c:1964:21: call_function: calling ‘unpack_ieee8021qaz_tlvs’ from ‘ieee8021qaz_rchange’
# 1587|   
# 1588|   	case IEEE8021QAZ_PFC_TLV:
# 1589|-> 		if (tlvs->rx->pfc == NULL) {
# 1590|   			tlvs->ieee8021qazdu |= RCVD_IEEE8021QAZ_TLV_PFC;
# 1591|   			tlvs->rx->pfc = tlv;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def26]
lldpad-1.1.0/lldp_8021qaz.c:1600:21: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’
lldpad-1.1.0/lldp_8021qaz.c:1925:5: enter_function: entry to ‘ieee8021qaz_rchange’
lldpad-1.1.0/lldp_8021qaz.c:1932:12: branch_false: following ‘false’ branch...
lldpad-1.1.0/lldp_8021qaz.c:1935:37: branch_false: ...to here
lldpad-1.1.0/lldp_8021qaz.c:1935:20: call_function: calling ‘ieee8021qaz_data’ from ‘ieee8021qaz_rchange’
lldpad-1.1.0/lldp_8021qaz.c:1935:20: return_function: returning to ‘ieee8021qaz_rchange’ from ‘ieee8021qaz_data’
lldpad-1.1.0/lldp_8021qaz.c:1936:12: branch_false: following ‘false’ branch...
lldpad-1.1.0/lldp_8021qaz.c:1944:13: branch_false: ...to here
lldpad-1.1.0/lldp_8021qaz.c:1956:12: branch_true: following ‘true’ branch...
lldpad-1.1.0/lldp_8021qaz.c:1957:21: branch_true: ...to here
lldpad-1.1.0/lldp_8021qaz.c:1957:20: branch_false: following ‘false’ branch...
lldpad-1.1.0/lldp_8021qaz.c:1960:29: branch_false: ...to here
lldpad-1.1.0/lldp_8021qaz.c:1960:20: branch_false: following ‘false’ branch...
lldpad-1.1.0/lldp_8021qaz.c:1963:53: branch_false: ...to here
lldpad-1.1.0/lldp_8021qaz.c:1964:21: call_function: calling ‘unpack_ieee8021qaz_tlvs’ from ‘ieee8021qaz_rchange’
# 1598|   		break;
# 1599|   	case IEEE8021QAZ_APP_TLV:
# 1600|-> 		if (tlvs->rx->app == NULL) {
# 1601|   			tlvs->ieee8021qazdu |= RCVD_IEEE8021QAZ_TLV_APP;
# 1602|   			tlvs->rx->app = tlv;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def27]
lldpad-1.1.0/lldp_8021qaz.c:1650:13: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’
lldpad-1.1.0/lldp_8021qaz.c:1641:13: enter_function: entry to ‘process_ieee8021qaz_etscfg_tlv’
lldpad-1.1.0/lldp_8021qaz.c:1647:16: call_function: calling ‘ieee8021qaz_data’ from ‘process_ieee8021qaz_etscfg_tlv’
lldpad-1.1.0/lldp_8021qaz.c:1647:16: return_function: returning to ‘process_ieee8021qaz_etscfg_tlv’ from ‘ieee8021qaz_data’
lldpad-1.1.0/lldp_8021qaz.c:1650:13: danger: dereference of NULL ‘ieee8021qaz_data(&*port.ifname)’
# 1648|   	offset = OUI_SUB_SIZE;
# 1649|   
# 1650|-> 	if (tlvs->ets->cfgr)
# 1651|   		free(tlvs->ets->cfgr);
# 1652|   	tlvs->ets->cfgr = malloc(sizeof(*tlvs->ets->cfgr));

Error: GCC_ANALYZER_WARNING (CWE-476): [#def28]
lldpad-1.1.0/lldp_8021qaz.c:1708:13: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’
lldpad-1.1.0/lldp_8021qaz.c:1697:13: enter_function: entry to ‘process_ieee8021qaz_etsrec_tlv’
lldpad-1.1.0/lldp_8021qaz.c:1703:16: call_function: calling ‘ieee8021qaz_data’ from ‘process_ieee8021qaz_etsrec_tlv’
lldpad-1.1.0/lldp_8021qaz.c:1703:16: return_function: returning to ‘process_ieee8021qaz_etsrec_tlv’ from ‘ieee8021qaz_data’
lldpad-1.1.0/lldp_8021qaz.c:1708:13: danger: dereference of NULL ‘ieee8021qaz_data(&*port.ifname)’
# 1706|   	offset = OUI_SUB_SIZE + 1;
# 1707|   
# 1708|-> 	if (tlvs->ets->recr)
# 1709|   		memset(tlvs->ets->recr, 0, sizeof(*tlvs->ets->recr));
# 1710|   	else

Error: GCC_ANALYZER_WARNING (CWE-476): [#def29]
lldpad-1.1.0/lldp_8021qaz.c:1748:13: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’
lldpad-1.1.0/lldp_8021qaz.c:1739:13: enter_function: entry to ‘process_ieee8021qaz_pfc_tlv’
lldpad-1.1.0/lldp_8021qaz.c:1744:16: call_function: calling ‘ieee8021qaz_data’ from ‘process_ieee8021qaz_pfc_tlv’
lldpad-1.1.0/lldp_8021qaz.c:1744:16: return_function: returning to ‘process_ieee8021qaz_pfc_tlv’ from ‘ieee8021qaz_data’
lldpad-1.1.0/lldp_8021qaz.c:1748:13: danger: dereference of NULL ‘ieee8021qaz_data(&*port.ifname)’
# 1746|   	/* Bypassing OUI, SUBTYPE fields */
# 1747|   	offset = OUI_SUB_SIZE;
# 1748|-> 	if (tlvs->rx->pfc->info[offset] & BIT7)
# 1749|   		tlvs->pfc->remote.willing = true;
# 1750|   	else

Error: GCC_ANALYZER_WARNING (CWE-476): [#def30]
lldpad-1.1.0/lldp_8021qaz.c:1894:13: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’
lldpad-1.1.0/lldp_8021qaz.c:1888:13: enter_function: entry to ‘ieee8021qaz_mibUpdateObjects’
lldpad-1.1.0/lldp_8021qaz.c:1892:16: call_function: calling ‘ieee8021qaz_data’ from ‘ieee8021qaz_mibUpdateObjects’
lldpad-1.1.0/lldp_8021qaz.c:1892:16: return_function: returning to ‘ieee8021qaz_mibUpdateObjects’ from ‘ieee8021qaz_data’
lldpad-1.1.0/lldp_8021qaz.c:1894:13: danger: dereference of NULL ‘ieee8021qaz_data(&*port.ifname)’
# 1892|   	tlvs = ieee8021qaz_data(port->ifname);
# 1893|   
# 1894|-> 	if (tlvs->rx->etscfg) {
# 1895|   		process_ieee8021qaz_etscfg_tlv(port);
# 1896|   	} else if (tlvs->ets->cfgr) {

Error: GCC_ANALYZER_WARNING (CWE-401): [#def31]
lldpad-1.1.0/lldp_8021qaz_cmds.c:179:15: warning[-Wanalyzer-malloc-leak]: leak of ‘parse’
lldpad-1.1.0/lldp_8021qaz_cmds.c:901:12: enter_function: entry to ‘_set_arg_enabled’
lldpad-1.1.0/lldp_8021qaz_cmds.c:911:12: branch_false: following ‘false’ branch...
lldpad-1.1.0/lldp_8021qaz_cmds.c:914:17: branch_false: ...to here
lldpad-1.1.0/lldp_8021qaz_cmds.c:923:17: acquire_memory: allocated here
lldpad-1.1.0/lldp_8021qaz_cmds.c:924:12: branch_false: following ‘false’ branch (when ‘parse’ is non-NULL)...
lldpad-1.1.0/lldp_8021qaz_cmds.c:928:13: branch_false: ...to here
lldpad-1.1.0/lldp_8021qaz_cmds.c:953:12: branch_true: following ‘true’ branch (when ‘test != 0’)...
lldpad-1.1.0/lldp_8021qaz_cmds.c:954:33: branch_true: ...to here
lldpad-1.1.0/lldp_8021qaz_cmds.c:954:22: call_function: calling ‘is_dcbx_hw’ from ‘_set_arg_enabled’
#  177|   
#  178|   query_retry:
#  179|-> 	err = get_dcbx_hw(ifname, &dcbx);
#  180|   
#  181|   	if (err == -ENOMEM && tries < MAX_DCBX_HW_RETRIES) {

Error: GCC_ANALYZER_WARNING (CWE-401): [#def32]
lldpad-1.1.0/lldp_8021qaz_cmds.c:553:9: warning[-Wanalyzer-malloc-leak]: leak of ‘parse’
lldpad-1.1.0/lldp_8021qaz_cmds.c:443:12: branch_false: following ‘false’ branch...
lldpad-1.1.0/lldp_8021qaz_cmds.c:446:33: branch_false: ...to here
lldpad-1.1.0/lldp_8021qaz_cmds.c:467:17: acquire_memory: allocated here
lldpad-1.1.0/lldp_8021qaz_cmds.c:468:12: branch_false: following ‘false’ branch (when ‘parse’ is non-NULL)...
lldpad-1.1.0/lldp_8021qaz_cmds.c:472:13: branch_false: ...to here
lldpad-1.1.0/lldp_8021qaz_cmds.c:475:24: branch_false: following ‘false’ branch (when ‘toked_maps’ is NULL)...
lldpad-1.1.0/lldp_8021qaz_cmds.c:540:12: branch_false: ...to here
lldpad-1.1.0/lldp_8021qaz_cmds.c:540:12: branch_false: following ‘false’ branch (when ‘test == 0’)...
lldpad-1.1.0/lldp_8021qaz_cmds.c:548:9: branch_false: ...to here
lldpad-1.1.0/lldp_8021qaz_cmds.c:553:9: throw: if ‘set_config_setting’ throws an exception...
lldpad-1.1.0/lldp_8021qaz_cmds.c:553:9: danger: ‘parse’ leaks here; was allocated at [(3)](sarif:/runs/0/results/3/codeFlows/0/threadFlows/0/locations/2)
#  551|   	snprintf(arg_path, sizeof(arg_path), "%s%08x.%s", TLVID_PREFIX,
#  552|   		 cmd->tlvid, args);
#  553|-> 	set_config_setting(cmd->ifname, cmd->type, arg_path, &arg_value,
#  554|   			   CONFIG_TYPE_STRING);
#  555|   	somethingChangedLocal(cmd->ifname, cmd->type);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def33]
lldpad-1.1.0/lldp_8021qaz_cmds.c:555:9: warning[-Wanalyzer-malloc-leak]: leak of ‘parse’
lldpad-1.1.0/lldp_8021qaz_cmds.c:443:12: branch_false: following ‘false’ branch...
lldpad-1.1.0/lldp_8021qaz_cmds.c:446:33: branch_false: ...to here
lldpad-1.1.0/lldp_8021qaz_cmds.c:467:17: acquire_memory: allocated here
lldpad-1.1.0/lldp_8021qaz_cmds.c:468:12: branch_false: following ‘false’ branch (when ‘parse’ is non-NULL)...
lldpad-1.1.0/lldp_8021qaz_cmds.c:472:13: branch_false: ...to here
lldpad-1.1.0/lldp_8021qaz_cmds.c:475:24: branch_false: following ‘false’ branch (when ‘toked_maps’ is NULL)...
lldpad-1.1.0/lldp_8021qaz_cmds.c:540:12: branch_false: ...to here
lldpad-1.1.0/lldp_8021qaz_cmds.c:540:12: branch_false: following ‘false’ branch (when ‘test == 0’)...
lldpad-1.1.0/lldp_8021qaz_cmds.c:548:9: branch_false: ...to here
lldpad-1.1.0/lldp_8021qaz_cmds.c:555:9: throw: if ‘somethingChangedLocal’ throws an exception...
lldpad-1.1.0/lldp_8021qaz_cmds.c:555:9: danger: ‘parse’ leaks here; was allocated at [(3)](sarif:/runs/0/results/4/codeFlows/0/threadFlows/0/locations/2)
#  553|   	set_config_setting(cmd->ifname, cmd->type, arg_path, &arg_value,
#  554|   			   CONFIG_TYPE_STRING);
#  555|-> 	somethingChangedLocal(cmd->ifname, cmd->type);
#  556|   invalid:
#  557|   	free(parse);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def34]
lldpad-1.1.0/lldp_8021qaz_cmds.c:559:1: warning[-Wanalyzer-malloc-leak]: leak of ‘parse’
lldpad-1.1.0/lldp_8021qaz_cmds.c:567:12: enter_function: entry to ‘test_arg_up2tc’
lldpad-1.1.0/lldp_8021qaz_cmds.c:570:16: call_function: calling ‘_set_arg_up2tc’ from ‘test_arg_up2tc’
#  557|   	free(parse);
#  558|   	return err;
#  559|-> }
#  560|   
#  561|   static int set_arg_up2tc(struct cmd *cmd, char *args,

Error: GCC_ANALYZER_WARNING (CWE-401): [#def35]
lldpad-1.1.0/lldp_8021qaz_cmds.c:847:9: warning[-Wanalyzer-malloc-leak]: leak of ‘parse’
lldpad-1.1.0/lldp_8021qaz_cmds.c:735:1: enter_function: entry to ‘_set_arg_tsa’
lldpad-1.1.0/lldp_8021qaz_cmds.c:744:12: branch_false: following ‘false’ branch...
lldpad-1.1.0/lldp_8021qaz_cmds.c:747:17: branch_false: ...to here
lldpad-1.1.0/lldp_8021qaz_cmds.c:750:20: branch_true: following ‘true’ branch...
lldpad-1.1.0/lldp_8021qaz_cmds.c:751:31: branch_true: ...to here
lldpad-1.1.0/lldp_8021qaz_cmds.c:764:17: acquire_memory: allocated here
lldpad-1.1.0/lldp_8021qaz_cmds.c:765:12: branch_false: following ‘false’ branch (when ‘parse’ is non-NULL)...
lldpad-1.1.0/lldp_8021qaz_cmds.c:769:13: branch_false: ...to here
lldpad-1.1.0/lldp_8021qaz_cmds.c:772:24: branch_false: following ‘false’ branch (when ‘toked_maps’ is NULL)...
lldpad-1.1.0/lldp_8021qaz_cmds.c:807:12: branch_false: ...to here
lldpad-1.1.0/lldp_8021qaz_cmds.c:807:12: branch_false: following ‘false’ branch (when ‘test == 0’)...
lldpad-1.1.0/lldp_8021qaz_cmds.c:814:33: branch_false: ...to here
lldpad-1.1.0/lldp_8021qaz_cmds.c:815:21: branch_true: following ‘true’ branch (when ‘i != 8’)...
lldpad-1.1.0/lldp_8021qaz_cmds.c:819:17: call_function: inlined call to ‘snprintf’ from ‘_set_arg_tsa’
lldpad-1.1.0/lldp_8021qaz_cmds.c:823:20: branch_true: following ‘true’ branch (when ‘tsa’ is non-NULL)...
lldpad-1.1.0/lldp_8021qaz_cmds.c:824:36: branch_true: ...to here
lldpad-1.1.0/lldp_8021qaz_cmds.c:823:20: branch_true: following ‘true’ branch (when ‘tsa’ is non-NULL)...
lldpad-1.1.0/lldp_8021qaz_cmds.c:824:36: branch_true: ...to here
lldpad-1.1.0/lldp_8021qaz_cmds.c:847:9: throw: if ‘set_config_setting’ throws an exception...
lldpad-1.1.0/lldp_8021qaz_cmds.c:847:9: danger: ‘parse’ leaks here; was allocated at [(8)](sarif:/runs/0/results/6/codeFlows/0/threadFlows/0/locations/7)
#  845|   	snprintf(arg_path, sizeof(arg_path), "%s%08x.%s",
#  846|   		 TLVID_PREFIX, cmd->tlvid, args);
#  847|-> 	set_config_setting(cmd->ifname, cmd->type, arg_path, &arg_value,
#  848|   			   CONFIG_TYPE_STRING);
#  849|   	somethingChangedLocal(cmd->ifname, cmd->type);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def36]
lldpad-1.1.0/lldp_8021qaz_cmds.c:849:9: warning[-Wanalyzer-malloc-leak]: leak of ‘parse’
lldpad-1.1.0/lldp_8021qaz_cmds.c:735:1: enter_function: entry to ‘_set_arg_tsa’
lldpad-1.1.0/lldp_8021qaz_cmds.c:744:12: branch_false: following ‘false’ branch...
lldpad-1.1.0/lldp_8021qaz_cmds.c:747:17: branch_false: ...to here
lldpad-1.1.0/lldp_8021qaz_cmds.c:750:20: branch_true: following ‘true’ branch...
lldpad-1.1.0/lldp_8021qaz_cmds.c:751:31: branch_true: ...to here
lldpad-1.1.0/lldp_8021qaz_cmds.c:764:17: acquire_memory: allocated here
lldpad-1.1.0/lldp_8021qaz_cmds.c:765:12: branch_false: following ‘false’ branch (when ‘parse’ is non-NULL)...
lldpad-1.1.0/lldp_8021qaz_cmds.c:769:13: branch_false: ...to here
lldpad-1.1.0/lldp_8021qaz_cmds.c:772:24: branch_false: following ‘false’ branch (when ‘toked_maps’ is NULL)...
lldpad-1.1.0/lldp_8021qaz_cmds.c:807:12: branch_false: ...to here
lldpad-1.1.0/lldp_8021qaz_cmds.c:807:12: branch_false: following ‘false’ branch (when ‘test == 0’)...
lldpad-1.1.0/lldp_8021qaz_cmds.c:814:33: branch_false: ...to here
lldpad-1.1.0/lldp_8021qaz_cmds.c:815:21: branch_true: following ‘true’ branch (when ‘i != 8’)...
lldpad-1.1.0/lldp_8021qaz_cmds.c:819:17: call_function: inlined call to ‘snprintf’ from ‘_set_arg_tsa’
lldpad-1.1.0/lldp_8021qaz_cmds.c:823:20: branch_true: following ‘true’ branch (when ‘tsa’ is non-NULL)...
lldpad-1.1.0/lldp_8021qaz_cmds.c:824:36: branch_true: ...to here
lldpad-1.1.0/lldp_8021qaz_cmds.c:823:20: branch_true: following ‘true’ branch (when ‘tsa’ is non-NULL)...
lldpad-1.1.0/lldp_8021qaz_cmds.c:824:36: branch_true: ...to here
lldpad-1.1.0/lldp_8021qaz_cmds.c:849:9: throw: if ‘somethingChangedLocal’ throws an exception...
lldpad-1.1.0/lldp_8021qaz_cmds.c:849:9: danger: ‘parse’ leaks here; was allocated at [(8)](sarif:/runs/0/results/7/codeFlows/0/threadFlows/0/locations/7)
#  847|   	set_config_setting(cmd->ifname, cmd->type, arg_path, &arg_value,
#  848|   			   CONFIG_TYPE_STRING);
#  849|-> 	somethingChangedLocal(cmd->ifname, cmd->type);
#  850|   invalid:
#  851|   	free(parse);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def37]
lldpad-1.1.0/lldp_8021qaz_cmds.c:853:1: warning[-Wanalyzer-malloc-leak]: leak of ‘parse’
lldpad-1.1.0/lldp_8021qaz_cmds.c:861:12: enter_function: entry to ‘test_arg_tsa’
lldpad-1.1.0/lldp_8021qaz_cmds.c:864:16: call_function: calling ‘_set_arg_tsa’ from ‘test_arg_tsa’
#  851|   	free(parse);
#  852|   	return err;
#  853|-> }
#  854|   
#  855|   static int set_arg_tsa(struct cmd *cmd, char *args, char *arg_value,

Error: GCC_ANALYZER_WARNING (CWE-401): [#def38]
lldpad-1.1.0/lldp_8021qaz_cmds.c:990:1: warning[-Wanalyzer-malloc-leak]: leak of ‘parse’
lldpad-1.1.0/lldp_8021qaz_cmds.c:911:12: branch_false: following ‘false’ branch...
lldpad-1.1.0/lldp_8021qaz_cmds.c:914:17: branch_false: ...to here
lldpad-1.1.0/lldp_8021qaz_cmds.c:923:17: acquire_memory: allocated here
lldpad-1.1.0/lldp_8021qaz_cmds.c:924:12: branch_false: following ‘false’ branch (when ‘parse’ is non-NULL)...
lldpad-1.1.0/lldp_8021qaz_cmds.c:928:13: branch_false: ...to here
lldpad-1.1.0/lldp_8021qaz_cmds.c:928:12: branch_true: following ‘true’ branch (when the strings are non-equal)...
lldpad-1.1.0/lldp_8021qaz_cmds.c:929:28: branch_true: ...to here
lldpad-1.1.0/lldp_8021qaz_cmds.c:931:24: branch_true: following ‘true’ branch (when ‘priority’ is non-NULL)...
lldpad-1.1.0/lldp_8021qaz_cmds.c:935:25: branch_true: ...to here
lldpad-1.1.0/lldp_8021qaz_cmds.c:990:1: danger: ‘parse’ leaks here; was allocated at [(5)](sarif:/runs/0/results/9/codeFlows/0/threadFlows/0/locations/4)
#  988|   	free(parse);
#  989|   	return err;
#  990|-> }
#  991|   
#  992|   static int set_arg_enabled(struct cmd *cmd, char *args,

Error: GCC_ANALYZER_WARNING (CWE-401): [#def39]
lldpad-1.1.0/lldp_8021qaz_cmds.c:1147:23: warning[-Wanalyzer-malloc-leak]: leak of ‘parse’
lldpad-1.1.0/lldp_8021qaz_cmds.c:1114:12: enter_function: entry to ‘get_arg_app’
lldpad-1.1.0/lldp_8021qaz_cmds.c:1125:12: branch_false: following ‘false’ branch...
lldpad-1.1.0/lldp_8021qaz_cmds.c:1128:17: branch_false: ...to here
lldpad-1.1.0/lldp_8021qaz_cmds.c:1138:21: branch_true: following ‘true’ branch (when ‘i != 32’)...
lldpad-1.1.0/lldp_8021qaz_cmds.c:1143:17: call_function: inlined call to ‘snprintf’ from ‘get_arg_app’
lldpad-1.1.0/lldp_8021qaz_cmds.c:1153:25: acquire_memory: allocated here
lldpad-1.1.0/lldp_8021qaz_cmds.c:1154:20: branch_false: following ‘false’ branch (when ‘parse’ is non-NULL)...
lldpad-1.1.0/lldp_8021qaz_cmds.c:1156:29: branch_false: ...to here
lldpad-1.1.0/lldp_8021qaz_cmds.c:1157:20: branch_false: following ‘false’ branch (when ‘app_tuple’ is non-NULL)...
lldpad-1.1.0/lldp_8021qaz_cmds.c:1159:24: call_function: inlined call to ‘atoi’ from ‘get_arg_app’
lldpad-1.1.0/lldp_8021qaz_cmds.c:1161:20: branch_false: following ‘false’ branch (when ‘app_tuple’ is non-NULL)...
lldpad-1.1.0/lldp_8021qaz_cmds.c:1163:23: call_function: inlined call to ‘atoi’ from ‘get_arg_app’
lldpad-1.1.0/lldp_8021qaz_cmds.c:1166:20: branch_false: following ‘false’ branch (when ‘app_tuple’ is non-NULL)...
lldpad-1.1.0/lldp_8021qaz_cmds.c:1170:17: branch_false: ...to here
lldpad-1.1.0/lldp_8021qaz_cmds.c:1138:21: branch_true: following ‘true’ branch (when ‘i != 32’)...
lldpad-1.1.0/lldp_8021qaz_cmds.c:1143:17: call_function: inlined call to ‘snprintf’ from ‘get_arg_app’
lldpad-1.1.0/lldp_8021qaz_cmds.c:1147:23: throw: if ‘get_config_setting’ throws an exception...
lldpad-1.1.0/lldp_8021qaz_cmds.c:1147:23: danger: ‘parse’ leaks here; was allocated at [(9)](sarif:/runs/0/results/10/codeFlows/0/threadFlows/0/locations/8)
# 1145|   			 ARG_APP, i);
# 1146|   		errno = 0;
# 1147|-> 		err = get_config_setting(cmd->ifname, cmd->type, arg_path,
# 1148|   					 &app, CONFIG_TYPE_STRING);
# 1149|   		if (err)

Error: GCC_ANALYZER_WARNING (CWE-401): [#def40]
lldpad-1.1.0/lldp_8021qaz_cmds.c:1153:25: warning[-Wanalyzer-malloc-leak]: leak of ‘parse’
lldpad-1.1.0/lldp_8021qaz_cmds.c:1114:12: enter_function: entry to ‘get_arg_app’
lldpad-1.1.0/lldp_8021qaz_cmds.c:1125:12: branch_false: following ‘false’ branch...
lldpad-1.1.0/lldp_8021qaz_cmds.c:1128:17: branch_false: ...to here
lldpad-1.1.0/lldp_8021qaz_cmds.c:1138:21: branch_true: following ‘true’ branch (when ‘i != 32’)...
lldpad-1.1.0/lldp_8021qaz_cmds.c:1143:17: call_function: inlined call to ‘snprintf’ from ‘get_arg_app’
lldpad-1.1.0/lldp_8021qaz_cmds.c:1153:25: acquire_memory: allocated here
lldpad-1.1.0/lldp_8021qaz_cmds.c:1154:20: branch_false: following ‘false’ branch (when ‘parse’ is non-NULL)...
lldpad-1.1.0/lldp_8021qaz_cmds.c:1156:29: branch_false: ...to here
lldpad-1.1.0/lldp_8021qaz_cmds.c:1157:20: branch_false: following ‘false’ branch (when ‘app_tuple’ is non-NULL)...
lldpad-1.1.0/lldp_8021qaz_cmds.c:1159:24: call_function: inlined call to ‘atoi’ from ‘get_arg_app’
lldpad-1.1.0/lldp_8021qaz_cmds.c:1161:20: branch_false: following ‘false’ branch (when ‘app_tuple’ is non-NULL)...
lldpad-1.1.0/lldp_8021qaz_cmds.c:1163:23: call_function: inlined call to ‘atoi’ from ‘get_arg_app’
lldpad-1.1.0/lldp_8021qaz_cmds.c:1166:20: branch_false: following ‘false’ branch (when ‘app_tuple’ is non-NULL)...
lldpad-1.1.0/lldp_8021qaz_cmds.c:1170:17: branch_false: ...to here
lldpad-1.1.0/lldp_8021qaz_cmds.c:1138:21: branch_true: following ‘true’ branch (when ‘i != 32’)...
lldpad-1.1.0/lldp_8021qaz_cmds.c:1143:17: call_function: inlined call to ‘snprintf’ from ‘get_arg_app’
lldpad-1.1.0/lldp_8021qaz_cmds.c:1153:25: danger: ‘parse’ leaks here; was allocated at [(9)](sarif:/runs/0/results/11/codeFlows/0/threadFlows/0/locations/8)
# 1151|   
# 1152|   		/* Parse cfg file input, bounds checking done on set app cmd */
# 1153|-> 		parse = strdup(app);
# 1154|   		if (!parse)
# 1155|   			break;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def41]
lldpad-1.1.0/lldp_8021qaz_cmds.c:1226:1: warning[-Wanalyzer-malloc-leak]: leak of ‘parse’
lldpad-1.1.0/lldp_8021qaz_cmds.c:1114:12: enter_function: entry to ‘get_arg_app’
lldpad-1.1.0/lldp_8021qaz_cmds.c:1125:12: branch_false: following ‘false’ branch...
lldpad-1.1.0/lldp_8021qaz_cmds.c:1128:17: branch_false: ...to here
lldpad-1.1.0/lldp_8021qaz_cmds.c:1138:21: branch_true: following ‘true’ branch (when ‘i != 32’)...
lldpad-1.1.0/lldp_8021qaz_cmds.c:1143:17: call_function: inlined call to ‘snprintf’ from ‘get_arg_app’
lldpad-1.1.0/lldp_8021qaz_cmds.c:1153:25: acquire_memory: allocated here
lldpad-1.1.0/lldp_8021qaz_cmds.c:1154:20: branch_false: following ‘false’ branch (when ‘parse’ is non-NULL)...
lldpad-1.1.0/lldp_8021qaz_cmds.c:1156:29: branch_false: ...to here
lldpad-1.1.0/lldp_8021qaz_cmds.c:1157:20: branch_true: following ‘true’ branch (when ‘app_tuple’ is NULL)...
lldpad-1.1.0/lldp_8021qaz_cmds.c:1226:1: branch_true: ...to here
lldpad-1.1.0/lldp_8021qaz_cmds.c:1226:1: danger: ‘parse’ leaks here; was allocated at [(9)](sarif:/runs/0/results/12/codeFlows/0/threadFlows/0/locations/8)
# 1224|   
# 1225|   	return cmd_success;
# 1226|-> }
# 1227|   
# 1228|   static int _set_arg_app(struct cmd *cmd, char *args, char *arg_value,

Error: GCC_ANALYZER_WARNING (CWE-416): [#def42]
lldpad-1.1.0/lldp_8023.c:314:17: warning[-Wanalyzer-use-after-free]: use after ‘free’ of ‘bd’
lldpad-1.1.0/lldp_8023.c:494:6: enter_function: entry to ‘ieee8023_unregister’
lldpad-1.1.0/lldp_8023.c:496:12: branch_true: following ‘true’ branch...
lldpad-1.1.0/lldp_8023.c:497:17: branch_true: ...to here
lldpad-1.1.0/lldp_8023.c:497:17: call_function: calling ‘ieee8023_free_data’ from ‘ieee8023_unregister’
#  312|   {
#  313|   	if (bd) {
#  314|-> 		FREE_UNPKD_TLV(bd, maccfg);
#  315|   		FREE_UNPKD_TLV(bd, powvmdi);
#  316|   		FREE_UNPKD_TLV(bd, linkagg);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def43]
lldpad-1.1.0/lldp_8023.c:486:9: warning[-Wanalyzer-malloc-leak]: leak of ‘mod’
lldpad-1.1.0/lldp_8023.c:471:15: acquire_memory: allocated here
lldpad-1.1.0/lldp_8023.c:472:12: branch_false: following ‘false’ branch (when ‘mod’ is non-NULL)...
lldpad-1.1.0/lldp_8023.c:476:14: branch_false: ...to here
lldpad-1.1.0/lldp_8023.c:477:12: branch_false: following ‘false’ branch (when ‘ud’ is non-NULL)...
lldpad-1.1.0/lldp_8023.c:482:9: branch_false: ...to here
lldpad-1.1.0/lldp_8023.c:486:9: throw: if ‘log_message’ throws an exception...
lldpad-1.1.0/lldp_8023.c:486:9: danger: ‘mod’ leaks here; was allocated at [(1)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/0)
#  484|   	mod->ops = &ieee8023_ops;
#  485|   	mod->data = ud;
#  486|-> 	LLDPAD_INFO("%s:done\n", __func__);
#  487|   	return mod;
#  488|   out_err:

Error: GCC_ANALYZER_WARNING (CWE-401): [#def44]
lldpad-1.1.0/lldp_8023.c:486:9: warning[-Wanalyzer-malloc-leak]: leak of ‘ud’
lldpad-1.1.0/lldp_8023.c:472:12: branch_false: following ‘false’ branch (when ‘mod’ is non-NULL)...
lldpad-1.1.0/lldp_8023.c:476:14: branch_false: ...to here
lldpad-1.1.0/lldp_8023.c:476:14: acquire_memory: allocated here
lldpad-1.1.0/lldp_8023.c:477:12: branch_false: following ‘false’ branch (when ‘ud’ is non-NULL)...
lldpad-1.1.0/lldp_8023.c:482:9: branch_false: ...to here
lldpad-1.1.0/lldp_8023.c:486:9: throw: if ‘log_message’ throws an exception...
lldpad-1.1.0/lldp_8023.c:486:9: danger: ‘ud’ leaks here; was allocated at [(3)](sarif:/runs/0/results/2/codeFlows/0/threadFlows/0/locations/2)
#  484|   	mod->ops = &ieee8023_ops;
#  485|   	mod->data = ud;
#  486|-> 	LLDPAD_INFO("%s:done\n", __func__);
#  487|   	return mod;
#  488|   out_err:

Error: GCC_ANALYZER_WARNING (CWE-401): [#def45]
lldpad-1.1.0/lldp_basman.c:718:9: warning[-Wanalyzer-malloc-leak]: leak of ‘bud’
lldpad-1.1.0/lldp_basman.c:704:12: branch_false: following ‘false’ branch (when ‘mod’ is non-NULL)...
lldpad-1.1.0/lldp_basman.c:708:15: branch_false: ...to here
lldpad-1.1.0/lldp_basman.c:708:15: acquire_memory: allocated here
lldpad-1.1.0/lldp_basman.c:709:12: branch_false: following ‘false’ branch (when ‘bud’ is non-NULL)...
lldpad-1.1.0/lldp_basman.c:714:9: branch_false: ...to here
lldpad-1.1.0/lldp_basman.c:718:9: throw: if ‘log_message’ throws an exception...
lldpad-1.1.0/lldp_basman.c:718:9: danger: ‘bud’ leaks here; was allocated at [(3)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/2)
#  716|   	mod->ops = &basman_ops;
#  717|   	mod->data = bud;
#  718|-> 	LLDPAD_DBG("%s:done\n", __func__);
#  719|   	return mod;
#  720|   out_err:

Error: GCC_ANALYZER_WARNING (CWE-401): [#def46]
lldpad-1.1.0/lldp_basman.c:718:9: warning[-Wanalyzer-malloc-leak]: leak of ‘mod’
lldpad-1.1.0/lldp_basman.c:703:15: acquire_memory: allocated here
lldpad-1.1.0/lldp_basman.c:704:12: branch_false: following ‘false’ branch (when ‘mod’ is non-NULL)...
lldpad-1.1.0/lldp_basman.c:708:15: branch_false: ...to here
lldpad-1.1.0/lldp_basman.c:709:12: branch_false: following ‘false’ branch (when ‘bud’ is non-NULL)...
lldpad-1.1.0/lldp_basman.c:714:9: branch_false: ...to here
lldpad-1.1.0/lldp_basman.c:718:9: throw: if ‘log_message’ throws an exception...
lldpad-1.1.0/lldp_basman.c:718:9: danger: ‘mod’ leaks here; was allocated at [(1)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/0)
#  716|   	mod->ops = &basman_ops;
#  717|   	mod->data = bud;
#  718|-> 	LLDPAD_DBG("%s:done\n", __func__);
#  719|   	return mod;
#  720|   out_err:

Error: GCC_ANALYZER_WARNING (CWE-401): [#def47]
lldpad-1.1.0/lldp_dcbx.c:418:14: warning[-Wanalyzer-malloc-leak]: leak of ‘dud’
lldpad-1.1.0/lldp_dcbx.c:387:12: branch_false: following ‘false’ branch...
lldpad-1.1.0/lldp_dcbx.c:393:13: branch_false: ...to here
lldpad-1.1.0/lldp_dcbx.c:393:12: branch_true: following ‘true’ branch...
lldpad-1.1.0/lldp_dcbx.c:394:17: branch_true: ...to here
lldpad-1.1.0/lldp_dcbx.c:401:12: branch_false: following ‘false’ branch (when ‘mod’ is non-NULL)...
lldpad-1.1.0/lldp_dcbx.c:405:15: branch_false: ...to here
lldpad-1.1.0/lldp_dcbx.c:405:15: acquire_memory: allocated here
lldpad-1.1.0/lldp_dcbx.c:406:12: branch_false: following ‘false’ branch (when ‘dud’ is non-NULL)...
lldpad-1.1.0/lldp_dcbx.c:412:9: branch_false: ...to here
lldpad-1.1.0/lldp_dcbx.c:418:14: throw: if ‘add_pg_defaults’ throws an exception...
lldpad-1.1.0/lldp_dcbx.c:418:14: danger: ‘dud’ leaks here; was allocated at [(7)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/6)
#  416|   
#  417|   	/* store pg defaults */
#  418|-> 	if (!add_pg_defaults()) {
#  419|   		LLDPAD_INFO("failed to add default PG data");
#  420|   		goto out_err;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def48]
lldpad-1.1.0/lldp_dcbx.c:418:14: warning[-Wanalyzer-malloc-leak]: leak of ‘mod’
lldpad-1.1.0/lldp_dcbx.c:387:12: branch_false: following ‘false’ branch...
lldpad-1.1.0/lldp_dcbx.c:393:13: branch_false: ...to here
lldpad-1.1.0/lldp_dcbx.c:393:12: branch_true: following ‘true’ branch...
lldpad-1.1.0/lldp_dcbx.c:394:17: branch_true: ...to here
lldpad-1.1.0/lldp_dcbx.c:400:15: acquire_memory: allocated here
lldpad-1.1.0/lldp_dcbx.c:401:12: branch_false: following ‘false’ branch (when ‘mod’ is non-NULL)...
lldpad-1.1.0/lldp_dcbx.c:405:15: branch_false: ...to here
lldpad-1.1.0/lldp_dcbx.c:406:12: branch_false: following ‘false’ branch (when ‘dud’ is non-NULL)...
lldpad-1.1.0/lldp_dcbx.c:412:9: branch_false: ...to here
lldpad-1.1.0/lldp_dcbx.c:418:14: throw: if ‘add_pg_defaults’ throws an exception...
lldpad-1.1.0/lldp_dcbx.c:418:14: danger: ‘mod’ leaks here; was allocated at [(5)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/4)
#  416|   
#  417|   	/* store pg defaults */
#  418|-> 	if (!add_pg_defaults()) {
#  419|   		LLDPAD_INFO("failed to add default PG data");
#  420|   		goto out_err;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def49]
lldpad-1.1.0/lldp_dcbx.c:419:17: warning[-Wanalyzer-malloc-leak]: leak of ‘dud’
lldpad-1.1.0/lldp_dcbx.c:387:12: branch_false: following ‘false’ branch...
lldpad-1.1.0/lldp_dcbx.c:393:13: branch_false: ...to here
lldpad-1.1.0/lldp_dcbx.c:393:12: branch_true: following ‘true’ branch...
lldpad-1.1.0/lldp_dcbx.c:394:17: branch_true: ...to here
lldpad-1.1.0/lldp_dcbx.c:401:12: branch_false: following ‘false’ branch (when ‘mod’ is non-NULL)...
lldpad-1.1.0/lldp_dcbx.c:405:15: branch_false: ...to here
lldpad-1.1.0/lldp_dcbx.c:405:15: acquire_memory: allocated here
lldpad-1.1.0/lldp_dcbx.c:406:12: branch_false: following ‘false’ branch (when ‘dud’ is non-NULL)...
lldpad-1.1.0/lldp_dcbx.c:412:9: branch_false: ...to here
lldpad-1.1.0/lldp_dcbx.c:418:12: branch_false: following ‘false’ branch...
lldpad-1.1.0/lldp_dcbx.c:419:17: branch_false: ...to here
lldpad-1.1.0/lldp_dcbx.c:419:17: throw: if ‘log_message’ throws an exception...
lldpad-1.1.0/lldp_dcbx.c:419:17: danger: ‘dud’ leaks here; was allocated at [(7)](sarif:/runs/0/results/3/codeFlows/0/threadFlows/0/locations/6)
#  417|   	/* store pg defaults */
#  418|   	if (!add_pg_defaults()) {
#  419|-> 		LLDPAD_INFO("failed to add default PG data");
#  420|   		goto out_err;
#  421|   	}

Error: GCC_ANALYZER_WARNING (CWE-401): [#def50]
lldpad-1.1.0/lldp_dcbx.c:419:17: warning[-Wanalyzer-malloc-leak]: leak of ‘mod’
lldpad-1.1.0/lldp_dcbx.c:387:12: branch_false: following ‘false’ branch...
lldpad-1.1.0/lldp_dcbx.c:393:13: branch_false: ...to here
lldpad-1.1.0/lldp_dcbx.c:393:12: branch_true: following ‘true’ branch...
lldpad-1.1.0/lldp_dcbx.c:394:17: branch_true: ...to here
lldpad-1.1.0/lldp_dcbx.c:400:15: acquire_memory: allocated here
lldpad-1.1.0/lldp_dcbx.c:401:12: branch_false: following ‘false’ branch (when ‘mod’ is non-NULL)...
lldpad-1.1.0/lldp_dcbx.c:405:15: branch_false: ...to here
lldpad-1.1.0/lldp_dcbx.c:406:12: branch_false: following ‘false’ branch (when ‘dud’ is non-NULL)...
lldpad-1.1.0/lldp_dcbx.c:412:9: branch_false: ...to here
lldpad-1.1.0/lldp_dcbx.c:418:12: branch_false: following ‘false’ branch...
lldpad-1.1.0/lldp_dcbx.c:419:17: branch_false: ...to here
lldpad-1.1.0/lldp_dcbx.c:419:17: throw: if ‘log_message’ throws an exception...
lldpad-1.1.0/lldp_dcbx.c:419:17: danger: ‘mod’ leaks here; was allocated at [(5)](sarif:/runs/0/results/2/codeFlows/0/threadFlows/0/locations/4)
#  417|   	/* store pg defaults */
#  418|   	if (!add_pg_defaults()) {
#  419|-> 		LLDPAD_INFO("failed to add default PG data");
#  420|   		goto out_err;
#  421|   	}

Error: GCC_ANALYZER_WARNING (CWE-401): [#def51]
lldpad-1.1.0/lldp_dcbx.c:420:17: warning[-Wanalyzer-malloc-leak]: leak of ‘dud’
lldpad-1.1.0/lldp_dcbx.c:387:12: branch_false: following ‘false’ branch...
lldpad-1.1.0/lldp_dcbx.c:393:13: branch_false: ...to here
lldpad-1.1.0/lldp_dcbx.c:393:12: branch_true: following ‘true’ branch...
lldpad-1.1.0/lldp_dcbx.c:394:17: branch_true: ...to here
lldpad-1.1.0/lldp_dcbx.c:401:12: branch_false: following ‘false’ branch (when ‘mod’ is non-NULL)...
lldpad-1.1.0/lldp_dcbx.c:405:15: branch_false: ...to here
lldpad-1.1.0/lldp_dcbx.c:405:15: acquire_memory: allocated here
lldpad-1.1.0/lldp_dcbx.c:406:12: branch_false: following ‘false’ branch (when ‘dud’ is non-NULL)...
lldpad-1.1.0/lldp_dcbx.c:412:9: branch_false: ...to here
lldpad-1.1.0/lldp_dcbx.c:420:17: danger: ‘dud’ leaks here; was allocated at [(7)](sarif:/runs/0/results/5/codeFlows/0/threadFlows/0/locations/6)
#  418|   	if (!add_pg_defaults()) {
#  419|   		LLDPAD_INFO("failed to add default PG data");
#  420|-> 		goto out_err;
#  421|   	}
#  422|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def52]
lldpad-1.1.0/lldp_dcbx.c:420:17: warning[-Wanalyzer-malloc-leak]: leak of ‘mod’
lldpad-1.1.0/lldp_dcbx.c:387:12: branch_false: following ‘false’ branch...
lldpad-1.1.0/lldp_dcbx.c:393:13: branch_false: ...to here
lldpad-1.1.0/lldp_dcbx.c:393:12: branch_true: following ‘true’ branch...
lldpad-1.1.0/lldp_dcbx.c:394:17: branch_true: ...to here
lldpad-1.1.0/lldp_dcbx.c:400:15: acquire_memory: allocated here
lldpad-1.1.0/lldp_dcbx.c:401:12: branch_false: following ‘false’ branch (when ‘mod’ is non-NULL)...
lldpad-1.1.0/lldp_dcbx.c:405:15: branch_false: ...to here
lldpad-1.1.0/lldp_dcbx.c:406:12: branch_false: following ‘false’ branch (when ‘dud’ is non-NULL)...
lldpad-1.1.0/lldp_dcbx.c:412:9: branch_false: ...to here
lldpad-1.1.0/lldp_dcbx.c:420:17: danger: ‘mod’ leaks here; was allocated at [(5)](sarif:/runs/0/results/4/codeFlows/0/threadFlows/0/locations/4)
#  418|   	if (!add_pg_defaults()) {
#  419|   		LLDPAD_INFO("failed to add default PG data");
#  420|-> 		goto out_err;
#  421|   	}
#  422|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def53]
lldpad-1.1.0/lldp_dcbx.c:424:14: warning[-Wanalyzer-malloc-leak]: leak of ‘dud’
lldpad-1.1.0/lldp_dcbx.c:387:12: branch_false: following ‘false’ branch...
lldpad-1.1.0/lldp_dcbx.c:393:13: branch_false: ...to here
lldpad-1.1.0/lldp_dcbx.c:393:12: branch_true: following ‘true’ branch...
lldpad-1.1.0/lldp_dcbx.c:394:17: branch_true: ...to here
lldpad-1.1.0/lldp_dcbx.c:401:12: branch_false: following ‘false’ branch (when ‘mod’ is non-NULL)...
lldpad-1.1.0/lldp_dcbx.c:405:15: branch_false: ...to here
lldpad-1.1.0/lldp_dcbx.c:405:15: acquire_memory: allocated here
lldpad-1.1.0/lldp_dcbx.c:406:12: branch_false: following ‘false’ branch (when ‘dud’ is non-NULL)...
lldpad-1.1.0/lldp_dcbx.c:412:9: branch_false: ...to here
lldpad-1.1.0/lldp_dcbx.c:418:12: branch_true: following ‘true’ branch...
lldpad-1.1.0/lldp_dcbx.c:424:14: branch_true: ...to here
lldpad-1.1.0/lldp_dcbx.c:424:14: throw: if ‘add_pfc_defaults’ throws an exception...
lldpad-1.1.0/lldp_dcbx.c:424:14: danger: ‘dud’ leaks here; was allocated at [(7)](sarif:/runs/0/results/7/codeFlows/0/threadFlows/0/locations/6)
#  422|   
#  423|   	/* store pg defaults */
#  424|-> 	if (!add_pfc_defaults()) {
#  425|   		LLDPAD_INFO("failed to add default PFC data");
#  426|   		goto out_err;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def54]
lldpad-1.1.0/lldp_dcbx.c:424:14: warning[-Wanalyzer-malloc-leak]: leak of ‘mod’
lldpad-1.1.0/lldp_dcbx.c:387:12: branch_false: following ‘false’ branch...
lldpad-1.1.0/lldp_dcbx.c:393:13: branch_false: ...to here
lldpad-1.1.0/lldp_dcbx.c:393:12: branch_true: following ‘true’ branch...
lldpad-1.1.0/lldp_dcbx.c:394:17: branch_true: ...to here
lldpad-1.1.0/lldp_dcbx.c:400:15: acquire_memory: allocated here
lldpad-1.1.0/lldp_dcbx.c:401:12: branch_false: following ‘false’ branch (when ‘mod’ is non-NULL)...
lldpad-1.1.0/lldp_dcbx.c:405:15: branch_false: ...to here
lldpad-1.1.0/lldp_dcbx.c:406:12: branch_false: following ‘false’ branch (when ‘dud’ is non-NULL)...
lldpad-1.1.0/lldp_dcbx.c:412:9: branch_false: ...to here
lldpad-1.1.0/lldp_dcbx.c:418:12: branch_true: following ‘true’ branch...
lldpad-1.1.0/lldp_dcbx.c:424:14: branch_true: ...to here
lldpad-1.1.0/lldp_dcbx.c:424:14: throw: if ‘add_pfc_defaults’ throws an exception...
lldpad-1.1.0/lldp_dcbx.c:424:14: danger: ‘mod’ leaks here; was allocated at [(5)](sarif:/runs/0/results/6/codeFlows/0/threadFlows/0/locations/4)
#  422|   
#  423|   	/* store pg defaults */
#  424|-> 	if (!add_pfc_defaults()) {
#  425|   		LLDPAD_INFO("failed to add default PFC data");
#  426|   		goto out_err;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def55]
lldpad-1.1.0/lldp_dcbx.c:425:17: warning[-Wanalyzer-malloc-leak]: leak of ‘dud’
lldpad-1.1.0/lldp_dcbx.c:387:12: branch_false: following ‘false’ branch...
lldpad-1.1.0/lldp_dcbx.c:393:13: branch_false: ...to here
lldpad-1.1.0/lldp_dcbx.c:393:12: branch_true: following ‘true’ branch...
lldpad-1.1.0/lldp_dcbx.c:394:17: branch_true: ...to here
lldpad-1.1.0/lldp_dcbx.c:401:12: branch_false: following ‘false’ branch (when ‘mod’ is non-NULL)...
lldpad-1.1.0/lldp_dcbx.c:405:15: branch_false: ...to here
lldpad-1.1.0/lldp_dcbx.c:405:15: acquire_memory: allocated here
lldpad-1.1.0/lldp_dcbx.c:406:12: branch_false: following ‘false’ branch (when ‘dud’ is non-NULL)...
lldpad-1.1.0/lldp_dcbx.c:412:9: branch_false: ...to here
lldpad-1.1.0/lldp_dcbx.c:418:12: branch_true: following ‘true’ branch...
lldpad-1.1.0/lldp_dcbx.c:424:14: branch_true: ...to here
lldpad-1.1.0/lldp_dcbx.c:424:12: branch_false: following ‘false’ branch...
lldpad-1.1.0/lldp_dcbx.c:425:17: branch_false: ...to here
lldpad-1.1.0/lldp_dcbx.c:425:17: throw: if ‘log_message’ throws an exception...
lldpad-1.1.0/lldp_dcbx.c:425:17: danger: ‘dud’ leaks here; was allocated at [(7)](sarif:/runs/0/results/9/codeFlows/0/threadFlows/0/locations/6)
#  423|   	/* store pg defaults */
#  424|   	if (!add_pfc_defaults()) {
#  425|-> 		LLDPAD_INFO("failed to add default PFC data");
#  426|   		goto out_err;
#  427|   	}

Error: GCC_ANALYZER_WARNING (CWE-401): [#def56]
lldpad-1.1.0/lldp_dcbx.c:425:17: warning[-Wanalyzer-malloc-leak]: leak of ‘mod’
lldpad-1.1.0/lldp_dcbx.c:387:12: branch_false: following ‘false’ branch...
lldpad-1.1.0/lldp_dcbx.c:393:13: branch_false: ...to here
lldpad-1.1.0/lldp_dcbx.c:393:12: branch_true: following ‘true’ branch...
lldpad-1.1.0/lldp_dcbx.c:394:17: branch_true: ...to here
lldpad-1.1.0/lldp_dcbx.c:400:15: acquire_memory: allocated here
lldpad-1.1.0/lldp_dcbx.c:401:12: branch_false: following ‘false’ branch (when ‘mod’ is non-NULL)...
lldpad-1.1.0/lldp_dcbx.c:405:15: branch_false: ...to here
lldpad-1.1.0/lldp_dcbx.c:406:12: branch_false: following ‘false’ branch (when ‘dud’ is non-NULL)...
lldpad-1.1.0/lldp_dcbx.c:412:9: branch_false: ...to here
lldpad-1.1.0/lldp_dcbx.c:418:12: branch_true: following ‘true’ branch...
lldpad-1.1.0/lldp_dcbx.c:424:14: branch_true: ...to here
lldpad-1.1.0/lldp_dcbx.c:424:12: branch_false: following ‘false’ branch...
lldpad-1.1.0/lldp_dcbx.c:425:17: branch_false: ...to here
lldpad-1.1.0/lldp_dcbx.c:425:17: throw: if ‘log_message’ throws an exception...
lldpad-1.1.0/lldp_dcbx.c:425:17: danger: ‘mod’ leaks here; was allocated at [(5)](sarif:/runs/0/results/8/codeFlows/0/threadFlows/0/locations/4)
#  423|   	/* store pg defaults */
#  424|   	if (!add_pfc_defaults()) {
#  425|-> 		LLDPAD_INFO("failed to add default PFC data");
#  426|   		goto out_err;
#  427|   	}

Error: GCC_ANALYZER_WARNING (CWE-401): [#def57]
lldpad-1.1.0/lldp_dcbx.c:431:22: warning[-Wanalyzer-malloc-leak]: leak of ‘dud’
lldpad-1.1.0/lldp_dcbx.c:387:12: branch_false: following ‘false’ branch...
lldpad-1.1.0/lldp_dcbx.c:393:13: branch_false: ...to here
lldpad-1.1.0/lldp_dcbx.c:393:12: branch_true: following ‘true’ branch...
lldpad-1.1.0/lldp_dcbx.c:394:17: branch_true: ...to here
lldpad-1.1.0/lldp_dcbx.c:401:12: branch_false: following ‘false’ branch (when ‘mod’ is non-NULL)...
lldpad-1.1.0/lldp_dcbx.c:405:15: branch_false: ...to here
lldpad-1.1.0/lldp_dcbx.c:405:15: acquire_memory: allocated here
lldpad-1.1.0/lldp_dcbx.c:406:12: branch_false: following ‘false’ branch (when ‘dud’ is non-NULL)...
lldpad-1.1.0/lldp_dcbx.c:412:9: branch_false: ...to here
lldpad-1.1.0/lldp_dcbx.c:418:12: branch_true: following ‘true’ branch...
lldpad-1.1.0/lldp_dcbx.c:424:14: branch_true: ...to here
lldpad-1.1.0/lldp_dcbx.c:424:12: branch_true: following ‘true’ branch...
lldpad-1.1.0/lldp_dcbx.c:424:12: branch_true: ...to here
lldpad-1.1.0/lldp_dcbx.c:430:21: branch_true: following ‘true’ branch (when ‘i != 3’)...
lldpad-1.1.0/lldp_dcbx.c:431:22: branch_true: ...to here
lldpad-1.1.0/lldp_dcbx.c:431:22: throw: if ‘add_app_defaults’ throws an exception...
lldpad-1.1.0/lldp_dcbx.c:431:22: danger: ‘dud’ leaks here; was allocated at [(7)](sarif:/runs/0/results/11/codeFlows/0/threadFlows/0/locations/6)
#  429|   	/* store app defaults */
#  430|   	for (i = 0; i < DCB_MAX_APPTLV; i++) {
#  431|-> 		if (!add_app_defaults(i)) {
#  432|   			LLDPAD_INFO("failed to add default APP data %d", i);
#  433|   			goto out_err;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def58]
lldpad-1.1.0/lldp_dcbx.c:431:22: warning[-Wanalyzer-malloc-leak]: leak of ‘mod’
lldpad-1.1.0/lldp_dcbx.c:387:12: branch_false: following ‘false’ branch...
lldpad-1.1.0/lldp_dcbx.c:393:13: branch_false: ...to here
lldpad-1.1.0/lldp_dcbx.c:393:12: branch_true: following ‘true’ branch...
lldpad-1.1.0/lldp_dcbx.c:394:17: branch_true: ...to here
lldpad-1.1.0/lldp_dcbx.c:400:15: acquire_memory: allocated here
lldpad-1.1.0/lldp_dcbx.c:401:12: branch_false: following ‘false’ branch (when ‘mod’ is non-NULL)...
lldpad-1.1.0/lldp_dcbx.c:405:15: branch_false: ...to here
lldpad-1.1.0/lldp_dcbx.c:406:12: branch_false: following ‘false’ branch (when ‘dud’ is non-NULL)...
lldpad-1.1.0/lldp_dcbx.c:412:9: branch_false: ...to here
lldpad-1.1.0/lldp_dcbx.c:418:12: branch_true: following ‘true’ branch...
lldpad-1.1.0/lldp_dcbx.c:424:14: branch_true: ...to here
lldpad-1.1.0/lldp_dcbx.c:424:12: branch_true: following ‘true’ branch...
lldpad-1.1.0/lldp_dcbx.c:424:12: branch_true: ...to here
lldpad-1.1.0/lldp_dcbx.c:430:21: branch_true: following ‘true’ branch (when ‘i != 3’)...
lldpad-1.1.0/lldp_dcbx.c:431:22: branch_true: ...to here
lldpad-1.1.0/lldp_dcbx.c:431:22: throw: if ‘add_app_defaults’ throws an exception...
lldpad-1.1.0/lldp_dcbx.c:431:22: danger: ‘mod’ leaks here; was allocated at [(5)](sarif:/runs/0/results/10/codeFlows/0/threadFlows/0/locations/4)
#  429|   	/* store app defaults */
#  430|   	for (i = 0; i < DCB_MAX_APPTLV; i++) {
#  431|-> 		if (!add_app_defaults(i)) {
#  432|   			LLDPAD_INFO("failed to add default APP data %d", i);
#  433|   			goto out_err;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def59]
lldpad-1.1.0/lldp_dcbx.c:432:25: warning[-Wanalyzer-malloc-leak]: leak of ‘dud’
lldpad-1.1.0/lldp_dcbx.c:387:12: branch_false: following ‘false’ branch...
lldpad-1.1.0/lldp_dcbx.c:393:13: branch_false: ...to here
lldpad-1.1.0/lldp_dcbx.c:393:12: branch_true: following ‘true’ branch...
lldpad-1.1.0/lldp_dcbx.c:394:17: branch_true: ...to here
lldpad-1.1.0/lldp_dcbx.c:401:12: branch_false: following ‘false’ branch (when ‘mod’ is non-NULL)...
lldpad-1.1.0/lldp_dcbx.c:405:15: branch_false: ...to here
lldpad-1.1.0/lldp_dcbx.c:405:15: acquire_memory: allocated here
lldpad-1.1.0/lldp_dcbx.c:406:12: branch_false: following ‘false’ branch (when ‘dud’ is non-NULL)...
lldpad-1.1.0/lldp_dcbx.c:412:9: branch_false: ...to here
lldpad-1.1.0/lldp_dcbx.c:418:12: branch_true: following ‘true’ branch...
lldpad-1.1.0/lldp_dcbx.c:424:14: branch_true: ...to here
lldpad-1.1.0/lldp_dcbx.c:424:12: branch_true: following ‘true’ branch...
lldpad-1.1.0/lldp_dcbx.c:424:12: branch_true: ...to here
lldpad-1.1.0/lldp_dcbx.c:430:21: branch_true: following ‘true’ branch (when ‘i != 3’)...
lldpad-1.1.0/lldp_dcbx.c:431:22: branch_true: ...to here
lldpad-1.1.0/lldp_dcbx.c:432:25: throw: if ‘log_message’ throws an exception...
lldpad-1.1.0/lldp_dcbx.c:432:25: danger: ‘dud’ leaks here; was allocated at [(7)](sarif:/runs/0/results/13/codeFlows/0/threadFlows/0/locations/6)
#  430|   	for (i = 0; i < DCB_MAX_APPTLV; i++) {
#  431|   		if (!add_app_defaults(i)) {
#  432|-> 			LLDPAD_INFO("failed to add default APP data %d", i);
#  433|   			goto out_err;
#  434|   		}

Error: GCC_ANALYZER_WARNING (CWE-401): [#def60]
lldpad-1.1.0/lldp_dcbx.c:432:25: warning[-Wanalyzer-malloc-leak]: leak of ‘mod’
lldpad-1.1.0/lldp_dcbx.c:387:12: branch_false: following ‘false’ branch...
lldpad-1.1.0/lldp_dcbx.c:393:13: branch_false: ...to here
lldpad-1.1.0/lldp_dcbx.c:393:12: branch_true: following ‘true’ branch...
lldpad-1.1.0/lldp_dcbx.c:394:17: branch_true: ...to here
lldpad-1.1.0/lldp_dcbx.c:400:15: acquire_memory: allocated here
lldpad-1.1.0/lldp_dcbx.c:401:12: branch_false: following ‘false’ branch (when ‘mod’ is non-NULL)...
lldpad-1.1.0/lldp_dcbx.c:405:15: branch_false: ...to here
lldpad-1.1.0/lldp_dcbx.c:406:12: branch_false: following ‘false’ branch (when ‘dud’ is non-NULL)...
lldpad-1.1.0/lldp_dcbx.c:412:9: branch_false: ...to here
lldpad-1.1.0/lldp_dcbx.c:418:12: branch_true: following ‘true’ branch...
lldpad-1.1.0/lldp_dcbx.c:424:14: branch_true: ...to here
lldpad-1.1.0/lldp_dcbx.c:424:12: branch_true: following ‘true’ branch...
lldpad-1.1.0/lldp_dcbx.c:424:12: branch_true: ...to here
lldpad-1.1.0/lldp_dcbx.c:430:21: branch_true: following ‘true’ branch (when ‘i != 3’)...
lldpad-1.1.0/lldp_dcbx.c:431:22: branch_true: ...to here
lldpad-1.1.0/lldp_dcbx.c:432:25: throw: if ‘log_message’ throws an exception...
lldpad-1.1.0/lldp_dcbx.c:432:25: danger: ‘mod’ leaks here; was allocated at [(5)](sarif:/runs/0/results/12/codeFlows/0/threadFlows/0/locations/4)
#  430|   	for (i = 0; i < DCB_MAX_APPTLV; i++) {
#  431|   		if (!add_app_defaults(i)) {
#  432|-> 			LLDPAD_INFO("failed to add default APP data %d", i);
#  433|   			goto out_err;
#  434|   		}

Error: GCC_ANALYZER_WARNING (CWE-401): [#def61]
lldpad-1.1.0/lldp_dcbx.c:439:22: warning[-Wanalyzer-malloc-leak]: leak of ‘dud’
lldpad-1.1.0/lldp_dcbx.c:387:12: branch_false: following ‘false’ branch...
lldpad-1.1.0/lldp_dcbx.c:393:13: branch_false: ...to here
lldpad-1.1.0/lldp_dcbx.c:393:12: branch_true: following ‘true’ branch...
lldpad-1.1.0/lldp_dcbx.c:394:17: branch_true: ...to here
lldpad-1.1.0/lldp_dcbx.c:401:12: branch_false: following ‘false’ branch (when ‘mod’ is non-NULL)...
lldpad-1.1.0/lldp_dcbx.c:405:15: branch_false: ...to here
lldpad-1.1.0/lldp_dcbx.c:405:15: acquire_memory: allocated here
lldpad-1.1.0/lldp_dcbx.c:406:12: branch_false: following ‘false’ branch (when ‘dud’ is non-NULL)...
lldpad-1.1.0/lldp_dcbx.c:412:9: branch_false: ...to here
lldpad-1.1.0/lldp_dcbx.c:418:12: branch_true: following ‘true’ branch...
lldpad-1.1.0/lldp_dcbx.c:424:14: branch_true: ...to here
lldpad-1.1.0/lldp_dcbx.c:424:12: branch_true: following ‘true’ branch...
lldpad-1.1.0/lldp_dcbx.c:424:12: branch_true: ...to here
lldpad-1.1.0/lldp_dcbx.c:430:21: branch_true: following ‘true’ branch (when ‘i != 3’)...
lldpad-1.1.0/lldp_dcbx.c:431:22: branch_true: ...to here
lldpad-1.1.0/lldp_dcbx.c:431:20: branch_true: following ‘true’ branch...
lldpad-1.1.0/lldp_dcbx.c:430:41: branch_true: ...to here
lldpad-1.1.0/lldp_dcbx.c:431:20: branch_true: following ‘true’ branch...
lldpad-1.1.0/lldp_dcbx.c:430:41: branch_true: ...to here
lldpad-1.1.0/lldp_dcbx.c:438:21: branch_true: following ‘true’ branch (when ‘i == 0’)...
lldpad-1.1.0/lldp_dcbx.c:439:22: branch_true: ...to here
lldpad-1.1.0/lldp_dcbx.c:439:22: throw: if ‘add_llink_defaults’ throws an exception...
lldpad-1.1.0/lldp_dcbx.c:439:22: danger: ‘dud’ leaks here; was allocated at [(7)](sarif:/runs/0/results/15/codeFlows/0/threadFlows/0/locations/6)
#  437|   
#  438|   	for (i = 0; i < DCB_MAX_LLKTLV; i++) {
#  439|-> 		if (!add_llink_defaults(i)) {
#  440|   			LLDPAD_INFO("failed to add default LLKTLV data %i", i);
#  441|   			goto out_err;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def62]
lldpad-1.1.0/lldp_dcbx.c:439:22: warning[-Wanalyzer-malloc-leak]: leak of ‘mod’
lldpad-1.1.0/lldp_dcbx.c:387:12: branch_false: following ‘false’ branch...
lldpad-1.1.0/lldp_dcbx.c:393:13: branch_false: ...to here
lldpad-1.1.0/lldp_dcbx.c:393:12: branch_true: following ‘true’ branch...
lldpad-1.1.0/lldp_dcbx.c:394:17: branch_true: ...to here
lldpad-1.1.0/lldp_dcbx.c:400:15: acquire_memory: allocated here
lldpad-1.1.0/lldp_dcbx.c:401:12: branch_false: following ‘false’ branch (when ‘mod’ is non-NULL)...
lldpad-1.1.0/lldp_dcbx.c:405:15: branch_false: ...to here
lldpad-1.1.0/lldp_dcbx.c:406:12: branch_false: following ‘false’ branch (when ‘dud’ is non-NULL)...
lldpad-1.1.0/lldp_dcbx.c:412:9: branch_false: ...to here
lldpad-1.1.0/lldp_dcbx.c:418:12: branch_true: following ‘true’ branch...
lldpad-1.1.0/lldp_dcbx.c:424:14: branch_true: ...to here
lldpad-1.1.0/lldp_dcbx.c:424:12: branch_true: following ‘true’ branch...
lldpad-1.1.0/lldp_dcbx.c:424:12: branch_true: ...to here
lldpad-1.1.0/lldp_dcbx.c:430:21: branch_true: following ‘true’ branch (when ‘i != 3’)...
lldpad-1.1.0/lldp_dcbx.c:431:22: branch_true: ...to here
lldpad-1.1.0/lldp_dcbx.c:431:20: branch_true: following ‘true’ branch...
lldpad-1.1.0/lldp_dcbx.c:430:41: branch_true: ...to here
lldpad-1.1.0/lldp_dcbx.c:431:20: branch_true: following ‘true’ branch...
lldpad-1.1.0/lldp_dcbx.c:430:41: branch_true: ...to here
lldpad-1.1.0/lldp_dcbx.c:438:21: branch_true: following ‘true’ branch (when ‘i == 0’)...
lldpad-1.1.0/lldp_dcbx.c:439:22: branch_true: ...to here
lldpad-1.1.0/lldp_dcbx.c:439:22: throw: if ‘add_llink_defaults’ throws an exception...
lldpad-1.1.0/lldp_dcbx.c:439:22: danger: ‘mod’ leaks here; was allocated at [(5)](sarif:/runs/0/results/14/codeFlows/0/threadFlows/0/locations/4)
#  437|   
#  438|   	for (i = 0; i < DCB_MAX_LLKTLV; i++) {
#  439|-> 		if (!add_llink_defaults(i)) {
#  440|   			LLDPAD_INFO("failed to add default LLKTLV data %i", i);
#  441|   			goto out_err;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def63]
lldpad-1.1.0/lldp_dcbx.c:440:25: warning[-Wanalyzer-malloc-leak]: leak of ‘dud’
lldpad-1.1.0/lldp_dcbx.c:387:12: branch_false: following ‘false’ branch...
lldpad-1.1.0/lldp_dcbx.c:393:13: branch_false: ...to here
lldpad-1.1.0/lldp_dcbx.c:393:12: branch_true: following ‘true’ branch...
lldpad-1.1.0/lldp_dcbx.c:394:17: branch_true: ...to here
lldpad-1.1.0/lldp_dcbx.c:401:12: branch_false: following ‘false’ branch (when ‘mod’ is non-NULL)...
lldpad-1.1.0/lldp_dcbx.c:405:15: branch_false: ...to here
lldpad-1.1.0/lldp_dcbx.c:405:15: acquire_memory: allocated here
lldpad-1.1.0/lldp_dcbx.c:406:12: branch_false: following ‘false’ branch (when ‘dud’ is non-NULL)...
lldpad-1.1.0/lldp_dcbx.c:412:9: branch_false: ...to here
lldpad-1.1.0/lldp_dcbx.c:418:12: branch_true: following ‘true’ branch...
lldpad-1.1.0/lldp_dcbx.c:424:14: branch_true: ...to here
lldpad-1.1.0/lldp_dcbx.c:424:12: branch_true: following ‘true’ branch...
lldpad-1.1.0/lldp_dcbx.c:424:12: branch_true: ...to here
lldpad-1.1.0/lldp_dcbx.c:430:21: branch_true: following ‘true’ branch (when ‘i != 3’)...
lldpad-1.1.0/lldp_dcbx.c:431:22: branch_true: ...to here
lldpad-1.1.0/lldp_dcbx.c:431:20: branch_true: following ‘true’ branch...
lldpad-1.1.0/lldp_dcbx.c:430:41: branch_true: ...to here
lldpad-1.1.0/lldp_dcbx.c:431:20: branch_true: following ‘true’ branch...
lldpad-1.1.0/lldp_dcbx.c:430:41: branch_true: ...to here
lldpad-1.1.0/lldp_dcbx.c:438:21: branch_true: following ‘true’ branch (when ‘i == 0’)...
lldpad-1.1.0/lldp_dcbx.c:439:22: branch_true: ...to here
lldpad-1.1.0/lldp_dcbx.c:440:25: throw: if ‘log_message’ throws an exception...
lldpad-1.1.0/lldp_dcbx.c:440:25: danger: ‘dud’ leaks here; was allocated at [(7)](sarif:/runs/0/results/17/codeFlows/0/threadFlows/0/locations/6)
#  438|   	for (i = 0; i < DCB_MAX_LLKTLV; i++) {
#  439|   		if (!add_llink_defaults(i)) {
#  440|-> 			LLDPAD_INFO("failed to add default LLKTLV data %i", i);
#  441|   			goto out_err;
#  442|   		}

Error: GCC_ANALYZER_WARNING (CWE-401): [#def64]
lldpad-1.1.0/lldp_dcbx.c:440:25: warning[-Wanalyzer-malloc-leak]: leak of ‘mod’
lldpad-1.1.0/lldp_dcbx.c:387:12: branch_false: following ‘false’ branch...
lldpad-1.1.0/lldp_dcbx.c:393:13: branch_false: ...to here
lldpad-1.1.0/lldp_dcbx.c:393:12: branch_true: following ‘true’ branch...
lldpad-1.1.0/lldp_dcbx.c:394:17: branch_true: ...to here
lldpad-1.1.0/lldp_dcbx.c:400:15: acquire_memory: allocated here
lldpad-1.1.0/lldp_dcbx.c:401:12: branch_false: following ‘false’ branch (when ‘mod’ is non-NULL)...
lldpad-1.1.0/lldp_dcbx.c:405:15: branch_false: ...to here
lldpad-1.1.0/lldp_dcbx.c:406:12: branch_false: following ‘false’ branch (when ‘dud’ is non-NULL)...
lldpad-1.1.0/lldp_dcbx.c:412:9: branch_false: ...to here
lldpad-1.1.0/lldp_dcbx.c:418:12: branch_true: following ‘true’ branch...
lldpad-1.1.0/lldp_dcbx.c:424:14: branch_true: ...to here
lldpad-1.1.0/lldp_dcbx.c:424:12: branch_true: following ‘true’ branch...
lldpad-1.1.0/lldp_dcbx.c:424:12: branch_true: ...to here
lldpad-1.1.0/lldp_dcbx.c:430:21: branch_true: following ‘true’ branch (when ‘i != 3’)...
lldpad-1.1.0/lldp_dcbx.c:431:22: branch_true: ...to here
lldpad-1.1.0/lldp_dcbx.c:431:20: branch_true: following ‘true’ branch...
lldpad-1.1.0/lldp_dcbx.c:430:41: branch_true: ...to here
lldpad-1.1.0/lldp_dcbx.c:431:20: branch_true: following ‘true’ branch...
lldpad-1.1.0/lldp_dcbx.c:430:41: branch_true: ...to here
lldpad-1.1.0/lldp_dcbx.c:438:21: branch_true: following ‘true’ branch (when ‘i == 0’)...
lldpad-1.1.0/lldp_dcbx.c:439:22: branch_true: ...to here
lldpad-1.1.0/lldp_dcbx.c:440:25: throw: if ‘log_message’ throws an exception...
lldpad-1.1.0/lldp_dcbx.c:440:25: danger: ‘mod’ leaks here; was allocated at [(5)](sarif:/runs/0/results/16/codeFlows/0/threadFlows/0/locations/4)
#  438|   	for (i = 0; i < DCB_MAX_LLKTLV; i++) {
#  439|   		if (!add_llink_defaults(i)) {
#  440|-> 			LLDPAD_INFO("failed to add default LLKTLV data %i", i);
#  441|   			goto out_err;
#  442|   		}

Error: GCC_ANALYZER_WARNING (CWE-401): [#def65]
lldpad-1.1.0/lldp_dcbx.c:445:14: warning[-Wanalyzer-malloc-leak]: leak of ‘dud’
lldpad-1.1.0/lldp_dcbx.c:387:12: branch_false: following ‘false’ branch...
lldpad-1.1.0/lldp_dcbx.c:393:13: branch_false: ...to here
lldpad-1.1.0/lldp_dcbx.c:393:12: branch_true: following ‘true’ branch...
lldpad-1.1.0/lldp_dcbx.c:394:17: branch_true: ...to here
lldpad-1.1.0/lldp_dcbx.c:401:12: branch_false: following ‘false’ branch (when ‘mod’ is non-NULL)...
lldpad-1.1.0/lldp_dcbx.c:405:15: branch_false: ...to here
lldpad-1.1.0/lldp_dcbx.c:405:15: acquire_memory: allocated here
lldpad-1.1.0/lldp_dcbx.c:406:12: branch_false: following ‘false’ branch (when ‘dud’ is non-NULL)...
lldpad-1.1.0/lldp_dcbx.c:412:9: branch_false: ...to here
lldpad-1.1.0/lldp_dcbx.c:418:12: branch_true: following ‘true’ branch...
lldpad-1.1.0/lldp_dcbx.c:424:14: branch_true: ...to here
lldpad-1.1.0/lldp_dcbx.c:424:12: branch_true: following ‘true’ branch...
lldpad-1.1.0/lldp_dcbx.c:424:12: branch_true: ...to here
lldpad-1.1.0/lldp_dcbx.c:430:21: branch_true: following ‘true’ branch (when ‘i != 3’)...
lldpad-1.1.0/lldp_dcbx.c:431:22: branch_true: ...to here
lldpad-1.1.0/lldp_dcbx.c:431:20: branch_true: following ‘true’ branch...
lldpad-1.1.0/lldp_dcbx.c:430:41: branch_true: ...to here
lldpad-1.1.0/lldp_dcbx.c:431:20: branch_true: following ‘true’ branch...
lldpad-1.1.0/lldp_dcbx.c:430:41: branch_true: ...to here
lldpad-1.1.0/lldp_dcbx.c:438:21: branch_true: following ‘true’ branch (when ‘i == 0’)...
lldpad-1.1.0/lldp_dcbx.c:439:22: branch_true: ...to here
lldpad-1.1.0/lldp_dcbx.c:439:20: branch_true: following ‘true’ branch...
lldpad-1.1.0/lldp_dcbx.c:439:20: branch_true: ...to here
lldpad-1.1.0/lldp_dcbx.c:445:14: throw: if ‘init_drv_if’ throws an exception...
lldpad-1.1.0/lldp_dcbx.c:445:14: danger: ‘dud’ leaks here; was allocated at [(7)](sarif:/runs/0/results/19/codeFlows/0/threadFlows/0/locations/6)
#  443|   	}
#  444|   
#  445|-> 	if (!init_drv_if()) {
#  446|   		LLDPAD_WARN("Error creataing netlink socket for driver i/f.\n");
#  447|   		goto out_err;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def66]
lldpad-1.1.0/lldp_dcbx.c:445:14: warning[-Wanalyzer-malloc-leak]: leak of ‘mod’
lldpad-1.1.0/lldp_dcbx.c:387:12: branch_false: following ‘false’ branch...
lldpad-1.1.0/lldp_dcbx.c:393:13: branch_false: ...to here
lldpad-1.1.0/lldp_dcbx.c:393:12: branch_true: following ‘true’ branch...
lldpad-1.1.0/lldp_dcbx.c:394:17: branch_true: ...to here
lldpad-1.1.0/lldp_dcbx.c:400:15: acquire_memory: allocated here
lldpad-1.1.0/lldp_dcbx.c:401:12: branch_false: following ‘false’ branch (when ‘mod’ is non-NULL)...
lldpad-1.1.0/lldp_dcbx.c:405:15: branch_false: ...to here
lldpad-1.1.0/lldp_dcbx.c:406:12: branch_false: following ‘false’ branch (when ‘dud’ is non-NULL)...
lldpad-1.1.0/lldp_dcbx.c:412:9: branch_false: ...to here
lldpad-1.1.0/lldp_dcbx.c:418:12: branch_true: following ‘true’ branch...
lldpad-1.1.0/lldp_dcbx.c:424:14: branch_true: ...to here
lldpad-1.1.0/lldp_dcbx.c:424:12: branch_true: following ‘true’ branch...
lldpad-1.1.0/lldp_dcbx.c:424:12: branch_true: ...to here
lldpad-1.1.0/lldp_dcbx.c:430:21: branch_true: following ‘true’ branch (when ‘i != 3’)...
lldpad-1.1.0/lldp_dcbx.c:431:22: branch_true: ...to here
lldpad-1.1.0/lldp_dcbx.c:431:20: branch_true: following ‘true’ branch...
lldpad-1.1.0/lldp_dcbx.c:430:41: branch_true: ...to here
lldpad-1.1.0/lldp_dcbx.c:431:20: branch_true: following ‘true’ branch...
lldpad-1.1.0/lldp_dcbx.c:430:41: branch_true: ...to here
lldpad-1.1.0/lldp_dcbx.c:438:21: branch_true: following ‘true’ branch (when ‘i == 0’)...
lldpad-1.1.0/lldp_dcbx.c:439:22: branch_true: ...to here
lldpad-1.1.0/lldp_dcbx.c:439:20: branch_true: following ‘true’ branch...
lldpad-1.1.0/lldp_dcbx.c:439:20: branch_true: ...to here
lldpad-1.1.0/lldp_dcbx.c:445:14: throw: if ‘init_drv_if’ throws an exception...
lldpad-1.1.0/lldp_dcbx.c:445:14: danger: ‘mod’ leaks here; was allocated at [(5)](sarif:/runs/0/results/18/codeFlows/0/threadFlows/0/locations/4)
#  443|   	}
#  444|   
#  445|-> 	if (!init_drv_if()) {
#  446|   		LLDPAD_WARN("Error creataing netlink socket for driver i/f.\n");
#  447|   		goto out_err;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def67]
lldpad-1.1.0/lldp_dcbx.c:446:17: warning[-Wanalyzer-malloc-leak]: leak of ‘dud’
lldpad-1.1.0/lldp_dcbx.c:387:12: branch_false: following ‘false’ branch...
lldpad-1.1.0/lldp_dcbx.c:393:13: branch_false: ...to here
lldpad-1.1.0/lldp_dcbx.c:393:12: branch_true: following ‘true’ branch...
lldpad-1.1.0/lldp_dcbx.c:394:17: branch_true: ...to here
lldpad-1.1.0/lldp_dcbx.c:401:12: branch_false: following ‘false’ branch (when ‘mod’ is non-NULL)...
lldpad-1.1.0/lldp_dcbx.c:405:15: branch_false: ...to here
lldpad-1.1.0/lldp_dcbx.c:405:15: acquire_memory: allocated here
lldpad-1.1.0/lldp_dcbx.c:406:12: branch_false: following ‘false’ branch (when ‘dud’ is non-NULL)...
lldpad-1.1.0/lldp_dcbx.c:412:9: branch_false: ...to here
lldpad-1.1.0/lldp_dcbx.c:418:12: branch_true: following ‘true’ branch...
lldpad-1.1.0/lldp_dcbx.c:424:14: branch_true: ...to here
lldpad-1.1.0/lldp_dcbx.c:424:12: branch_true: following ‘true’ branch...
lldpad-1.1.0/lldp_dcbx.c:424:12: branch_true: ...to here
lldpad-1.1.0/lldp_dcbx.c:430:21: branch_true: following ‘true’ branch (when ‘i != 3’)...
lldpad-1.1.0/lldp_dcbx.c:431:22: branch_true: ...to here
lldpad-1.1.0/lldp_dcbx.c:431:20: branch_true: following ‘true’ branch...
lldpad-1.1.0/lldp_dcbx.c:430:41: branch_true: ...to here
lldpad-1.1.0/lldp_dcbx.c:431:20: branch_true: following ‘true’ branch...
lldpad-1.1.0/lldp_dcbx.c:430:41: branch_true: ...to here
lldpad-1.1.0/lldp_dcbx.c:438:21: branch_true: following ‘true’ branch (when ‘i == 0’)...
lldpad-1.1.0/lldp_dcbx.c:439:22: branch_true: ...to here
lldpad-1.1.0/lldp_dcbx.c:439:20: branch_true: following ‘true’ branch...
lldpad-1.1.0/lldp_dcbx.c:439:20: branch_true: ...to here
lldpad-1.1.0/lldp_dcbx.c:445:12: branch_true: following ‘true’ branch...
lldpad-1.1.0/lldp_dcbx.c:446:17: branch_true: ...to here
lldpad-1.1.0/lldp_dcbx.c:446:17: throw: if ‘log_message’ throws an exception...
lldpad-1.1.0/lldp_dcbx.c:446:17: danger: ‘dud’ leaks here; was allocated at [(7)](sarif:/runs/0/results/21/codeFlows/0/threadFlows/0/locations/6)
#  444|   
#  445|   	if (!init_drv_if()) {
#  446|-> 		LLDPAD_WARN("Error creataing netlink socket for driver i/f.\n");
#  447|   		goto out_err;
#  448|   	}

Error: GCC_ANALYZER_WARNING (CWE-401): [#def68]
lldpad-1.1.0/lldp_dcbx.c:446:17: warning[-Wanalyzer-malloc-leak]: leak of ‘mod’
lldpad-1.1.0/lldp_dcbx.c:387:12: branch_false: following ‘false’ branch...
lldpad-1.1.0/lldp_dcbx.c:393:13: branch_false: ...to here
lldpad-1.1.0/lldp_dcbx.c:393:12: branch_true: following ‘true’ branch...
lldpad-1.1.0/lldp_dcbx.c:394:17: branch_true: ...to here
lldpad-1.1.0/lldp_dcbx.c:400:15: acquire_memory: allocated here
lldpad-1.1.0/lldp_dcbx.c:401:12: branch_false: following ‘false’ branch (when ‘mod’ is non-NULL)...
lldpad-1.1.0/lldp_dcbx.c:405:15: branch_false: ...to here
lldpad-1.1.0/lldp_dcbx.c:406:12: branch_false: following ‘false’ branch (when ‘dud’ is non-NULL)...
lldpad-1.1.0/lldp_dcbx.c:412:9: branch_false: ...to here
lldpad-1.1.0/lldp_dcbx.c:418:12: branch_true: following ‘true’ branch...
lldpad-1.1.0/lldp_dcbx.c:424:14: branch_true: ...to here
lldpad-1.1.0/lldp_dcbx.c:424:12: branch_true: following ‘true’ branch...
lldpad-1.1.0/lldp_dcbx.c:424:12: branch_true: ...to here
lldpad-1.1.0/lldp_dcbx.c:430:21: branch_true: following ‘true’ branch (when ‘i != 3’)...
lldpad-1.1.0/lldp_dcbx.c:431:22: branch_true: ...to here
lldpad-1.1.0/lldp_dcbx.c:431:20: branch_true: following ‘true’ branch...
lldpad-1.1.0/lldp_dcbx.c:430:41: branch_true: ...to here
lldpad-1.1.0/lldp_dcbx.c:431:20: branch_true: following ‘true’ branch...
lldpad-1.1.0/lldp_dcbx.c:430:41: branch_true: ...to here
lldpad-1.1.0/lldp_dcbx.c:438:21: branch_true: following ‘true’ branch (when ‘i == 0’)...
lldpad-1.1.0/lldp_dcbx.c:439:22: branch_true: ...to here
lldpad-1.1.0/lldp_dcbx.c:439:20: branch_true: following ‘true’ branch...
lldpad-1.1.0/lldp_dcbx.c:439:20: branch_true: ...to here
lldpad-1.1.0/lldp_dcbx.c:445:12: branch_true: following ‘true’ branch...
lldpad-1.1.0/lldp_dcbx.c:446:17: branch_true: ...to here
lldpad-1.1.0/lldp_dcbx.c:446:17: throw: if ‘log_message’ throws an exception...
lldpad-1.1.0/lldp_dcbx.c:446:17: danger: ‘mod’ leaks here; was allocated at [(5)](sarif:/runs/0/results/20/codeFlows/0/threadFlows/0/locations/4)
#  444|   
#  445|   	if (!init_drv_if()) {
#  446|-> 		LLDPAD_WARN("Error creataing netlink socket for driver i/f.\n");
#  447|   		goto out_err;
#  448|   	}

Error: GCC_ANALYZER_WARNING (CWE-401): [#def69]
lldpad-1.1.0/lldp_dcbx.c:450:9: warning[-Wanalyzer-malloc-leak]: leak of ‘dud’
lldpad-1.1.0/lldp_dcbx.c:387:12: branch_false: following ‘false’ branch...
lldpad-1.1.0/lldp_dcbx.c:393:13: branch_false: ...to here
lldpad-1.1.0/lldp_dcbx.c:393:12: branch_true: following ‘true’ branch...
lldpad-1.1.0/lldp_dcbx.c:394:17: branch_true: ...to here
lldpad-1.1.0/lldp_dcbx.c:401:12: branch_false: following ‘false’ branch (when ‘mod’ is non-NULL)...
lldpad-1.1.0/lldp_dcbx.c:405:15: branch_false: ...to here
lldpad-1.1.0/lldp_dcbx.c:405:15: acquire_memory: allocated here
lldpad-1.1.0/lldp_dcbx.c:406:12: branch_false: following ‘false’ branch (when ‘dud’ is non-NULL)...
lldpad-1.1.0/lldp_dcbx.c:412:9: branch_false: ...to here
lldpad-1.1.0/lldp_dcbx.c:418:12: branch_true: following ‘true’ branch...
lldpad-1.1.0/lldp_dcbx.c:424:14: branch_true: ...to here
lldpad-1.1.0/lldp_dcbx.c:424:12: branch_true: following ‘true’ branch...
lldpad-1.1.0/lldp_dcbx.c:424:12: branch_true: ...to here
lldpad-1.1.0/lldp_dcbx.c:430:21: branch_true: following ‘true’ branch (when ‘i != 3’)...
lldpad-1.1.0/lldp_dcbx.c:431:22: branch_true: ...to here
lldpad-1.1.0/lldp_dcbx.c:431:20: branch_true: following ‘true’ branch...
lldpad-1.1.0/lldp_dcbx.c:430:41: branch_true: ...to here
lldpad-1.1.0/lldp_dcbx.c:431:20: branch_true: following ‘true’ branch...
lldpad-1.1.0/lldp_dcbx.c:430:41: branch_true: ...to here
lldpad-1.1.0/lldp_dcbx.c:438:21: branch_true: following ‘true’ branch (when ‘i == 0’)...
lldpad-1.1.0/lldp_dcbx.c:439:22: branch_true: ...to here
lldpad-1.1.0/lldp_dcbx.c:439:20: branch_true: following ‘true’ branch...
lldpad-1.1.0/lldp_dcbx.c:439:20: branch_true: ...to here
lldpad-1.1.0/lldp_dcbx.c:445:12: branch_false: following ‘false’ branch...
lldpad-1.1.0/lldp_dcbx.c:450:9: branch_false: ...to here
lldpad-1.1.0/lldp_dcbx.c:450:9: throw: if ‘log_message’ throws an exception...
lldpad-1.1.0/lldp_dcbx.c:450:9: danger: ‘dud’ leaks here; was allocated at [(7)](sarif:/runs/0/results/23/codeFlows/0/threadFlows/0/locations/6)
#  448|   	}
#  449|   
#  450|-> 	LLDPAD_DBG("%s: dcbx register done\n", __func__);
#  451|   	return mod;
#  452|   out_err:

Error: GCC_ANALYZER_WARNING (CWE-401): [#def70]
lldpad-1.1.0/lldp_dcbx.c:450:9: warning[-Wanalyzer-malloc-leak]: leak of ‘mod’
lldpad-1.1.0/lldp_dcbx.c:387:12: branch_false: following ‘false’ branch...
lldpad-1.1.0/lldp_dcbx.c:393:13: branch_false: ...to here
lldpad-1.1.0/lldp_dcbx.c:393:12: branch_true: following ‘true’ branch...
lldpad-1.1.0/lldp_dcbx.c:394:17: branch_true: ...to here
lldpad-1.1.0/lldp_dcbx.c:400:15: acquire_memory: allocated here
lldpad-1.1.0/lldp_dcbx.c:401:12: branch_false: following ‘false’ branch (when ‘mod’ is non-NULL)...
lldpad-1.1.0/lldp_dcbx.c:405:15: branch_false: ...to here
lldpad-1.1.0/lldp_dcbx.c:406:12: branch_false: following ‘false’ branch (when ‘dud’ is non-NULL)...
lldpad-1.1.0/lldp_dcbx.c:412:9: branch_false: ...to here
lldpad-1.1.0/lldp_dcbx.c:418:12: branch_true: following ‘true’ branch...
lldpad-1.1.0/lldp_dcbx.c:424:14: branch_true: ...to here
lldpad-1.1.0/lldp_dcbx.c:424:12: branch_true: following ‘true’ branch...
lldpad-1.1.0/lldp_dcbx.c:424:12: branch_true: ...to here
lldpad-1.1.0/lldp_dcbx.c:430:21: branch_true: following ‘true’ branch (when ‘i != 3’)...
lldpad-1.1.0/lldp_dcbx.c:431:22: branch_true: ...to here
lldpad-1.1.0/lldp_dcbx.c:431:20: branch_true: following ‘true’ branch...
lldpad-1.1.0/lldp_dcbx.c:430:41: branch_true: ...to here
lldpad-1.1.0/lldp_dcbx.c:431:20: branch_true: following ‘true’ branch...
lldpad-1.1.0/lldp_dcbx.c:430:41: branch_true: ...to here
lldpad-1.1.0/lldp_dcbx.c:438:21: branch_true: following ‘true’ branch (when ‘i == 0’)...
lldpad-1.1.0/lldp_dcbx.c:439:22: branch_true: ...to here
lldpad-1.1.0/lldp_dcbx.c:439:20: branch_true: following ‘true’ branch...
lldpad-1.1.0/lldp_dcbx.c:439:20: branch_true: ...to here
lldpad-1.1.0/lldp_dcbx.c:445:12: branch_false: following ‘false’ branch...
lldpad-1.1.0/lldp_dcbx.c:450:9: branch_false: ...to here
lldpad-1.1.0/lldp_dcbx.c:450:9: throw: if ‘log_message’ throws an exception...
lldpad-1.1.0/lldp_dcbx.c:450:9: danger: ‘mod’ leaks here; was allocated at [(5)](sarif:/runs/0/results/22/codeFlows/0/threadFlows/0/locations/4)
#  448|   	}
#  449|   
#  450|-> 	LLDPAD_DBG("%s: dcbx register done\n", __func__);
#  451|   	return mod;
#  452|   out_err:

Error: GCC_ANALYZER_WARNING (CWE-401): [#def71]
lldpad-1.1.0/lldp_dcbx.c:453:9: warning[-Wanalyzer-malloc-leak]: leak of ‘dud’
lldpad-1.1.0/lldp_dcbx.c:387:12: branch_false: following ‘false’ branch...
lldpad-1.1.0/lldp_dcbx.c:393:13: branch_false: ...to here
lldpad-1.1.0/lldp_dcbx.c:393:12: branch_true: following ‘true’ branch...
lldpad-1.1.0/lldp_dcbx.c:394:17: branch_true: ...to here
lldpad-1.1.0/lldp_dcbx.c:401:12: branch_false: following ‘false’ branch (when ‘mod’ is non-NULL)...
lldpad-1.1.0/lldp_dcbx.c:405:15: branch_false: ...to here
lldpad-1.1.0/lldp_dcbx.c:405:15: acquire_memory: allocated here
lldpad-1.1.0/lldp_dcbx.c:406:12: branch_false: following ‘false’ branch (when ‘dud’ is non-NULL)...
lldpad-1.1.0/lldp_dcbx.c:412:9: branch_false: ...to here
lldpad-1.1.0/lldp_dcbx.c:453:9: throw: if ‘log_message’ throws an exception...
lldpad-1.1.0/lldp_dcbx.c:453:9: danger: ‘dud’ leaks here; was allocated at [(7)](sarif:/runs/0/results/25/codeFlows/0/threadFlows/0/locations/6)
#  451|   	return mod;
#  452|   out_err:
#  453|-> 	LLDPAD_DBG("%s: dcbx register failed\n", __func__);
#  454|   	return NULL;
#  455|   }

Error: GCC_ANALYZER_WARNING (CWE-401): [#def72]
lldpad-1.1.0/lldp_dcbx.c:453:9: warning[-Wanalyzer-malloc-leak]: leak of ‘mod’
lldpad-1.1.0/lldp_dcbx.c:387:12: branch_false: following ‘false’ branch...
lldpad-1.1.0/lldp_dcbx.c:393:13: branch_false: ...to here
lldpad-1.1.0/lldp_dcbx.c:393:12: branch_true: following ‘true’ branch...
lldpad-1.1.0/lldp_dcbx.c:394:17: branch_true: ...to here
lldpad-1.1.0/lldp_dcbx.c:400:15: acquire_memory: allocated here
lldpad-1.1.0/lldp_dcbx.c:401:12: branch_false: following ‘false’ branch (when ‘mod’ is non-NULL)...
lldpad-1.1.0/lldp_dcbx.c:405:15: branch_false: ...to here
lldpad-1.1.0/lldp_dcbx.c:406:12: branch_false: following ‘false’ branch (when ‘dud’ is non-NULL)...
lldpad-1.1.0/lldp_dcbx.c:412:9: branch_false: ...to here
lldpad-1.1.0/lldp_dcbx.c:453:9: throw: if ‘log_message’ throws an exception...
lldpad-1.1.0/lldp_dcbx.c:453:9: danger: ‘mod’ leaks here; was allocated at [(5)](sarif:/runs/0/results/24/codeFlows/0/threadFlows/0/locations/4)
#  451|   	return mod;
#  452|   out_err:
#  453|-> 	LLDPAD_DBG("%s: dcbx register failed\n", __func__);
#  454|   	return NULL;
#  455|   }

Error: CPPCHECK_WARNING (CWE-476): [#def73]
lldpad-1.1.0/lldp_dcbx.c:698: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: manifest
#  696|   	if (tlv->type == TYPE_1) {
#  697|   		manifest = malloc(sizeof(*manifest));
#  698|-> 		memset(manifest, 0, sizeof(*manifest));
#  699|   		dcbx->manifest = manifest;
#  700|   		dcbx->dcbdu = 0;

Error: COMPILER_WARNING: [#def74]
lldpad-1.1.0/lldp_dcbx_cmds.c: scope_hint: In function ‘dont_advertise_dcbx_all’
lldpad-1.1.0/lldp_dcbx_cmds.c:137:13: warning[-Wunused-but-set-variable=]: variable ‘event_flag’ set but not used
#  137 |         u32 event_flag = 0;
#      |             ^~~~~~~~~~
#  135|   	app_attribs app_data;
#  136|   	llink_attribs llink_data;
#  137|-> 	u32 event_flag = 0;
#  138|   
#  139|   	is_pfc = get_pfc(ifname, &pfc_data);

Error: COMPILER_WARNING: [#def75]
lldpad-1.1.0/lldp_dcbx_nl.c: scope_hint: In function ‘get_dcb_capabilities’
lldpad-1.1.0/lldp_dcbx_nl.c:468:13: warning[-Wunused-but-set-variable=]: variable ‘i’ set but not used
#  468 |         int i;
#      |             ^
#  466|   	int rval = 0;
#  467|   	unsigned int seq;
#  468|-> 	int i;
#  469|   	u8 cap;
#  470|   

Error: COMPILER_WARNING: [#def76]
lldpad-1.1.0/lldp_dcbx_nl.c: scope_hint: In function ‘get_dcb_numtcs’
lldpad-1.1.0/lldp_dcbx_nl.c:555:13: warning[-Wunused-but-set-variable=]: variable ‘i’ set but not used
#  555 |         int i;
#      |             ^
#  553|   	int rval = 0;
#  554|   	unsigned int seq;
#  555|-> 	int i;
#  556|   	int found;
#  557|   	char name[IFNAMSIZ];

Error: GCC_ANALYZER_WARNING (CWE-415): [#def77]
lldpad-1.1.0/lldp_evb.c:412:25: warning[-Wanalyzer-double-free]: double-‘free’ of ‘((struct evb_user_data)*(void *)((void *)ud)).head.lh_first’
lldpad-1.1.0/lldp_evb.c:417:6: enter_function: entry to ‘evb_unregister’
lldpad-1.1.0/lldp_evb.c:419:12: branch_true: following ‘true’ branch...
lldpad-1.1.0/lldp_evb.c:420:17: branch_true: ...to here
lldpad-1.1.0/lldp_evb.c:420:17: call_function: calling ‘evb_free_data’ from ‘evb_unregister’
#  410|   			ed = LIST_FIRST(&ud->head);
#  411|   			LIST_REMOVE(ed, entry);
#  412|-> 			free(ed);
#  413|   		}
#  414|   	}

Error: GCC_ANALYZER_WARNING (CWE-401): [#def78]
lldpad-1.1.0/lldp_evb.c:459:9: warning[-Wanalyzer-malloc-leak]: leak of ‘mod’
lldpad-1.1.0/lldp_evb.c:444:15: acquire_memory: allocated here
lldpad-1.1.0/lldp_evb.c:445:12: branch_false: following ‘false’ branch (when ‘mod’ is non-NULL)...
lldpad-1.1.0/lldp_evb.c:449:14: branch_false: ...to here
lldpad-1.1.0/lldp_evb.c:450:12: branch_false: following ‘false’ branch (when ‘ud’ is non-NULL)...
lldpad-1.1.0/lldp_evb.c:456:9: branch_false: ...to here
lldpad-1.1.0/lldp_evb.c:459:9: throw: if ‘log_message’ throws an exception...
lldpad-1.1.0/lldp_evb.c:459:9: danger: ‘mod’ leaks here; was allocated at [(1)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/0)
#  457|   	mod->ops = &evb_ops;
#  458|   	mod->data = ud;
#  459|-> 	LLDPAD_DBG("%s:done\n", __func__);
#  460|   	return mod;
#  461|   }

Error: GCC_ANALYZER_WARNING (CWE-401): [#def79]
lldpad-1.1.0/lldp_evb.c:459:9: warning[-Wanalyzer-malloc-leak]: leak of ‘ud’
lldpad-1.1.0/lldp_evb.c:445:12: branch_false: following ‘false’ branch (when ‘mod’ is non-NULL)...
lldpad-1.1.0/lldp_evb.c:449:14: branch_false: ...to here
lldpad-1.1.0/lldp_evb.c:449:14: acquire_memory: allocated here
lldpad-1.1.0/lldp_evb.c:450:12: branch_false: following ‘false’ branch (when ‘ud’ is non-NULL)...
lldpad-1.1.0/lldp_evb.c:456:9: branch_false: ...to here
lldpad-1.1.0/lldp_evb.c:459:9: throw: if ‘log_message’ throws an exception...
lldpad-1.1.0/lldp_evb.c:459:9: danger: ‘ud’ leaks here; was allocated at [(3)](sarif:/runs/0/results/2/codeFlows/0/threadFlows/0/locations/2)
#  457|   	mod->ops = &evb_ops;
#  458|   	mod->data = ud;
#  459|-> 	LLDPAD_DBG("%s:done\n", __func__);
#  460|   	return mod;
#  461|   }

Error: GCC_ANALYZER_WARNING (CWE-415): [#def80]
lldpad-1.1.0/lldp_evb22.c:516:25: warning[-Wanalyzer-double-free]: double-‘free’ of ‘((struct evb22_user_data)*(void *)((void *)ud)).head.lh_first’
lldpad-1.1.0/lldp_evb22.c:521:6: enter_function: entry to ‘evb22_unregister’
lldpad-1.1.0/lldp_evb22.c:523:12: branch_true: following ‘true’ branch...
lldpad-1.1.0/lldp_evb22.c:524:17: branch_true: ...to here
lldpad-1.1.0/lldp_evb22.c:524:17: call_function: calling ‘evb22_free_data’ from ‘evb22_unregister’
#  514|   			ed = LIST_FIRST(&ud->head);
#  515|   			LIST_REMOVE(ed, entry);
#  516|-> 			free(ed);
#  517|   		}
#  518|   	}

Error: GCC_ANALYZER_WARNING (CWE-401): [#def81]
lldpad-1.1.0/lldp_evb22.c:563:9: warning[-Wanalyzer-malloc-leak]: leak of ‘mod’
lldpad-1.1.0/lldp_evb22.c:548:15: acquire_memory: allocated here
lldpad-1.1.0/lldp_evb22.c:549:12: branch_false: following ‘false’ branch (when ‘mod’ is non-NULL)...
lldpad-1.1.0/lldp_evb22.c:553:14: branch_false: ...to here
lldpad-1.1.0/lldp_evb22.c:554:12: branch_false: following ‘false’ branch (when ‘ud’ is non-NULL)...
lldpad-1.1.0/lldp_evb22.c:560:9: branch_false: ...to here
lldpad-1.1.0/lldp_evb22.c:563:9: throw: if ‘log_message’ throws an exception...
lldpad-1.1.0/lldp_evb22.c:563:9: danger: ‘mod’ leaks here; was allocated at [(1)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/0)
#  561|   	mod->ops = &evb22_ops;
#  562|   	mod->data = ud;
#  563|-> 	LLDPAD_DBG("%s:done\n", __func__);
#  564|   	return mod;
#  565|   }

Error: GCC_ANALYZER_WARNING (CWE-401): [#def82]
lldpad-1.1.0/lldp_evb22.c:563:9: warning[-Wanalyzer-malloc-leak]: leak of ‘ud’
lldpad-1.1.0/lldp_evb22.c:549:12: branch_false: following ‘false’ branch (when ‘mod’ is non-NULL)...
lldpad-1.1.0/lldp_evb22.c:553:14: branch_false: ...to here
lldpad-1.1.0/lldp_evb22.c:553:14: acquire_memory: allocated here
lldpad-1.1.0/lldp_evb22.c:554:12: branch_false: following ‘false’ branch (when ‘ud’ is non-NULL)...
lldpad-1.1.0/lldp_evb22.c:560:9: branch_false: ...to here
lldpad-1.1.0/lldp_evb22.c:563:9: throw: if ‘log_message’ throws an exception...
lldpad-1.1.0/lldp_evb22.c:563:9: danger: ‘ud’ leaks here; was allocated at [(3)](sarif:/runs/0/results/2/codeFlows/0/threadFlows/0/locations/2)
#  561|   	mod->ops = &evb22_ops;
#  562|   	mod->data = ud;
#  563|-> 	LLDPAD_DBG("%s:done\n", __func__);
#  564|   	return mod;
#  565|   }

Error: GCC_ANALYZER_WARNING (CWE-416): [#def83]
lldpad-1.1.0/lldp_mand.c:554:17: warning[-Wanalyzer-use-after-free]: use after ‘free’ of ‘md’
lldpad-1.1.0/lldp_mand.c:656:6: enter_function: entry to ‘mand_unregister’
lldpad-1.1.0/lldp_mand.c:664:12: branch_false: following ‘false’ branch (when ‘nameidx’ is non-NULL)...
lldpad-1.1.0/lldp_mand.c:664:12: branch_false: ...to here
lldpad-1.1.0/lldp_mand.c:686:12: branch_true: following ‘true’ branch...
lldpad-1.1.0/lldp_mand.c:687:17: branch_true: ...to here
lldpad-1.1.0/lldp_mand.c:687:17: call_function: calling ‘mand_free_data’ from ‘mand_unregister’
#  552|   {
#  553|   	if (md) {
#  554|-> 		FREE_UNPKD_TLV(md, chassis);
#  555|   		FREE_UNPKD_TLV(md, portid);
#  556|   		FREE_UNPKD_TLV(md, ttl);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def84]
lldpad-1.1.0/lldp_mand.c:649:9: warning[-Wanalyzer-malloc-leak]: leak of ‘mod’
lldpad-1.1.0/lldp_mand.c:634:15: acquire_memory: allocated here
lldpad-1.1.0/lldp_mand.c:635:12: branch_false: following ‘false’ branch (when ‘mod’ is non-NULL)...
lldpad-1.1.0/lldp_mand.c:639:11: branch_false: ...to here
lldpad-1.1.0/lldp_mand.c:640:12: branch_false: following ‘false’ branch (when ‘mud’ is non-NULL)...
lldpad-1.1.0/lldp_mand.c:645:9: branch_false: ...to here
lldpad-1.1.0/lldp_mand.c:649:9: throw: if ‘log_message’ throws an exception...
lldpad-1.1.0/lldp_mand.c:649:9: danger: ‘mod’ leaks here; was allocated at [(1)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/0)
#  647|       mod->data = mud;
#  648|   	mod->ops = &mand_ops;
#  649|-> 	LLDPAD_INFO("%s:done\n", __func__);
#  650|   	return mod;
#  651|   out_err:

Error: GCC_ANALYZER_WARNING (CWE-401): [#def85]
lldpad-1.1.0/lldp_mand.c:649:9: warning[-Wanalyzer-malloc-leak]: leak of ‘mud’
lldpad-1.1.0/lldp_mand.c:635:12: branch_false: following ‘false’ branch (when ‘mod’ is non-NULL)...
lldpad-1.1.0/lldp_mand.c:639:11: branch_false: ...to here
lldpad-1.1.0/lldp_mand.c:639:11: acquire_memory: allocated here
lldpad-1.1.0/lldp_mand.c:640:12: branch_false: following ‘false’ branch (when ‘mud’ is non-NULL)...
lldpad-1.1.0/lldp_mand.c:645:9: branch_false: ...to here
lldpad-1.1.0/lldp_mand.c:649:9: throw: if ‘log_message’ throws an exception...
lldpad-1.1.0/lldp_mand.c:649:9: danger: ‘mud’ leaks here; was allocated at [(3)](sarif:/runs/0/results/2/codeFlows/0/threadFlows/0/locations/2)
#  647|       mod->data = mud;
#  648|   	mod->ops = &mand_ops;
#  649|-> 	LLDPAD_INFO("%s:done\n", __func__);
#  650|   	return mod;
#  651|   out_err:

Error: CPPCHECK_WARNING (CWE-457): [#def86]
lldpad-1.1.0/lldp_mand.c:675: error[uninitvar]: Uninitialized variable: agent->type
#  673|   
#  674|   		LIST_FOREACH(agent, &port->agent_head, entry) {
#  675|-> 			md = mand_data(p->if_name, agent->type);
#  676|   			if (!md)
#  677|   				continue;

Error: CPPCHECK_WARNING (CWE-457): [#def87]
lldpad-1.1.0/lldp_mand.c:705: error[uninitvar]: Uninitialized variable: agent->timers.txFastInit
#  703|   		agent->tx.txTTL = ttl_val;
#  704|   		agent->tx.localChange = 1;
#  705|-> 		agent->tx.txFast = agent->timers.txFastInit;
#  706|   	}
#  707|   }

Error: CPPCHECK_WARNING (CWE-457): [#def88]
lldpad-1.1.0/lldp_mand_cmds.c:470: error[uninitvar]: Uninitialized variable: np->ops
#  468|   
#  469|   	LIST_FOREACH(np, &lldp_mod_head, lldp) {
#  470|-> 		if (!np->ops->get_arg_handler)
#  471|   			continue;
#  472|   		if (!(ah = np->ops->get_arg_handler()))

Error: CPPCHECK_WARNING (CWE-457): [#def89]
lldpad-1.1.0/lldp_mand_cmds.c:500: error[uninitvar]: Uninitialized variable: np->ops
#  498|   
#  499|   	LIST_FOREACH(np, &lldp_mod_head, lldp) {
#  500|-> 		if (!np->ops->get_arg_handler)
#  501|   			continue;
#  502|   		if (!(ah = np->ops->get_arg_handler()))

Error: CPPCHECK_WARNING (CWE-457): [#def90]
lldpad-1.1.0/lldp_mand_cmds.c:597: error[uninitvar]: Uninitialized variable: np->ops
#  595|   
#  596|   	LIST_FOREACH(np, &lldp_mod_head, lldp) {
#  597|-> 		if (!np->ops->get_arg_handler)
#  598|   			continue;
#  599|   		if (!(ah = np->ops->get_arg_handler()))

Error: CPPCHECK_WARNING (CWE-457): [#def91]
lldpad-1.1.0/lldp_mand_cmds.c:630: error[uninitvar]: Uninitialized variable: np->ops
#  628|   
#  629|   	LIST_FOREACH(np, &lldp_mod_head, lldp) {
#  630|-> 		if (!np->ops->get_arg_handler)
#  631|   			continue;
#  632|   		if (!(ah = np->ops->get_arg_handler()))

Error: GCC_ANALYZER_WARNING (CWE-401): [#def92]
lldpad-1.1.0/lldp_mand_cmds.c:719:13: warning[-Wanalyzer-malloc-leak]: leak of ‘args’
lldpad-1.1.0/lldp_mand_cmds.c:746:5: enter_function: entry to ‘mand_clif_cmd’
lldpad-1.1.0/lldp_mand_cmds.c:770:12: branch_true: following ‘true’ branch...
lldpad-1.1.0/lldp_mand_cmds.c:771:17: branch_true: ...to here
lldpad-1.1.0/lldp_mand_cmds.c:797:27: branch_false: following ‘false’ branch...
lldpad-1.1.0/lldp_mand_cmds.c:806:16: branch_false: ...to here
lldpad-1.1.0/lldp_mand_cmds.c:806:16: acquire_memory: allocated here
lldpad-1.1.0/lldp_mand_cmds.c:807:12: branch_false: following ‘false’ branch (when ‘args’ is non-NULL)...
lldpad-1.1.0/lldp_mand_cmds.c:810:19: branch_false: ...to here
lldpad-1.1.0/lldp_mand_cmds.c:811:12: branch_false: following ‘false’ branch (when ‘argvals’ is non-NULL)...
lldpad-1.1.0/lldp_mand_cmds.c:816:14: branch_false: ...to here
lldpad-1.1.0/lldp_mand_cmds.c:818:17: branch_false: following ‘false’ branch...
lldpad-1.1.0/lldp_mand_cmds.c:824:31: branch_false: ...to here
lldpad-1.1.0/lldp_mand_cmds.c:828:12: branch_false: following ‘false’ branch...
lldpad-1.1.0/lldp_mand_cmds.c:836:20: branch_false: following ‘false’ branch (when ‘numargs == 0’)...
lldpad-1.1.0/lldp_mand_cmds.c:838:27: branch_false: ...to here
lldpad-1.1.0/lldp_mand_cmds.c:838:27: call_function: calling ‘get_agent_stats’ from ‘mand_clif_cmd’
#  717|   	struct agentstats stats;
#  718|   
#  719|-> 	if (get_lldp_agent_statistics(cmd->ifname, &stats, cmd->type))
#  720|   		return cmd_device_not_found;
#  721|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def93]
lldpad-1.1.0/lldp_mand_cmds.c:719:13: warning[-Wanalyzer-malloc-leak]: leak of ‘argvals’
lldpad-1.1.0/lldp_mand_cmds.c:746:5: enter_function: entry to ‘mand_clif_cmd’
lldpad-1.1.0/lldp_mand_cmds.c:770:12: branch_true: following ‘true’ branch...
lldpad-1.1.0/lldp_mand_cmds.c:771:17: branch_true: ...to here
lldpad-1.1.0/lldp_mand_cmds.c:797:27: branch_false: following ‘false’ branch...
lldpad-1.1.0/lldp_mand_cmds.c:806:16: branch_false: ...to here
lldpad-1.1.0/lldp_mand_cmds.c:807:12: branch_false: following ‘false’ branch (when ‘args’ is non-NULL)...
lldpad-1.1.0/lldp_mand_cmds.c:810:19: branch_false: ...to here
lldpad-1.1.0/lldp_mand_cmds.c:810:19: acquire_memory: allocated here
lldpad-1.1.0/lldp_mand_cmds.c:811:12: branch_false: following ‘false’ branch (when ‘argvals’ is non-NULL)...
lldpad-1.1.0/lldp_mand_cmds.c:816:14: branch_false: ...to here
lldpad-1.1.0/lldp_mand_cmds.c:818:17: branch_false: following ‘false’ branch...
lldpad-1.1.0/lldp_mand_cmds.c:824:31: branch_false: ...to here
lldpad-1.1.0/lldp_mand_cmds.c:828:12: branch_false: following ‘false’ branch...
lldpad-1.1.0/lldp_mand_cmds.c:836:20: branch_false: following ‘false’ branch (when ‘numargs == 0’)...
lldpad-1.1.0/lldp_mand_cmds.c:838:27: branch_false: ...to here
lldpad-1.1.0/lldp_mand_cmds.c:838:27: call_function: calling ‘get_agent_stats’ from ‘mand_clif_cmd’
#  717|   	struct agentstats stats;
#  718|   
#  719|-> 	if (get_lldp_agent_statistics(cmd->ifname, &stats, cmd->type))
#  720|   		return cmd_device_not_found;
#  721|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def94]
lldpad-1.1.0/lldp_mand_cmds.c:817:27: warning[-Wanalyzer-malloc-leak]: leak of ‘args’
lldpad-1.1.0/lldp_mand_cmds.c:770:12: branch_true: following ‘true’ branch...
lldpad-1.1.0/lldp_mand_cmds.c:771:17: branch_true: ...to here
lldpad-1.1.0/lldp_mand_cmds.c:778:12: branch_false: following ‘false’ branch...
lldpad-1.1.0/lldp_mand_cmds.c:782:17: branch_false: ...to here
lldpad-1.1.0/lldp_mand_cmds.c:787:12: branch_false: following ‘false’ branch...
lldpad-1.1.0/lldp_mand_cmds.c:792:17: branch_false: ...to here
lldpad-1.1.0/lldp_mand_cmds.c:797:27: branch_false: following ‘false’ branch...
lldpad-1.1.0/lldp_mand_cmds.c:806:16: branch_false: ...to here
lldpad-1.1.0/lldp_mand_cmds.c:806:16: acquire_memory: allocated here
lldpad-1.1.0/lldp_mand_cmds.c:807:12: branch_false: following ‘false’ branch (when ‘args’ is non-NULL)...
lldpad-1.1.0/lldp_mand_cmds.c:810:19: branch_false: ...to here
lldpad-1.1.0/lldp_mand_cmds.c:811:12: branch_false: following ‘false’ branch (when ‘argvals’ is non-NULL)...
lldpad-1.1.0/lldp_mand_cmds.c:816:14: branch_false: ...to here
lldpad-1.1.0/lldp_mand_cmds.c:816:12: branch_true: following ‘true’ branch...
lldpad-1.1.0/lldp_mand_cmds.c:817:27: throw: if ‘get_arg_val_list’ throws an exception...
lldpad-1.1.0/lldp_mand_cmds.c:817:27: danger: ‘args’ leaks here; was allocated at [(9)](sarif:/runs/0/results/2/codeFlows/0/threadFlows/0/locations/8)
#  815|   
#  816|   	if ((cmd.ops & op_arg) && (cmd.ops & op_argval))
#  817|-> 		numargs = get_arg_val_list(ibuf, ilen, &ioff, args, argvals);
#  818|   	else if (cmd.ops & op_arg)
#  819|   		numargs = get_arg_list(ibuf, ilen, &ioff, args);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def95]
lldpad-1.1.0/lldp_mand_cmds.c:817:27: warning[-Wanalyzer-malloc-leak]: leak of ‘argvals’
lldpad-1.1.0/lldp_mand_cmds.c:770:12: branch_true: following ‘true’ branch...
lldpad-1.1.0/lldp_mand_cmds.c:771:17: branch_true: ...to here
lldpad-1.1.0/lldp_mand_cmds.c:778:12: branch_false: following ‘false’ branch...
lldpad-1.1.0/lldp_mand_cmds.c:782:17: branch_false: ...to here
lldpad-1.1.0/lldp_mand_cmds.c:787:12: branch_false: following ‘false’ branch...
lldpad-1.1.0/lldp_mand_cmds.c:792:17: branch_false: ...to here
lldpad-1.1.0/lldp_mand_cmds.c:797:27: branch_false: following ‘false’ branch...
lldpad-1.1.0/lldp_mand_cmds.c:806:16: branch_false: ...to here
lldpad-1.1.0/lldp_mand_cmds.c:807:12: branch_false: following ‘false’ branch (when ‘args’ is non-NULL)...
lldpad-1.1.0/lldp_mand_cmds.c:810:19: branch_false: ...to here
lldpad-1.1.0/lldp_mand_cmds.c:810:19: acquire_memory: allocated here
lldpad-1.1.0/lldp_mand_cmds.c:811:12: branch_false: following ‘false’ branch (when ‘argvals’ is non-NULL)...
lldpad-1.1.0/lldp_mand_cmds.c:816:14: branch_false: ...to here
lldpad-1.1.0/lldp_mand_cmds.c:816:12: branch_true: following ‘true’ branch...
lldpad-1.1.0/lldp_mand_cmds.c:817:27: throw: if ‘get_arg_val_list’ throws an exception...
lldpad-1.1.0/lldp_mand_cmds.c:817:27: danger: ‘argvals’ leaks here; was allocated at [(11)](sarif:/runs/0/results/3/codeFlows/0/threadFlows/0/locations/10)
#  815|   
#  816|   	if ((cmd.ops & op_arg) && (cmd.ops & op_argval))
#  817|-> 		numargs = get_arg_val_list(ibuf, ilen, &ioff, args, argvals);
#  818|   	else if (cmd.ops & op_arg)
#  819|   		numargs = get_arg_list(ibuf, ilen, &ioff, args);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def96]
lldpad-1.1.0/lldp_mand_cmds.c:819:27: warning[-Wanalyzer-malloc-leak]: leak of ‘args’
lldpad-1.1.0/lldp_mand_cmds.c:770:12: branch_true: following ‘true’ branch...
lldpad-1.1.0/lldp_mand_cmds.c:771:17: branch_true: ...to here
lldpad-1.1.0/lldp_mand_cmds.c:778:12: branch_false: following ‘false’ branch...
lldpad-1.1.0/lldp_mand_cmds.c:782:17: branch_false: ...to here
lldpad-1.1.0/lldp_mand_cmds.c:787:12: branch_false: following ‘false’ branch...
lldpad-1.1.0/lldp_mand_cmds.c:792:17: branch_false: ...to here
lldpad-1.1.0/lldp_mand_cmds.c:797:27: branch_false: following ‘false’ branch...
lldpad-1.1.0/lldp_mand_cmds.c:806:16: branch_false: ...to here
lldpad-1.1.0/lldp_mand_cmds.c:806:16: acquire_memory: allocated here
lldpad-1.1.0/lldp_mand_cmds.c:807:12: branch_false: following ‘false’ branch (when ‘args’ is non-NULL)...
lldpad-1.1.0/lldp_mand_cmds.c:810:19: branch_false: ...to here
lldpad-1.1.0/lldp_mand_cmds.c:811:12: branch_false: following ‘false’ branch (when ‘argvals’ is non-NULL)...
lldpad-1.1.0/lldp_mand_cmds.c:816:14: branch_false: ...to here
lldpad-1.1.0/lldp_mand_cmds.c:816:13: branch_false: following ‘false’ branch...
lldpad-1.1.0/lldp_mand_cmds.c:818:17: branch_false: ...to here
lldpad-1.1.0/lldp_mand_cmds.c:818:17: branch_true: following ‘true’ branch...
lldpad-1.1.0/lldp_mand_cmds.c:819:27: branch_true: ...to here
lldpad-1.1.0/lldp_mand_cmds.c:819:27: throw: if ‘get_arg_list’ throws an exception...
lldpad-1.1.0/lldp_mand_cmds.c:819:27: danger: ‘args’ leaks here; was allocated at [(9)](sarif:/runs/0/results/4/codeFlows/0/threadFlows/0/locations/8)
#  817|   		numargs = get_arg_val_list(ibuf, ilen, &ioff, args, argvals);
#  818|   	else if (cmd.ops & op_arg)
#  819|-> 		numargs = get_arg_list(ibuf, ilen, &ioff, args);
#  820|   
#  821|   	snprintf(rbuf, rlen, "%c%1x%02x%08x%02x%s",

Error: GCC_ANALYZER_WARNING (CWE-401): [#def97]
lldpad-1.1.0/lldp_mand_cmds.c:819:27: warning[-Wanalyzer-malloc-leak]: leak of ‘argvals’
lldpad-1.1.0/lldp_mand_cmds.c:770:12: branch_true: following ‘true’ branch...
lldpad-1.1.0/lldp_mand_cmds.c:771:17: branch_true: ...to here
lldpad-1.1.0/lldp_mand_cmds.c:778:12: branch_false: following ‘false’ branch...
lldpad-1.1.0/lldp_mand_cmds.c:782:17: branch_false: ...to here
lldpad-1.1.0/lldp_mand_cmds.c:787:12: branch_false: following ‘false’ branch...
lldpad-1.1.0/lldp_mand_cmds.c:792:17: branch_false: ...to here
lldpad-1.1.0/lldp_mand_cmds.c:797:27: branch_false: following ‘false’ branch...
lldpad-1.1.0/lldp_mand_cmds.c:806:16: branch_false: ...to here
lldpad-1.1.0/lldp_mand_cmds.c:807:12: branch_false: following ‘false’ branch (when ‘args’ is non-NULL)...
lldpad-1.1.0/lldp_mand_cmds.c:810:19: branch_false: ...to here
lldpad-1.1.0/lldp_mand_cmds.c:810:19: acquire_memory: allocated here
lldpad-1.1.0/lldp_mand_cmds.c:811:12: branch_false: following ‘false’ branch (when ‘argvals’ is non-NULL)...
lldpad-1.1.0/lldp_mand_cmds.c:816:14: branch_false: ...to here
lldpad-1.1.0/lldp_mand_cmds.c:816:13: branch_false: following ‘false’ branch...
lldpad-1.1.0/lldp_mand_cmds.c:818:17: branch_false: ...to here
lldpad-1.1.0/lldp_mand_cmds.c:818:17: branch_true: following ‘true’ branch...
lldpad-1.1.0/lldp_mand_cmds.c:819:27: branch_true: ...to here
lldpad-1.1.0/lldp_mand_cmds.c:819:27: throw: if ‘get_arg_list’ throws an exception...
lldpad-1.1.0/lldp_mand_cmds.c:819:27: danger: ‘argvals’ leaks here; was allocated at [(11)](sarif:/runs/0/results/5/codeFlows/0/threadFlows/0/locations/10)
#  817|   		numargs = get_arg_val_list(ibuf, ilen, &ioff, args, argvals);
#  818|   	else if (cmd.ops & op_arg)
#  819|-> 		numargs = get_arg_list(ibuf, ilen, &ioff, args);
#  820|   
#  821|   	snprintf(rbuf, rlen, "%c%1x%02x%08x%02x%s",

Error: GCC_ANALYZER_WARNING (CWE-401): [#def98]
lldpad-1.1.0/lldp_mand_cmds.c:828:14: warning[-Wanalyzer-malloc-leak]: leak of ‘args’
lldpad-1.1.0/lldp_mand_cmds.c:770:12: branch_true: following ‘true’ branch...
lldpad-1.1.0/lldp_mand_cmds.c:771:17: branch_true: ...to here
lldpad-1.1.0/lldp_mand_cmds.c:797:27: branch_false: following ‘false’ branch...
lldpad-1.1.0/lldp_mand_cmds.c:806:16: branch_false: ...to here
lldpad-1.1.0/lldp_mand_cmds.c:806:16: acquire_memory: allocated here
lldpad-1.1.0/lldp_mand_cmds.c:807:12: branch_false: following ‘false’ branch (when ‘args’ is non-NULL)...
lldpad-1.1.0/lldp_mand_cmds.c:810:19: branch_false: ...to here
lldpad-1.1.0/lldp_mand_cmds.c:811:12: branch_false: following ‘false’ branch (when ‘argvals’ is non-NULL)...
lldpad-1.1.0/lldp_mand_cmds.c:816:14: branch_false: ...to here
lldpad-1.1.0/lldp_mand_cmds.c:818:17: branch_false: following ‘false’ branch...
lldpad-1.1.0/lldp_mand_cmds.c:824:31: branch_false: ...to here
lldpad-1.1.0/lldp_mand_cmds.c:828:14: throw: if ‘get_ifidx’ throws an exception...
lldpad-1.1.0/lldp_mand_cmds.c:828:14: danger: ‘args’ leaks here; was allocated at [(5)](sarif:/runs/0/results/6/codeFlows/0/threadFlows/0/locations/4)
#  826|   
#  827|   	/* Confirm port is a valid LLDP port */
#  828|-> 	if (!get_ifidx(cmd.ifname) || !is_valid_lldp_device(cmd.ifname)) {
#  829|   		free(argvals);
#  830|   		free(args);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def99]
lldpad-1.1.0/lldp_mand_cmds.c:828:14: warning[-Wanalyzer-malloc-leak]: leak of ‘argvals’
lldpad-1.1.0/lldp_mand_cmds.c:770:12: branch_true: following ‘true’ branch...
lldpad-1.1.0/lldp_mand_cmds.c:771:17: branch_true: ...to here
lldpad-1.1.0/lldp_mand_cmds.c:797:27: branch_false: following ‘false’ branch...
lldpad-1.1.0/lldp_mand_cmds.c:806:16: branch_false: ...to here
lldpad-1.1.0/lldp_mand_cmds.c:807:12: branch_false: following ‘false’ branch (when ‘args’ is non-NULL)...
lldpad-1.1.0/lldp_mand_cmds.c:810:19: branch_false: ...to here
lldpad-1.1.0/lldp_mand_cmds.c:810:19: acquire_memory: allocated here
lldpad-1.1.0/lldp_mand_cmds.c:811:12: branch_false: following ‘false’ branch (when ‘argvals’ is non-NULL)...
lldpad-1.1.0/lldp_mand_cmds.c:816:14: branch_false: ...to here
lldpad-1.1.0/lldp_mand_cmds.c:818:17: branch_false: following ‘false’ branch...
lldpad-1.1.0/lldp_mand_cmds.c:824:31: branch_false: ...to here
lldpad-1.1.0/lldp_mand_cmds.c:828:14: throw: if ‘get_ifidx’ throws an exception...
lldpad-1.1.0/lldp_mand_cmds.c:828:14: danger: ‘argvals’ leaks here; was allocated at [(7)](sarif:/runs/0/results/7/codeFlows/0/threadFlows/0/locations/6)
#  826|   
#  827|   	/* Confirm port is a valid LLDP port */
#  828|-> 	if (!get_ifidx(cmd.ifname) || !is_valid_lldp_device(cmd.ifname)) {
#  829|   		free(argvals);
#  830|   		free(args);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def100]
lldpad-1.1.0/lldp_mand_cmds.c:828:40: warning[-Wanalyzer-malloc-leak]: leak of ‘args’
lldpad-1.1.0/lldp_mand_cmds.c:770:12: branch_true: following ‘true’ branch...
lldpad-1.1.0/lldp_mand_cmds.c:771:17: branch_true: ...to here
lldpad-1.1.0/lldp_mand_cmds.c:797:27: branch_false: following ‘false’ branch...
lldpad-1.1.0/lldp_mand_cmds.c:806:16: branch_false: ...to here
lldpad-1.1.0/lldp_mand_cmds.c:806:16: acquire_memory: allocated here
lldpad-1.1.0/lldp_mand_cmds.c:807:12: branch_false: following ‘false’ branch (when ‘args’ is non-NULL)...
lldpad-1.1.0/lldp_mand_cmds.c:810:19: branch_false: ...to here
lldpad-1.1.0/lldp_mand_cmds.c:811:12: branch_false: following ‘false’ branch (when ‘argvals’ is non-NULL)...
lldpad-1.1.0/lldp_mand_cmds.c:816:14: branch_false: ...to here
lldpad-1.1.0/lldp_mand_cmds.c:818:17: branch_false: following ‘false’ branch...
lldpad-1.1.0/lldp_mand_cmds.c:824:31: branch_false: ...to here
lldpad-1.1.0/lldp_mand_cmds.c:828:12: branch_false: following ‘false’ branch...
lldpad-1.1.0/lldp_mand_cmds.c:828:40: branch_false: ...to here
lldpad-1.1.0/lldp_mand_cmds.c:828:40: throw: if ‘is_valid_lldp_device’ throws an exception...
lldpad-1.1.0/lldp_mand_cmds.c:828:40: danger: ‘args’ leaks here; was allocated at [(5)](sarif:/runs/0/results/8/codeFlows/0/threadFlows/0/locations/4)
#  826|   
#  827|   	/* Confirm port is a valid LLDP port */
#  828|-> 	if (!get_ifidx(cmd.ifname) || !is_valid_lldp_device(cmd.ifname)) {
#  829|   		free(argvals);
#  830|   		free(args);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def101]
lldpad-1.1.0/lldp_mand_cmds.c:828:40: warning[-Wanalyzer-malloc-leak]: leak of ‘argvals’
lldpad-1.1.0/lldp_mand_cmds.c:770:12: branch_true: following ‘true’ branch...
lldpad-1.1.0/lldp_mand_cmds.c:771:17: branch_true: ...to here
lldpad-1.1.0/lldp_mand_cmds.c:797:27: branch_false: following ‘false’ branch...
lldpad-1.1.0/lldp_mand_cmds.c:806:16: branch_false: ...to here
lldpad-1.1.0/lldp_mand_cmds.c:807:12: branch_false: following ‘false’ branch (when ‘args’ is non-NULL)...
lldpad-1.1.0/lldp_mand_cmds.c:810:19: branch_false: ...to here
lldpad-1.1.0/lldp_mand_cmds.c:810:19: acquire_memory: allocated here
lldpad-1.1.0/lldp_mand_cmds.c:811:12: branch_false: following ‘false’ branch (when ‘argvals’ is non-NULL)...
lldpad-1.1.0/lldp_mand_cmds.c:816:14: branch_false: ...to here
lldpad-1.1.0/lldp_mand_cmds.c:818:17: branch_false: following ‘false’ branch...
lldpad-1.1.0/lldp_mand_cmds.c:824:31: branch_false: ...to here
lldpad-1.1.0/lldp_mand_cmds.c:828:12: branch_false: following ‘false’ branch...
lldpad-1.1.0/lldp_mand_cmds.c:828:40: branch_false: ...to here
lldpad-1.1.0/lldp_mand_cmds.c:828:40: throw: if ‘is_valid_lldp_device’ throws an exception...
lldpad-1.1.0/lldp_mand_cmds.c:828:40: danger: ‘argvals’ leaks here; was allocated at [(7)](sarif:/runs/0/results/9/codeFlows/0/threadFlows/0/locations/6)
#  826|   
#  827|   	/* Confirm port is a valid LLDP port */
#  828|-> 	if (!get_ifidx(cmd.ifname) || !is_valid_lldp_device(cmd.ifname)) {
#  829|   		free(argvals);
#  830|   		free(args);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def102]
lldpad-1.1.0/lldp_med.c:946:9: warning[-Wanalyzer-malloc-leak]: leak of ‘mod’
lldpad-1.1.0/lldp_med.c:930:15: acquire_memory: allocated here
lldpad-1.1.0/lldp_med.c:931:12: branch_false: following ‘false’ branch (when ‘mod’ is non-NULL)...
lldpad-1.1.0/lldp_med.c:935:15: branch_false: ...to here
lldpad-1.1.0/lldp_med.c:936:12: branch_false: following ‘false’ branch (when ‘mud’ is non-NULL)...
lldpad-1.1.0/lldp_med.c:941:9: branch_false: ...to here
lldpad-1.1.0/lldp_med.c:946:9: throw: if ‘log_message’ throws an exception...
lldpad-1.1.0/lldp_med.c:946:9: danger: ‘mod’ leaks here; was allocated at [(1)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/0)
#  944|   	mod->data = mud;
#  945|   
#  946|-> 	LLDPAD_INFO("%s:done\n", __func__);
#  947|   	return mod;
#  948|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def103]
lldpad-1.1.0/lldp_med.c:946:9: warning[-Wanalyzer-malloc-leak]: leak of ‘mud’
lldpad-1.1.0/lldp_med.c:931:12: branch_false: following ‘false’ branch (when ‘mod’ is non-NULL)...
lldpad-1.1.0/lldp_med.c:935:15: branch_false: ...to here
lldpad-1.1.0/lldp_med.c:935:15: acquire_memory: allocated here
lldpad-1.1.0/lldp_med.c:936:12: branch_false: following ‘false’ branch (when ‘mud’ is non-NULL)...
lldpad-1.1.0/lldp_med.c:941:9: branch_false: ...to here
lldpad-1.1.0/lldp_med.c:946:9: throw: if ‘log_message’ throws an exception...
lldpad-1.1.0/lldp_med.c:946:9: danger: ‘mud’ leaks here; was allocated at [(3)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/2)
#  944|   	mod->data = mud;
#  945|   
#  946|-> 	LLDPAD_INFO("%s:done\n", __func__);
#  947|   	return mod;
#  948|   

Error: GCC_ANALYZER_WARNING (CWE-775): [#def104]
lldpad-1.1.0/lldp_rtnl.c:135:16: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘s’
lldpad-1.1.0/lldp_rtnl.c:138:5: enter_function: entry to ‘set_linkmode’
lldpad-1.1.0/lldp_rtnl.c:143:13: acquire_resource: datagram socket created here
lldpad-1.1.0/lldp_rtnl.c:144:12: branch_false: following ‘false’ branch (when ‘s >= 0’)...
lldpad-1.1.0/lldp_rtnl.c:146:14: branch_false: ...to here
lldpad-1.1.0/lldp_rtnl.c:146:14: call_function: calling ‘rtnl_send_linkmode’ from ‘set_linkmode’
#  133|   	add_rtattr(&req.nh, IFLA_LINKMODE, &linkmode, 1);
#  134|   
#  135|-> 	return send(s, &req, req.nh.nlmsg_len, 0);
#  136|   }
#  137|   

Error: GCC_ANALYZER_WARNING (CWE-775): [#def105]
lldpad-1.1.0/lldp_rtnl.c:179:16: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘s’
lldpad-1.1.0/lldp_rtnl.c:232:5: enter_function: entry to ‘set_operstate’
lldpad-1.1.0/lldp_rtnl.c:238:13: acquire_resource: datagram socket created here
lldpad-1.1.0/lldp_rtnl.c:239:12: branch_false: following ‘false’ branch (when ‘s >= 0’)...
lldpad-1.1.0/lldp_rtnl.c:241:14: branch_false: ...to here
lldpad-1.1.0/lldp_rtnl.c:241:14: call_function: calling ‘rtnl_send_operstate’ from ‘set_operstate’
#  177|   	add_rtattr(&req.nh, IFLA_OPERSTATE, &operstate, 1);
#  178|   
#  179|-> 	return send(s, &req, req.nh.nlmsg_len, 0);
#  180|   }
#  181|   

Error: GCC_ANALYZER_WARNING (CWE-775): [#def106]
lldpad-1.1.0/lldp_rtnl.c:209:14: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘s’
lldpad-1.1.0/lldp_rtnl.c:250:5: enter_function: entry to ‘get_operstate’
lldpad-1.1.0/lldp_rtnl.c:257:13: acquire_resource: datagram socket created here
lldpad-1.1.0/lldp_rtnl.c:258:12: branch_false: following ‘false’ branch (when ‘s >= 0’)...
lldpad-1.1.0/lldp_rtnl.c:261:9: branch_false: ...to here
lldpad-1.1.0/lldp_rtnl.c:261:9: call_function: calling ‘rtnl_recv_operstate’ from ‘get_operstate’
#  207|   		add_rtattr(nlh, IFLA_IFNAME, ifname, strlen(ifname));
#  208|   
#  209|-> 	rc = send(s, nlh, nlh->nlmsg_len, 0);
#  210|   	if (rc < 0)
#  211|   		goto out;

Error: GCC_ANALYZER_WARNING (CWE-775): [#def107]
lldpad-1.1.0/lldp_rtnl.c:262:9: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘s’
lldpad-1.1.0/lldp_rtnl.c:250:5: enter_function: entry to ‘get_operstate’
lldpad-1.1.0/lldp_rtnl.c:257:13: acquire_resource: datagram socket created here
lldpad-1.1.0/lldp_rtnl.c:258:12: branch_false: following ‘false’ branch (when ‘s >= 0’)...
lldpad-1.1.0/lldp_rtnl.c:261:9: branch_false: ...to here
lldpad-1.1.0/lldp_rtnl.c:261:9: call_function: calling ‘rtnl_recv_operstate’ from ‘get_operstate’
lldpad-1.1.0/lldp_rtnl.c:261:9: return_function: returning to ‘get_operstate’ from ‘rtnl_recv_operstate’
lldpad-1.1.0/lldp_rtnl.c:262:9: throw: if ‘close’ throws an exception...
lldpad-1.1.0/lldp_rtnl.c:262:9: danger: ‘s’ leaks here
#  260|   
#  261|   	rtnl_recv_operstate(s, ifindex, ifname, &operstate);
#  262|-> 	close(s);
#  263|   	return operstate;
#  264|   }

Error: GCC_ANALYZER_WARNING (CWE-775): [#def108]
lldpad-1.1.0/lldp_rtnl.c:302:14: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘s’
lldpad-1.1.0/lldp_rtnl.c:266:5: enter_function: entry to ‘get_perm_hwaddr’
lldpad-1.1.0/lldp_rtnl.c:293:13: acquire_resource: datagram socket created here
lldpad-1.1.0/lldp_rtnl.c:294:12: branch_false: following ‘false’ branch (when ‘s >= 0’)...
lldpad-1.1.0/lldp_rtnl.c:299:54: branch_false: ...to here
lldpad-1.1.0/lldp_rtnl.c:299:9: call_function: calling ‘add_rtattr’ from ‘get_perm_hwaddr’
lldpad-1.1.0/lldp_rtnl.c:299:9: return_function: returning to ‘get_perm_hwaddr’ from ‘add_rtattr’
lldpad-1.1.0/lldp_rtnl.c:300:9: call_function: calling ‘add_rtattr’ from ‘get_perm_hwaddr’
lldpad-1.1.0/lldp_rtnl.c:300:9: return_function: returning to ‘get_perm_hwaddr’ from ‘add_rtattr’
lldpad-1.1.0/lldp_rtnl.c:302:14: throw: if ‘send’ throws an exception...
lldpad-1.1.0/lldp_rtnl.c:302:14: danger: ‘s’ leaks here
#  300|   	add_rtattr(&req.nh, DCB_ATTR_PERM_HWADDR, NULL, 0);
#  301|   
#  302|-> 	rc = send(s, &req.nh, req.nh.nlmsg_len, 0);
#  303|   	if (rc < 0)
#  304|   		goto out;

Error: GCC_ANALYZER_WARNING (CWE-775): [#def109]
lldpad-1.1.0/lldp_util.c:170:17: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘s’
lldpad-1.1.0/lldp_util.c:673:5: enter_function: entry to ‘is_macvtap’
lldpad-1.1.0/lldp_util.c:681:13: acquire_resource: datagram socket created here
lldpad-1.1.0/lldp_util.c:683:12: branch_false: following ‘false’ branch (when ‘s >= 0’)...
lldpad-1.1.0/lldp_util.c:687:15: branch_false: ...to here
lldpad-1.1.0/lldp_util.c:689:12: branch_false: following ‘false’ branch (when ‘nlh’ is non-NULL)...
lldpad-1.1.0/lldp_util.c:693:9: call_function: inlined call to ‘memset’ from ‘is_macvtap’
lldpad-1.1.0/lldp_util.c:701:29: call_function: calling ‘get_ifidx’ from ‘is_macvtap’
#  168|   		int err = errno;
#  169|   
#  170|-> 		perror("socket create failed\n");
#  171|   		errno = err;
#  172|   	}

Error: GCC_ANALYZER_WARNING (CWE-401): [#def110]
lldpad-1.1.0/lldp_util.c:579:17: warning[-Wanalyzer-malloc-leak]: leak of ‘opendir(&path)’
lldpad-1.1.0/lldp_util.c:565:5: enter_function: entry to ‘is_bridge’
lldpad-1.1.0/lldp_util.c:572:12: branch_false: following ‘false’ branch...
lldpad-1.1.0/lldp_util.c:576:9: call_function: inlined call to ‘snprintf’ from ‘is_bridge’
lldpad-1.1.0/lldp_util.c:577:16: acquire_memory: allocated here
lldpad-1.1.0/lldp_util.c:578:12: branch_true: following ‘true’ branch...
lldpad-1.1.0/lldp_util.c:579:17: branch_true: ...to here
lldpad-1.1.0/lldp_util.c:579:17: danger: ‘opendir(&path)’ leaks here; was allocated at [(5)](sarif:/runs/0/results/2/codeFlows/0/threadFlows/0/locations/4)
#  577|   	dirp = opendir(path);
#  578|   	if (dirp) {
#  579|-> 		closedir(dirp);
#  580|   		rc = 1;
#  581|   	} else {

Error: GCC_ANALYZER_WARNING (CWE-401): [#def111]
lldpad-1.1.0/lldp_util.c:612:17: warning[-Wanalyzer-malloc-leak]: leak of ‘opendir(&path)’
lldpad-1.1.0/lldp_util.c:610:16: acquire_memory: allocated here
lldpad-1.1.0/lldp_util.c:611:12: branch_true: following ‘true’ branch...
lldpad-1.1.0/lldp_util.c:612:17: branch_true: ...to here
lldpad-1.1.0/lldp_util.c:612:17: danger: ‘opendir(&path)’ leaks here; was allocated at [(1)](sarif:/runs/0/results/3/codeFlows/0/threadFlows/0/locations/0)
#  610|   	dirp = opendir(path);
#  611|   	if (dirp) {
#  612|-> 		closedir(dirp);
#  613|   		rc = 1;
#  614|   	}

Error: GCC_ANALYZER_WARNING (CWE-775): [#def112]
lldpad-1.1.0/lldp_util.c:703:15: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘s’
lldpad-1.1.0/lldp_util.c:673:5: enter_function: entry to ‘is_macvtap’
lldpad-1.1.0/lldp_util.c:681:13: acquire_resource: datagram socket created here
lldpad-1.1.0/lldp_util.c:683:12: branch_false: following ‘false’ branch (when ‘s >= 0’)...
lldpad-1.1.0/lldp_util.c:687:15: branch_false: ...to here
lldpad-1.1.0/lldp_util.c:689:12: branch_false: following ‘false’ branch (when ‘nlh’ is non-NULL)...
lldpad-1.1.0/lldp_util.c:693:9: call_function: inlined call to ‘memset’ from ‘is_macvtap’
lldpad-1.1.0/lldp_util.c:701:29: call_function: calling ‘get_ifidx’ from ‘is_macvtap’
lldpad-1.1.0/lldp_util.c:701:29: return_function: returning to ‘is_macvtap’ from ‘get_ifidx’
lldpad-1.1.0/lldp_util.c:703:15: throw: if ‘send’ throws an exception...
lldpad-1.1.0/lldp_util.c:703:15: danger: ‘s’ leaks here
#  701|   	ifinfo->ifi_index = get_ifidx(ifname);
#  702|   
#  703|-> 	ret = send(s, nlh, nlh->nlmsg_len, 0);
#  704|   
#  705|   	if (ret < 0) {

Error: GCC_ANALYZER_WARNING (CWE-775): [#def113]
lldpad-1.1.0/lldp_util.c:748:9: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘s’
lldpad-1.1.0/lldp_util.c:681:13: acquire_resource: datagram socket created here
lldpad-1.1.0/lldp_util.c:683:12: branch_false: following ‘false’ branch (when ‘s >= 0’)...
lldpad-1.1.0/lldp_util.c:687:15: branch_false: ...to here
lldpad-1.1.0/lldp_util.c:689:12: branch_true: following ‘true’ branch (when ‘nlh’ is NULL)...
lldpad-1.1.0/lldp_util.c:690:17: branch_true: ...to here
lldpad-1.1.0/lldp_util.c:748:9: throw: if ‘close’ throws an exception...
lldpad-1.1.0/lldp_util.c:748:9: danger: ‘s’ leaks here
#  746|   	free(nlh);
#  747|   out:
#  748|-> 	close(s);
#  749|   	return false;
#  750|   }

Error: GCC_ANALYZER_WARNING (CWE-775): [#def114]
lldpad-1.1.0/lldp_util.c:972:15: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘s’
lldpad-1.1.0/lldp_util.c:942:5: enter_function: entry to ‘get_mac’
lldpad-1.1.0/lldp_util.c:950:13: acquire_resource: datagram socket created here
lldpad-1.1.0/lldp_util.c:952:12: branch_false: following ‘false’ branch (when ‘s >= 0’)...
lldpad-1.1.0/lldp_util.c:956:15: branch_false: ...to here
lldpad-1.1.0/lldp_util.c:958:12: branch_false: following ‘false’ branch (when ‘nlh’ is non-NULL)...
lldpad-1.1.0/lldp_util.c:962:9: call_function: inlined call to ‘memset’ from ‘get_mac’
lldpad-1.1.0/lldp_util.c:970:29: call_function: calling ‘get_ifidx’ from ‘get_mac’
lldpad-1.1.0/lldp_util.c:970:29: return_function: returning to ‘get_mac’ from ‘get_ifidx’
lldpad-1.1.0/lldp_util.c:972:15: throw: if ‘send’ throws an exception...
lldpad-1.1.0/lldp_util.c:972:15: danger: ‘s’ leaks here
#  970|   	ifinfo->ifi_index = get_ifidx(ifname);
#  971|   
#  972|-> 	ret = send(s, nlh, nlh->nlmsg_len, 0);
#  973|   
#  974|   	if (ret < 0) {

Error: GCC_ANALYZER_WARNING (CWE-775): [#def115]
lldpad-1.1.0/lldp_util.c:1019:9: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘s’
lldpad-1.1.0/lldp_util.c:950:13: acquire_resource: datagram socket created here
lldpad-1.1.0/lldp_util.c:952:12: branch_false: following ‘false’ branch (when ‘s >= 0’)...
lldpad-1.1.0/lldp_util.c:956:15: branch_false: ...to here
lldpad-1.1.0/lldp_util.c:958:12: branch_true: following ‘true’ branch (when ‘nlh’ is NULL)...
lldpad-1.1.0/lldp_util.c:959:17: branch_true: ...to here
lldpad-1.1.0/lldp_util.c:1019:9: throw: if ‘close’ throws an exception...
lldpad-1.1.0/lldp_util.c:1019:9: danger: ‘s’ leaks here
# 1017|   	free(nlh);
# 1018|   out:
# 1019|-> 	close(s);
# 1020|   	return 0;
# 1021|   }

Error: GCC_ANALYZER_WARNING (CWE-415): [#def116]
lldpad-1.1.0/lldp_util.c:1287:37: warning[-Wanalyzer-double-free]: double-‘free’ of ‘argvallens’
lldpad-1.1.0/lldp_util.c:1277:21: branch_true: following ‘true’ branch...
lldpad-1.1.0/lldp_util.c:1277:21: branch_true: ...to here
lldpad-1.1.0/lldp_util.c:1278:20: branch_true: following ‘true’ branch...
lldpad-1.1.0/lldp_util.c:1280:34: branch_true: ...to here
lldpad-1.1.0/lldp_util.c:1281:28: branch_false: following ‘false’ branch (when ‘p’ is non-NULL)...
lldpad-1.1.0/lldp_util.c:1287:37: branch_false: ...to here
lldpad-1.1.0/lldp_util.c:1287:37: danger: second ‘free’ here
# 1285|   				arglens = p;
# 1286|   			}
# 1287|-> 			p = (int *) realloc(argvallens,
# 1288|   				(i/NUM_ARGS + 1) * NUM_ARGS * sizeof(int));
# 1289|   			if (!p) {

Error: GCC_ANALYZER_WARNING (CWE-401): [#def117]
lldpad-1.1.0/lldpad.c:356:14: warning[-Wanalyzer-malloc-leak]: leak of ‘clifd’
lldpad-1.1.0/lldpad.c:228:5: enter_function: entry to ‘main’
lldpad-1.1.0/lldpad.c:289:12: branch_false: following ‘false’ branch...
lldpad-1.1.0/lldpad.c:292:12: branch_false: ...to here
lldpad-1.1.0/lldpad.c:292:12: branch_false: following ‘false’ branch (when ‘print_v == 0’)...
lldpad-1.1.0/lldpad.c:297:13: branch_false: ...to here
lldpad-1.1.0/lldpad.c:300:12: branch_false: following ‘false’ branch (when ‘shm_remove == 0’)...
lldpad-1.1.0/lldpad.c:305:12: branch_false: ...to here
lldpad-1.1.0/lldpad.c:305:12: branch_false: following ‘false’ branch (when ‘killme == 0’)...
lldpad-1.1.0/lldpad.c:346:9: branch_false: ...to here
lldpad-1.1.0/lldpad.c:346:9: call_function: calling ‘lldpad_oom_adjust’ from ‘main’
lldpad-1.1.0/lldpad.c:346:9: return_function: returning to ‘main’ from ‘lldpad_oom_adjust’
lldpad-1.1.0/lldpad.c:349:17: acquire_memory: allocated here
lldpad-1.1.0/lldpad.c:350:12: branch_false: following ‘false’ branch (when ‘clifd’ is non-NULL)...
lldpad-1.1.0/lldpad.c:356:14: branch_false: ...to here
lldpad-1.1.0/lldpad.c:356:14: throw: if ‘init_cfg’ throws an exception...
lldpad-1.1.0/lldpad.c:356:14: danger: ‘clifd’ leaks here; was allocated at [(15)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/14)
#  354|   
#  355|   	/* initialize lldpad configuration file */
#  356|-> 	if (!init_cfg()) {
#  357|   		LLDPAD_ERR("failed to initialize configuration file\n");
#  358|   		exit(1);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def118]
lldpad-1.1.0/lldpad.c:357:17: warning[-Wanalyzer-malloc-leak]: leak of ‘clifd’
lldpad-1.1.0/lldpad.c:289:12: branch_false: following ‘false’ branch...
lldpad-1.1.0/lldpad.c:292:12: branch_false: ...to here
lldpad-1.1.0/lldpad.c:292:12: branch_false: following ‘false’ branch (when ‘print_v == 0’)...
lldpad-1.1.0/lldpad.c:297:13: branch_false: ...to here
lldpad-1.1.0/lldpad.c:300:12: branch_false: following ‘false’ branch (when ‘shm_remove == 0’)...
lldpad-1.1.0/lldpad.c:305:12: branch_false: ...to here
lldpad-1.1.0/lldpad.c:305:12: branch_false: following ‘false’ branch (when ‘killme == 0’)...
lldpad-1.1.0/lldpad.c:346:9: branch_false: ...to here
lldpad-1.1.0/lldpad.c:349:17: acquire_memory: allocated here
lldpad-1.1.0/lldpad.c:350:12: branch_false: following ‘false’ branch (when ‘clifd’ is non-NULL)...
lldpad-1.1.0/lldpad.c:356:14: branch_false: ...to here
lldpad-1.1.0/lldpad.c:356:12: branch_true: following ‘true’ branch...
lldpad-1.1.0/lldpad.c:357:17: branch_true: ...to here
lldpad-1.1.0/lldpad.c:357:17: throw: if ‘log_message’ throws an exception...
lldpad-1.1.0/lldpad.c:357:17: danger: ‘clifd’ leaks here; was allocated at [(9)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/8)
#  355|   	/* initialize lldpad configuration file */
#  356|   	if (!init_cfg()) {
#  357|-> 		LLDPAD_ERR("failed to initialize configuration file\n");
#  358|   		exit(1);
#  359|   	}

Error: GCC_ANALYZER_WARNING (CWE-401): [#def119]
lldpad-1.1.0/lldpad.c:361:13: warning[-Wanalyzer-malloc-leak]: leak of ‘clifd’
lldpad-1.1.0/lldpad.c:289:12: branch_false: following ‘false’ branch...
lldpad-1.1.0/lldpad.c:292:12: branch_false: ...to here
lldpad-1.1.0/lldpad.c:292:12: branch_false: following ‘false’ branch (when ‘print_v == 0’)...
lldpad-1.1.0/lldpad.c:297:13: branch_false: ...to here
lldpad-1.1.0/lldpad.c:300:12: branch_false: following ‘false’ branch (when ‘shm_remove == 0’)...
lldpad-1.1.0/lldpad.c:305:12: branch_false: ...to here
lldpad-1.1.0/lldpad.c:305:12: branch_false: following ‘false’ branch (when ‘killme == 0’)...
lldpad-1.1.0/lldpad.c:346:9: branch_false: ...to here
lldpad-1.1.0/lldpad.c:349:17: acquire_memory: allocated here
lldpad-1.1.0/lldpad.c:350:12: branch_false: following ‘false’ branch (when ‘clifd’ is non-NULL)...
lldpad-1.1.0/lldpad.c:356:14: branch_false: ...to here
lldpad-1.1.0/lldpad.c:356:12: branch_false: following ‘false’ branch...
lldpad-1.1.0/lldpad.c:361:13: branch_false: ...to here
lldpad-1.1.0/lldpad.c:361:13: throw: if ‘eloop_init’ throws an exception...
lldpad-1.1.0/lldpad.c:361:13: danger: ‘clifd’ leaks here; was allocated at [(9)](sarif:/runs/0/results/2/codeFlows/0/threadFlows/0/locations/8)
#  359|   	}
#  360|   
#  361|-> 	if (eloop_init(clifd)) {
#  362|   		LLDPAD_ERR("failed to initialize event loop\n");
#  363|   		exit(1);

Error: CPPCHECK_WARNING (CWE-457): [#def120]
lldpad-1.1.0/lldptool.c:413: error[uninitvar]: Uninitialized variable: np->ops
#  411|   
#  412|   	LIST_FOREACH(np, &lldp_mod_head, lldp) {
#  413|-> 		if (np->ops->lookup_tlv_name) {
#  414|   			tlvid = np->ops->lookup_tlv_name(tlvid_str);
#  415|   			if (tlvid != INVALID_TLVID)

Error: GCC_ANALYZER_WARNING (CWE-457): [#def121]
lldpad-1.1.0/lldptool.c:469:25: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘*<unknown>’
lldpad-1.1.0/lldptool.c:729:5: enter_function: entry to ‘main’
lldpad-1.1.0/lldptool.c:768:12: branch_true: following ‘true’ branch (when ‘interactive != 0’)...
lldpad-1.1.0/lldptool.c:769:22: branch_true: ...to here
lldpad-1.1.0/lldptool.c:776:17: call_function: calling ‘cli_interactive’ from ‘main’
#  467|   		switch (c) {
#  468|   		case '?':
#  469|-> 			printf("missing argument for option %s\n\n", argv[optind-1]);
#  470|   			usage();
#  471|   			return -1;

Error: GCC_ANALYZER_WARNING (CWE-457): [#def122]
lldpad-1.1.0/lldptool.c:587:29: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘*<unknown>’
lldpad-1.1.0/lldptool.c:729:5: enter_function: entry to ‘main’
lldpad-1.1.0/lldptool.c:768:12: branch_true: following ‘true’ branch (when ‘interactive != 0’)...
lldpad-1.1.0/lldptool.c:769:22: branch_true: ...to here
lldpad-1.1.0/lldptool.c:776:17: call_function: calling ‘cli_interactive’ from ‘main’
#  585|   		cmd = cli_commands;
#  586|   		while (cmd->cmdcode != cmd_nop) {
#  587|-> 			if (strncasecmp(cmd->cmdstr, argv[optind],
#  588|   			    strlen(argv[optind])) == 0) {
#  589|   				match = cmd;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def123]
lldpad-1.1.0/lldptool_cmds.c:407:19: warning[-Wanalyzer-malloc-leak]: leak of ‘args’
lldpad-1.1.0/lldptool_cmds.c:397:16: acquire_memory: allocated here
lldpad-1.1.0/lldptool_cmds.c:398:12: branch_false: following ‘false’ branch (when ‘args’ is non-NULL)...
lldpad-1.1.0/lldptool_cmds.c:401:19: branch_false: ...to here
lldpad-1.1.0/lldptool_cmds.c:402:12: branch_false: following ‘false’ branch (when ‘argvals’ is non-NULL)...
lldpad-1.1.0/lldptool_cmds.c:407:19: branch_false: ...to here
lldpad-1.1.0/lldptool_cmds.c:407:19: throw: if ‘get_arg_val_list’ throws an exception...
lldpad-1.1.0/lldptool_cmds.c:407:19: danger: ‘args’ leaks here; was allocated at [(1)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/0)
#  405|   	}
#  406|   
#  407|-> 	numargs = get_arg_val_list(ibuf, ilen, &ioff, args, argvals);
#  408|   
#  409|   	for (i = 0; i < numargs; i++) {

Error: GCC_ANALYZER_WARNING (CWE-401): [#def124]
lldpad-1.1.0/lldptool_cmds.c:407:19: warning[-Wanalyzer-malloc-leak]: leak of ‘argvals’
lldpad-1.1.0/lldptool_cmds.c:398:12: branch_false: following ‘false’ branch (when ‘args’ is non-NULL)...
lldpad-1.1.0/lldptool_cmds.c:401:19: branch_false: ...to here
lldpad-1.1.0/lldptool_cmds.c:401:19: acquire_memory: allocated here
lldpad-1.1.0/lldptool_cmds.c:402:12: branch_false: following ‘false’ branch (when ‘argvals’ is non-NULL)...
lldpad-1.1.0/lldptool_cmds.c:407:19: branch_false: ...to here
lldpad-1.1.0/lldptool_cmds.c:407:19: throw: if ‘get_arg_val_list’ throws an exception...
lldpad-1.1.0/lldptool_cmds.c:407:19: danger: ‘argvals’ leaks here; was allocated at [(3)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/2)
#  405|   	}
#  406|   
#  407|-> 	numargs = get_arg_val_list(ibuf, ilen, &ioff, args, argvals);
#  408|   
#  409|   	for (i = 0; i < numargs; i++) {

Error: GCC_ANALYZER_WARNING (CWE-401): [#def125]
lldpad-1.1.0/parse_cli.c:2303:54: warning[-Wanalyzer-malloc-leak]: leak of ‘malloc(64)’
lldpad-1.1.0/parse_cli.c:2290:21: enter_function: entry to ‘yy_create_buffer’
lldpad-1.1.0/parse_cli.c:2294:24: call_function: inlined call to ‘yyalloc’ from ‘yy_create_buffer’
lldpad-1.1.0/parse_cli.c:2295:12: branch_false: following ‘false’ branch...
lldpad-1.1.0/parse_cli.c:2298:2: branch_false: ...to here
lldpad-1.1.0/parse_cli.c:2303:54: danger: ‘malloc(64)’ leaks here; was allocated at [(3)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/2)
# 2301|   	/* yy_ch_buf has to be 2 characters longer than the size given because
# 2302|   	 * we need to put in 2 end-of-buffer characters.
# 2303|-> 	 */
# 2304|   	b->yy_ch_buf = (char *) yyalloc( (yy_size_t) (b->yy_buf_size + 2)  );
# 2305|   	if ( ! b->yy_ch_buf )

Error: CPPCHECK_WARNING (CWE-476): [#def126]
lldpad-1.1.0/parse_cli.c:2344: warning[nullPointer]: Possible null pointer dereference: b
# 2342|       
# 2343|   	yy_flush_buffer( b );
# 2344|-> 
# 2345|   	b->yy_input_file = file;
# 2346|   	b->yy_fill_buffer = 1;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def127]
lldpad-1.1.0/parse_cli.c:2344:2: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘b’
lldpad-1.1.0/parse_cli.c:2228:10: enter_function: entry to ‘yyrestart’
lldpad-1.1.0/parse_cli.c:2232:16: call_function: calling ‘yyensure_buffer_stack’ from ‘yyrestart’
lldpad-1.1.0/parse_cli.c:2232:16: return_function: returning to ‘yyrestart’ from ‘yyensure_buffer_stack’
lldpad-1.1.0/parse_cli.c:2234:27: call_function: calling ‘yy_create_buffer’ from ‘yyrestart’
lldpad-1.1.0/parse_cli.c:2234:27: return_function: returning to ‘yyrestart’ from ‘yy_create_buffer’
lldpad-1.1.0/parse_cli.c:2237:2: branch_false: following ‘false’ branch...
lldpad-1.1.0/parse_cli.c:2237:2: branch_false: ...to here
lldpad-1.1.0/parse_cli.c:2237:2: call_function: calling ‘yy_init_buffer’ from ‘yyrestart’
# 2342|       
# 2343|   	yy_flush_buffer( b );
# 2344|-> 
# 2345|   	b->yy_input_file = file;
# 2346|   	b->yy_fill_buffer = 1;

Error: CPPCHECK_WARNING (CWE-476): [#def128]
lldpad-1.1.0/parse_cli.c:2345: warning[nullPointer]: Possible null pointer dereference: b
# 2343|   	yy_flush_buffer( b );
# 2344|   
# 2345|-> 	b->yy_input_file = file;
# 2346|   	b->yy_fill_buffer = 1;
# 2347|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def129]
lldpad-1.1.0/parse_cli.c:2558:26: warning[-Wanalyzer-malloc-leak]: leak of ‘malloc(n)’
lldpad-1.1.0/parse_cli.c:2542:17: enter_function: entry to ‘yy_scan_bytes’
lldpad-1.1.0/parse_cli.c:2551:24: call_function: inlined call to ‘yyalloc’ from ‘yy_scan_bytes’
lldpad-1.1.0/parse_cli.c:2552:12: branch_false: following ‘false’ branch...
lldpad-1.1.0/parse_cli.c:2552:12: branch_false: ...to here
lldpad-1.1.0/parse_cli.c:2560:6: call_function: calling ‘yy_scan_buffer’ from ‘yy_scan_bytes’
# 2556|   	for ( i = 0; i < _yybytes_len; ++i )
# 2557|   		buf[i] = yybytes[i];
# 2558|-> 
# 2559|   	buf[_yybytes_len] = buf[_yybytes_len+1] = YY_END_OF_BUFFER_CHAR;
# 2560|   

Error: CPPCHECK_WARNING (CWE-457): [#def130]
lldpad-1.1.0/qbg/ecp.c:286: error[uninitvar]: Uninitialized variable: p->localChange
#  284|   	LIST_FOREACH(p, &vd->profile_head, profile) {
#  285|   
#  286|-> 		if (!p->localChange) {
#  287|   			LLDPAD_DBG("%s:%s skipping unchanged profile\n",
#  288|   				   __func__, vd->ecp.ifname);

Error: GCC_ANALYZER_WARNING (CWE-416): [#def131]
lldpad-1.1.0/qbg/ecp22.c:825:9: warning[-Wanalyzer-use-after-free]: use after ‘free’ of ‘ecp’
lldpad-1.1.0/qbg/ecp22.c:1054:6: enter_function: entry to ‘ecp22_unregister’
lldpad-1.1.0/qbg/ecp22.c:1056:12: branch_true: following ‘true’ branch...
lldpad-1.1.0/qbg/ecp22.c:1057:17: branch_true: ...to here
lldpad-1.1.0/qbg/ecp22.c:1057:17: call_function: calling ‘ecp22_free_data’ from ‘ecp22_unregister’
#  823|   	ecp->isfree.freecnt = 0;
#  824|   	LIST_REMOVE(ecp, node);
#  825|-> 	l2_packet_deinit(ecp->l2);
#  826|   	free(ecp);
#  827|   }

Error: GCC_ANALYZER_WARNING (CWE-401): [#def132]
lldpad-1.1.0/qbg/ecp22.c:1028:9: warning[-Wanalyzer-malloc-leak]: leak of ‘eud’
lldpad-1.1.0/qbg/ecp22.c:1014:12: branch_false: following ‘false’ branch (when ‘mod’ is non-NULL)...
lldpad-1.1.0/qbg/ecp22.c:1018:15: branch_false: ...to here
lldpad-1.1.0/qbg/ecp22.c:1018:15: acquire_memory: allocated here
lldpad-1.1.0/qbg/ecp22.c:1019:12: branch_false: following ‘false’ branch (when ‘eud’ is non-NULL)...
lldpad-1.1.0/qbg/ecp22.c:1025:9: branch_false: ...to here
lldpad-1.1.0/qbg/ecp22.c:1028:9: throw: if ‘log_message’ throws an exception...
lldpad-1.1.0/qbg/ecp22.c:1028:9: danger: ‘eud’ leaks here; was allocated at [(3)](sarif:/runs/0/results/2/codeFlows/0/threadFlows/0/locations/2)
# 1026|   	mod->ops = &ecp22_ops;
# 1027|   	mod->data = eud;
# 1028|-> 	LLDPAD_DBG("%s: done\n", __func__);
# 1029|   	return mod;
# 1030|   }

Error: GCC_ANALYZER_WARNING (CWE-401): [#def133]
lldpad-1.1.0/qbg/ecp22.c:1028:9: warning[-Wanalyzer-malloc-leak]: leak of ‘mod’
lldpad-1.1.0/qbg/ecp22.c:1013:15: acquire_memory: allocated here
lldpad-1.1.0/qbg/ecp22.c:1014:12: branch_false: following ‘false’ branch (when ‘mod’ is non-NULL)...
lldpad-1.1.0/qbg/ecp22.c:1018:15: branch_false: ...to here
lldpad-1.1.0/qbg/ecp22.c:1019:12: branch_false: following ‘false’ branch (when ‘eud’ is non-NULL)...
lldpad-1.1.0/qbg/ecp22.c:1025:9: branch_false: ...to here
lldpad-1.1.0/qbg/ecp22.c:1028:9: throw: if ‘log_message’ throws an exception...
lldpad-1.1.0/qbg/ecp22.c:1028:9: danger: ‘mod’ leaks here; was allocated at [(1)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/0)
# 1026|   	mod->ops = &ecp22_ops;
# 1027|   	mod->data = eud;
# 1028|-> 	LLDPAD_DBG("%s: done\n", __func__);
# 1029|   	return mod;
# 1030|   }

Error: CPPCHECK_WARNING (CWE-457): [#def134]
lldpad-1.1.0/qbg/vdp.c:173: error[uninitvar]: Uninitialized variables: p.mode, p.response, p.no_nlmsg, p.mgrid, p.id, p.version, p.format, p.entries, p.port, p.ackTimer, p.ackReceived, p.keepaliveTimer, p.state, p.seqnr, p.localChange, p.remoteChange, p.txmit
#  171|   
#  172|   	LIST_FOREACH(p, &vd->profile_head, profile) {
#  173|-> 		if (vdp_profile_equal(p, thisone))
#  174|   			return p;
#  175|   	}

Error: GCC_ANALYZER_WARNING (CWE-416): [#def135]
lldpad-1.1.0/qbg/vdp.c:211:17: warning[-Wanalyzer-use-after-free]: use after ‘free’ of ‘vd’
lldpad-1.1.0/qbg/vdp.c:1714:6: enter_function: entry to ‘vdp_unregister’
lldpad-1.1.0/qbg/vdp.c:1716:12: branch_true: following ‘true’ branch...
lldpad-1.1.0/qbg/vdp.c:1717:17: branch_true: ...to here
lldpad-1.1.0/qbg/vdp.c:1717:17: call_function: calling ‘vdp_free_data’ from ‘vdp_unregister’
#  209|   {
#  210|   	if (vd) {
#  211|-> 		FREE_UNPKD_TLV(vd, vdp);
#  212|   	}
#  213|   }

Error: CPPCHECK_WARNING (CWE-457): [#def136]
lldpad-1.1.0/qbg/vdp.c:270: error[uninitvar]: Uninitialized variable: p->seqnr
#  268|   
#  269|   	LIST_FOREACH(p, &vd->profile_head, profile) {
#  270|-> 		if (p->seqnr == seqnr) {
#  271|   			p->ackReceived = false;
#  272|   			p->txmit = true;

Error: CPPCHECK_WARNING (CWE-457): [#def137]
lldpad-1.1.0/qbg/vdp.c:316: error[uninitvar]: Uninitialized variable: p->localChange
#  314|   
#  315|   	LIST_FOREACH(p, &vd->profile_head, profile) {
#  316|-> 		if (p->localChange && (p->txmit == false))
#  317|   			count++;
#  318|   	}

Error: CPPCHECK_WARNING (CWE-457): [#def138]
lldpad-1.1.0/qbg/vdp.c:816: error[uninitvar]: Uninitialized variables: p.mode, p.response, p.no_nlmsg, p.mgrid, p.id, p.version, p.format, p.entries, p.port, p.ackTimer, p.keepaliveTimer, p.seqnr, p.localChange, p.remoteChange, p.txmit
#  814|   			   p->ackReceived);
#  815|   		if (p->ackReceived) {
#  816|-> 			vdp_vsi_sm_station(p);
#  817|   			p->ackReceived = false;
#  818|   		}

Error: GCC_ANALYZER_WARNING (CWE-401): [#def139]
lldpad-1.1.0/qbg/vdp.c:1703:9: warning[-Wanalyzer-malloc-leak]: leak of ‘mod’
lldpad-1.1.0/qbg/vdp.c:1688:15: acquire_memory: allocated here
lldpad-1.1.0/qbg/vdp.c:1689:12: branch_false: following ‘false’ branch (when ‘mod’ is non-NULL)...
lldpad-1.1.0/qbg/vdp.c:1693:14: branch_false: ...to here
lldpad-1.1.0/qbg/vdp.c:1694:12: branch_false: following ‘false’ branch (when ‘ud’ is non-NULL)...
lldpad-1.1.0/qbg/vdp.c:1699:9: branch_false: ...to here
lldpad-1.1.0/qbg/vdp.c:1703:9: throw: if ‘log_message’ throws an exception...
lldpad-1.1.0/qbg/vdp.c:1703:9: danger: ‘mod’ leaks here; was allocated at [(1)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/0)
# 1701|   	mod->ops = &vdp_ops;
# 1702|   	mod->data = ud;
# 1703|-> 	LLDPAD_DBG("%s: done\n", __func__);
# 1704|   	return mod;
# 1705|   }

Error: GCC_ANALYZER_WARNING (CWE-401): [#def140]
lldpad-1.1.0/qbg/vdp.c:1703:9: warning[-Wanalyzer-malloc-leak]: leak of ‘ud’
lldpad-1.1.0/qbg/vdp.c:1689:12: branch_false: following ‘false’ branch (when ‘mod’ is non-NULL)...
lldpad-1.1.0/qbg/vdp.c:1693:14: branch_false: ...to here
lldpad-1.1.0/qbg/vdp.c:1693:14: acquire_memory: allocated here
lldpad-1.1.0/qbg/vdp.c:1694:12: branch_false: following ‘false’ branch (when ‘ud’ is non-NULL)...
lldpad-1.1.0/qbg/vdp.c:1699:9: branch_false: ...to here
lldpad-1.1.0/qbg/vdp.c:1703:9: throw: if ‘log_message’ throws an exception...
lldpad-1.1.0/qbg/vdp.c:1703:9: danger: ‘ud’ leaks here; was allocated at [(3)](sarif:/runs/0/results/2/codeFlows/0/threadFlows/0/locations/2)
# 1701|   	mod->ops = &vdp_ops;
# 1702|   	mod->data = ud;
# 1703|-> 	LLDPAD_DBG("%s: done\n", __func__);
# 1704|   	return mod;
# 1705|   }

Error: CPPCHECK_WARNING (CWE-457): [#def141]
lldpad-1.1.0/qbg/vdp.c:1834: error[uninitvar]: Uninitialized variables: p.mode, p.response, p.no_nlmsg, p.mgrid, p.id, p.version, p.format, p.entries, p.port, p.ackTimer, p.ackReceived, p.keepaliveTimer, p.state, p.seqnr, p.localChange, p.remoteChange, p.txmit
# 1832|   	}
# 1833|   	if (ret) {
# 1834|-> 		vdp_trace_profile(p);
# 1835|   		vsi->macsz = 0;
# 1836|   		vsi->response = p->response;

Error: CPPCHECK_WARNING (CWE-457): [#def142]
lldpad-1.1.0/qbg/vdp.c:1854: error[uninitvar]: Uninitialized variable: mv1->vlan
# 1852|   
# 1853|   	LIST_FOREACH(mv1, &p->macvid_head, entry) {
# 1854|-> 		macp->vlan = mv1->vlan;
# 1855|   		macp->qos =  mv1->qos;
# 1856|   		memcpy(macp->mac, mv1->mac, sizeof macp->mac);

Error: CPPCHECK_WARNING (CWE-119): [#def143]
lldpad-1.1.0/qbg/vdp.c:1890: error[bufferAccessOutOfBounds]: Buffer is accessed out of bounds: profile->port->ifname
# 1888|   		goto error_exit;
# 1889|   	}
# 1890|-> 	memcpy(vsi.ifname, profile->port->ifname, sizeof vsi.ifname);
# 1891|   	vd = vdp_data(vsi.ifname);
# 1892|   	if (!vd) {

Error: COMPILER_WARNING: [#def144]
lldpad-1.1.0/qbg/vdp22.c: scope_hint: In function ‘vdp22_showvsi’
lldpad-1.1.0/qbg/vdp22.c:186:17: warning[-Wstringop-truncation]: ‘strncpy’ specified bound 42 equals destination size
#  186 |                 strncpy(buf, (char *)p->mgrid, len);
#      |                 ^
#  184|   	}
#  185|   	if (print)
#  186|-> 		strncpy(buf, (char *)p->mgrid, len);
#  187|   	else
#  188|   		vdp22_local2str(p->mgrid, buf, len);

Error: CPPCHECK_WARNING (CWE-457): [#def145]
lldpad-1.1.0/qbg/vdp22.c:809: error[uninitvar]: Uninitialized variables: vsi.cc_vsi_mode, vsi.vsi_mode, vsi.resp_vsi_mode, vsi.status, vsi.hints, vsi.type_id, vsi.type_ver, vsi.vsi_fmt, vsi.fif, vsi.no_fdata, vsi.fdata, vsi.no_ouidata, vsi.oui_str_data, vsi.vdp, vsi.flags, vsi.smi
#  807|   
#  808|   	LIST_FOREACH(vsi, &vdp->vsi22_que, node) {
#  809|-> 		vdp22_stop_timers(vsi);
#  810|   	}
#  811|   }

Error: CPPCHECK_WARNING (CWE-457): [#def146]
lldpad-1.1.0/qbg/vdp22.c:889: error[uninitvar]: Uninitialized variables: vsi.cc_vsi_mode, vsi.vsi_mode, vsi.resp_vsi_mode, vsi.status, vsi.hints, vsi.type_id, vsi.type_ver, vsi.vsi_fmt, vsi.fif, vsi.no_fdata, vsi.fdata, vsi.no_ouidata, vsi.oui_str_data, vsi.vdp, vsi.flags
#  887|   		LIST_FOREACH(vsi, &vdp->vsi22_que, node) {
#  888|   			vsi->smi.localchg = true;
#  889|-> 			vdp22_showvsi(vsi);
#  890|   			vdp22_start_localchange_timer(vsi);
#  891|   		}

Error: GCC_ANALYZER_WARNING (CWE-401): [#def147]
lldpad-1.1.0/qbg/vdp22.c:990:9: warning[-Wanalyzer-malloc-leak]: leak of ‘mod’
lldpad-1.1.0/qbg/vdp22.c:975:15: acquire_memory: allocated here
lldpad-1.1.0/qbg/vdp22.c:976:12: branch_false: following ‘false’ branch (when ‘mod’ is non-NULL)...
lldpad-1.1.0/qbg/vdp22.c:980:14: branch_false: ...to here
lldpad-1.1.0/qbg/vdp22.c:981:12: branch_false: following ‘false’ branch (when ‘ud’ is non-NULL)...
lldpad-1.1.0/qbg/vdp22.c:987:9: branch_false: ...to here
lldpad-1.1.0/qbg/vdp22.c:990:9: throw: if ‘log_message’ throws an exception...
lldpad-1.1.0/qbg/vdp22.c:990:9: danger: ‘mod’ leaks here; was allocated at [(1)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/0)
#  988|   	mod->ops = &vdp22_ops;
#  989|   	mod->data = ud;
#  990|-> 	LLDPAD_DBG("%s:done\n", __func__);
#  991|   	return mod;
#  992|   }

Error: GCC_ANALYZER_WARNING (CWE-401): [#def148]
lldpad-1.1.0/qbg/vdp22.c:990:9: warning[-Wanalyzer-malloc-leak]: leak of ‘ud’
lldpad-1.1.0/qbg/vdp22.c:976:12: branch_false: following ‘false’ branch (when ‘mod’ is non-NULL)...
lldpad-1.1.0/qbg/vdp22.c:980:14: branch_false: ...to here
lldpad-1.1.0/qbg/vdp22.c:980:14: acquire_memory: allocated here
lldpad-1.1.0/qbg/vdp22.c:981:12: branch_false: following ‘false’ branch (when ‘ud’ is non-NULL)...
lldpad-1.1.0/qbg/vdp22.c:987:9: branch_false: ...to here
lldpad-1.1.0/qbg/vdp22.c:990:9: throw: if ‘log_message’ throws an exception...
lldpad-1.1.0/qbg/vdp22.c:990:9: danger: ‘ud’ leaks here; was allocated at [(3)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/2)
#  988|   	mod->ops = &vdp22_ops;
#  989|   	mod->data = ud;
#  990|-> 	LLDPAD_DBG("%s:done\n", __func__);
#  991|   	return mod;
#  992|   }

Error: CPPCHECK_WARNING (CWE-457): [#def149]
lldpad-1.1.0/qbg/vdp22.c:1102: error[uninitvar]: Uninitialized variables: p.cc_vsi_mode, p.vsi_mode, p.resp_vsi_mode, p.status, p.hints, p.type_id, p.type_ver, p.vsi_fmt, p.fif, p.no_fdata, p.fdata, p.no_ouidata, p.oui_str_data, p.vdp, p.flags, p.smi
# 1100|   	}
# 1101|   	if (ret) {
# 1102|-> 		vdp22_showvsi(p);
# 1103|   		copy_vsi(vsi, p, clif);
# 1104|   		if (vsi->response != VDP22_RESP_NONE &&

Error: CPPCHECK_WARNING (CWE-457): [#def150]
lldpad-1.1.0/qbg/vdp22sm.c:963: error[uninitvar]: Uninitialized variables: p.cc_vsi_mode, p.vsi_mode, p.resp_vsi_mode, p.status, p.hints, p.type_id, p.type_ver, p.vsi_fmt, p.fif, p.no_fdata, p.fdata, p.no_ouidata, p.oui_str_data, p.vdp, p.flags, p.smi
#  961|   
#  962|   	LIST_FOREACH(p, &vdp->vsi22_que, node) {
#  963|-> 		if (vdp22_vsi_equal(p, me))
#  964|   			return p;
#  965|   	}

Error: CPPCHECK_WARNING (CWE-562): [#def151]
lldpad-1.1.0/qbg/vdp22sm.c:1285: error[autoVariables]: Address of local auto-variable assigned to a function parameter.
# 1283|   		struct fid22 fid[vsip->no_fdata];
# 1284|   
# 1285|-> 		vsip->fdata = fid;
# 1286|   		for (i = 0; i < vsip->no_fdata; ++i)
# 1287|   			offset += ptlv_2_fdata(&fid[i], cp + offset, vsip->fif);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def152]
lldpad-1.1.0/qbg/vdp_ascii.c:357:19: warning[-Wanalyzer-malloc-leak]: leak of ‘argvalue’
lldpad-1.1.0/qbg/vdp_ascii.c:458:12: enter_function: entry to ‘str2vdpnl’
lldpad-1.1.0/qbg/vdp_ascii.c:464:14: call_function: calling ‘vdp22_parse_str_vdpnl’ from ‘str2vdpnl’
#  355|   		goto out;
#  356|   	/* Count args and argvalues */
#  357|-> 	numargs = get_vsistr_arg_count(ioff, ilen);
#  358|   	if (numargs == 0)
#  359|   		goto out_argvalue;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def153]
lldpad-1.1.0/qbg/vdp_ascii.c:366:19: warning[-Wanalyzer-malloc-leak]: leak of ‘args’
lldpad-1.1.0/qbg/vdp_ascii.c:458:12: enter_function: entry to ‘str2vdpnl’
lldpad-1.1.0/qbg/vdp_ascii.c:464:14: call_function: calling ‘vdp22_parse_str_vdpnl’ from ‘str2vdpnl’
#  364|   	if (!argvals)
#  365|   		goto out_args;
#  366|-> 	numargs = get_arg_val_list(argvalue, ilen, &ioff, args, argvals);
#  367|   	if (numargs == 0)
#  368|   		goto out_free;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def154]
lldpad-1.1.0/qbg/vdp_ascii.c:366:19: warning[-Wanalyzer-malloc-leak]: leak of ‘argvals’
lldpad-1.1.0/qbg/vdp_ascii.c:458:12: enter_function: entry to ‘str2vdpnl’
lldpad-1.1.0/qbg/vdp_ascii.c:464:14: call_function: calling ‘vdp22_parse_str_vdpnl’ from ‘str2vdpnl’
#  364|   	if (!argvals)
#  365|   		goto out_args;
#  366|-> 	numargs = get_arg_val_list(argvalue, ilen, &ioff, args, argvals);
#  367|   	if (numargs == 0)
#  368|   		goto out_free;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def155]
lldpad-1.1.0/qbg/vdp_ascii.c:366:19: warning[-Wanalyzer-malloc-leak]: leak of ‘argvalue’
lldpad-1.1.0/qbg/vdp_ascii.c:458:12: enter_function: entry to ‘str2vdpnl’
lldpad-1.1.0/qbg/vdp_ascii.c:464:14: call_function: calling ‘vdp22_parse_str_vdpnl’ from ‘str2vdpnl’
#  364|   	if (!argvals)
#  365|   		goto out_args;
#  366|-> 	numargs = get_arg_val_list(argvalue, ilen, &ioff, args, argvals);
#  367|   	if (numargs == 0)
#  368|   		goto out_free;

Error: CPPCHECK_WARNING (CWE-457): [#def156]
lldpad-1.1.0/qbg/vdp_cmds.c:80: error[uninitvar]: Uninitialized variable: mac_vlan->vlan
#   78|   
#   79|   		mac2str(mac_vlan->mac, macbuf, MAC_ADDR_STRLEN);
#   80|-> 		c = snprintf(s, length, ",%s,%d", macbuf, mac_vlan->vlan);
#   81|   		s = check_and_update(&total, &length, s, c);
#   82|   		if (!s)

Error: CPPCHECK_WARNING (CWE-457): [#def157]
lldpad-1.1.0/qbg/vdp_cmds.c:207: error[uninitvar]: Uninitialized variables: np.mode, np.response, np.no_nlmsg, np.mgrid, np.id, np.version, np.format, np.entries, np.port, np.ackTimer, np.ackReceived, np.keepaliveTimer, np.state, np.seqnr, np.localChange, np.remoteChange, np.txmit
#  205|   	memset(mode_str, 0, sizeof mode_str);
#  206|   	LIST_FOREACH(np, &vd->profile_head, profile) {
#  207|-> 		t = print_mode(t, sizeof(mode_str) - filled, np);
#  208|   		filled = t - mode_str;
#  209|   	}

Error: GCC_ANALYZER_WARNING (CWE-401): [#def158]
lldpad-1.1.0/qbg/vdp_cmds.c:235:9: warning[-Wanalyzer-malloc-leak]: leak of ‘cmdstring’
lldpad-1.1.0/qbg/vdp_cmds.c:262:28: enter_function: entry to ‘vdp_parse_mode_line’
lldpad-1.1.0/qbg/vdp_cmds.c:269:12: branch_false: following ‘false’ branch...
lldpad-1.1.0/qbg/vdp_cmds.c:272:21: branch_false: ...to here
lldpad-1.1.0/qbg/vdp_cmds.c:272:21: acquire_memory: allocated here
lldpad-1.1.0/qbg/vdp_cmds.c:273:12: branch_false: following ‘false’ branch (when ‘cmdstring’ is non-NULL)...
lldpad-1.1.0/qbg/vdp_cmds.c:278:18: branch_false: ...to here
lldpad-1.1.0/qbg/vdp_cmds.c:280:16: branch_true: following ‘true’ branch (when ‘parsed’ is non-NULL)...
lldpad-1.1.0/qbg/vdp_cmds.c:281:17: branch_true: ...to here
lldpad-1.1.0/qbg/vdp_cmds.c:281:17: call_function: calling ‘vdp_fill_profile’ from ‘vdp_parse_mode_line’
#  233|   			     int field)
#  234|   {
#  235|-> 	LLDPAD_DBG("%s: parsed %s\n", __func__, buffer);
#  236|   
#  237|   	switch(field) {

Error: GCC_ANALYZER_WARNING (CWE-401): [#def159]
lldpad-1.1.0/qbg/vdp_cmds.c:300:21: warning[-Wanalyzer-malloc-leak]: leak of ‘mac_vlan’
lldpad-1.1.0/qbg/vdp_cmds.c:326:12: enter_function: entry to ‘_set_arg_mode’
lldpad-1.1.0/qbg/vdp_cmds.c:335:19: call_function: calling ‘vdp_parse_mode_line’ from ‘_set_arg_mode’
#  298|   			goto out_free;
#  299|   
#  300|-> 		if (str2mac(parsed, &mac_vlan->mac[0], MAC_ADDR_LEN)) {
#  301|   			free(mac_vlan);
#  302|   			goto out_free;

Error: CPPCHECK_WARNING (CWE-401): [#def160]
lldpad-1.1.0/tlv_dcbx.c:740: error[memleakOnRealloc]: Common realloc mistake: 'app_info' nulled but not freed upon failure
#  738|   			}
#  739|   			tlv->length += DCBX2_APP_SIZE;
#  740|-> 			app_info = realloc(app_info, tlv->length);
#  741|   			if (!app_info) {
#  742|   				free(app_info);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def161]
lldpad-1.1.0/vdptool.c:203:32: warning[-Wanalyzer-malloc-leak]: leak of ‘args’
lldpad-1.1.0/vdptool.c:333:12: enter_function: entry to ‘vdp_cmd_getvsi’
lldpad-1.1.0/vdptool.c:344:16: acquire_memory: allocated here
lldpad-1.1.0/vdptool.c:345:12: branch_false: following ‘false’ branch (when ‘args’ is non-NULL)...
lldpad-1.1.0/vdptool.c:348:19: branch_false: ...to here
lldpad-1.1.0/vdptool.c:349:12: branch_false: following ‘false’ branch (when ‘argvals’ is non-NULL)...
lldpad-1.1.0/vdptool.c:349:12: branch_false: ...to here
lldpad-1.1.0/vdptool.c:354:21: branch_true: following ‘true’ branch (when ‘argc > i’)...
lldpad-1.1.0/vdptool.c:355:58: branch_true: ...to here
lldpad-1.1.0/vdptool.c:355:17: call_function: calling ‘get_arg_value’ from ‘vdp_cmd_getvsi’
lldpad-1.1.0/vdptool.c:355:17: return_function: returning to ‘vdp_cmd_getvsi’ from ‘get_arg_value’
lldpad-1.1.0/vdptool.c:364:20: branch_false: following ‘false’ branch...
lldpad-1.1.0/vdptool.c:370:21: branch_false: ...to here
lldpad-1.1.0/vdptool.c:370:20: branch_false: following ‘false’ branch...
lldpad-1.1.0/vdptool.c:374:26: branch_false: ...to here
lldpad-1.1.0/vdptool.c:377:9: call_function: calling ‘render_cmd’ from ‘vdp_cmd_getvsi’
#  201|   				return false;
#  202|   			dst = oui_data->data + len;
#  203|-> 			return oui_hndlr_tbl[cnt].oui_cli_encode_hndlr(dst,
#  204|   								argvals, len);
#  205|   		}

Error: GCC_ANALYZER_WARNING (CWE-401): [#def162]
lldpad-1.1.0/vdptool.c:203:32: warning[-Wanalyzer-malloc-leak]: leak of ‘argvals’
lldpad-1.1.0/vdptool.c:333:12: enter_function: entry to ‘vdp_cmd_getvsi’
lldpad-1.1.0/vdptool.c:345:12: branch_false: following ‘false’ branch (when ‘args’ is non-NULL)...
lldpad-1.1.0/vdptool.c:348:19: branch_false: ...to here
lldpad-1.1.0/vdptool.c:348:19: acquire_memory: allocated here
lldpad-1.1.0/vdptool.c:349:12: branch_false: following ‘false’ branch (when ‘argvals’ is non-NULL)...
lldpad-1.1.0/vdptool.c:349:12: branch_false: ...to here
lldpad-1.1.0/vdptool.c:354:21: branch_true: following ‘true’ branch (when ‘argc > i’)...
lldpad-1.1.0/vdptool.c:355:58: branch_true: ...to here
lldpad-1.1.0/vdptool.c:355:17: call_function: calling ‘get_arg_value’ from ‘vdp_cmd_getvsi’
lldpad-1.1.0/vdptool.c:355:17: return_function: returning to ‘vdp_cmd_getvsi’ from ‘get_arg_value’
lldpad-1.1.0/vdptool.c:364:20: branch_false: following ‘false’ branch...
lldpad-1.1.0/vdptool.c:370:21: branch_false: ...to here
lldpad-1.1.0/vdptool.c:370:20: branch_false: following ‘false’ branch...
lldpad-1.1.0/vdptool.c:374:26: branch_false: ...to here
lldpad-1.1.0/vdptool.c:377:9: call_function: calling ‘render_cmd’ from ‘vdp_cmd_getvsi’
#  201|   				return false;
#  202|   			dst = oui_data->data + len;
#  203|-> 			return oui_hndlr_tbl[cnt].oui_cli_encode_hndlr(dst,
#  204|   								argvals, len);
#  205|   		}

Error: GCC_ANALYZER_WARNING (CWE-401): [#def163]
lldpad-1.1.0/vdptool.c:203:32: warning[-Wanalyzer-malloc-leak]: leak of ‘oui_data’
lldpad-1.1.0/vdptool.c:333:12: enter_function: entry to ‘vdp_cmd_getvsi’
lldpad-1.1.0/vdptool.c:345:12: branch_false: following ‘false’ branch (when ‘args’ is non-NULL)...
lldpad-1.1.0/vdptool.c:348:19: branch_false: ...to here
lldpad-1.1.0/vdptool.c:349:12: branch_false: following ‘false’ branch (when ‘argvals’ is non-NULL)...
lldpad-1.1.0/vdptool.c:349:12: branch_false: ...to here
lldpad-1.1.0/vdptool.c:354:21: branch_true: following ‘true’ branch (when ‘argc > i’)...
lldpad-1.1.0/vdptool.c:355:58: branch_true: ...to here
lldpad-1.1.0/vdptool.c:355:17: call_function: calling ‘get_arg_value’ from ‘vdp_cmd_getvsi’
lldpad-1.1.0/vdptool.c:355:17: return_function: returning to ‘vdp_cmd_getvsi’ from ‘get_arg_value’
lldpad-1.1.0/vdptool.c:364:20: branch_false: following ‘false’ branch...
lldpad-1.1.0/vdptool.c:370:21: branch_false: ...to here
lldpad-1.1.0/vdptool.c:370:20: branch_false: following ‘false’ branch...
lldpad-1.1.0/vdptool.c:374:26: branch_false: ...to here
lldpad-1.1.0/vdptool.c:377:9: call_function: calling ‘render_cmd’ from ‘vdp_cmd_getvsi’
#  201|   				return false;
#  202|   			dst = oui_data->data + len;
#  203|-> 			return oui_hndlr_tbl[cnt].oui_cli_encode_hndlr(dst,
#  204|   								argvals, len);
#  205|   		}

Error: GCC_ANALYZER_WARNING (CWE-401): [#def164]
lldpad-1.1.0/vdptool.c:580:19: warning[-Wanalyzer-malloc-leak]: leak of ‘args’
lldpad-1.1.0/vdptool.c:387:12: enter_function: entry to ‘vdp_cmd_setvsi’
lldpad-1.1.0/vdptool.c:397:16: acquire_memory: allocated here
lldpad-1.1.0/vdptool.c:398:12: branch_false: following ‘false’ branch (when ‘args’ is non-NULL)...
lldpad-1.1.0/vdptool.c:401:19: branch_false: ...to here
lldpad-1.1.0/vdptool.c:402:12: branch_false: following ‘false’ branch (when ‘argvals’ is non-NULL)...
lldpad-1.1.0/vdptool.c:402:12: branch_false: ...to here
lldpad-1.1.0/vdptool.c:424:16: call_function: inlined call to ‘vdp_clif_command’ from ‘vdp_cmd_setvsi’
#  578|   	}
#  579|   
#  580|-> 	numargs = get_arg_val_list(ibuf, ilen, &ioff, args, argvals);
#  581|   	print_vsi(args, argvals, numargs, print_err_code);
#  582|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def165]
lldpad-1.1.0/vdptool.c:580:19: warning[-Wanalyzer-malloc-leak]: leak of ‘argvals’
lldpad-1.1.0/vdptool.c:387:12: enter_function: entry to ‘vdp_cmd_setvsi’
lldpad-1.1.0/vdptool.c:398:12: branch_false: following ‘false’ branch (when ‘args’ is non-NULL)...
lldpad-1.1.0/vdptool.c:401:19: branch_false: ...to here
lldpad-1.1.0/vdptool.c:401:19: acquire_memory: allocated here
lldpad-1.1.0/vdptool.c:402:12: branch_false: following ‘false’ branch (when ‘argvals’ is non-NULL)...
lldpad-1.1.0/vdptool.c:402:12: branch_false: ...to here
lldpad-1.1.0/vdptool.c:424:16: call_function: inlined call to ‘vdp_clif_command’ from ‘vdp_cmd_setvsi’
#  578|   	}
#  579|   
#  580|-> 	numargs = get_arg_val_list(ibuf, ilen, &ioff, args, argvals);
#  581|   	print_vsi(args, argvals, numargs, print_err_code);
#  582|   

Error: CPPCHECK_WARNING (CWE-457): [#def166]
lldpad-1.1.0/vdptool.c:1012: error[uninitvar]: Uninitialized variable: np->ops
# 1010|   
# 1011|   	LIST_FOREACH(np, &lldp_mod_head, lldp) {
# 1012|-> 		if (np->ops->lookup_tlv_name) {
# 1013|   			tlvid = np->ops->lookup_tlv_name(tlvid_str);
# 1014|   			if (tlvid != INVALID_TLVID)

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-130.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-namelldpad-1.1.0-15.git85e5583.fc44
store-results-to/tmp/tmp23bn4zgi/lldpad-1.1.0-15.git85e5583.fc44.tar.xz
time-created2026-01-08 19:23:15
time-finished2026-01-08 19:24:48
toolcsmock
tool-args'/usr/bin/csmock' '-r' 'fedora-rawhide-x86_64' '-t' 'gcc,cppcheck,clippy,shellcheck,unicontrol' '-o' '/tmp/tmp23bn4zgi/lldpad-1.1.0-15.git85e5583.fc44.tar.xz' '--gcc-analyze' '--unicontrol-notests' '--unicontrol-bidi-only' '--install' 'pam' '--gcc-analyzer-bin=/usr/bin/gcc' '/tmp/tmp23bn4zgi/lldpad-1.1.0-15.git85e5583.fc44.src.rpm'
tool-versioncsmock-3.8.3.20251215.161544.g62de9a5-1.el9