wayne: ipacm: Fix memory leaks
* Errors reported by CppCheck. Change-Id: I700e4c8ef6a4cb7f551e1d9c69f72d218b124dde
This commit is contained in:
parent
2fdf20b62c
commit
f2aa710e36
3 changed files with 7 additions and 4 deletions
|
@ -5437,6 +5437,7 @@ int IPACM_Lan::add_l2tp_flt_rule(ipa_ip_type iptype, uint8_t *dst_mac, uint32_t
|
|||
if(m_routing.GetRoutingTable(&rt_tbl) == false)
|
||||
{
|
||||
IPACMERR("Failed to get routing table.\n");
|
||||
free(pFilteringTable);
|
||||
return IPACM_FAILURE;
|
||||
}
|
||||
|
||||
|
|
|
@ -405,11 +405,12 @@ void* ipa_driver_msg_notifier(void *param)
|
|||
}
|
||||
memcpy(event_ex, buffer + sizeof(struct ipa_msg_meta), length);
|
||||
data_ex = (ipacm_event_data_wlan_ex *)malloc(sizeof(ipacm_event_data_wlan_ex) + event_ex_o.num_of_attribs * sizeof(ipa_wlan_hdr_attrib_val));
|
||||
if (data_ex == NULL)
|
||||
{
|
||||
if (data_ex == NULL)
|
||||
{
|
||||
IPACMERR("unable to allocate memory for event data\n");
|
||||
return NULL;
|
||||
}
|
||||
free(event_ex);
|
||||
return NULL;
|
||||
}
|
||||
data_ex->num_of_attribs = event_ex->num_of_attribs;
|
||||
|
||||
memcpy(data_ex->attribs,
|
||||
|
|
|
@ -708,6 +708,7 @@ static int ipa_nl_decode_nlmsg
|
|||
if(ret_val != IPACM_SUCCESS)
|
||||
{
|
||||
IPACMERR("Error while getting interface name\n");
|
||||
free(data_fid);
|
||||
return IPACM_FAILURE;
|
||||
}
|
||||
IPACMDBG("Got a usb link_up event (Interface %s, %d) \n", dev_name, msg_ptr->nl_link_info.metainfo.ifi_index);
|
||||
|
|
Loading…
Reference in a new issue