sdm660: ipacm: Fix memory leaks

* Errors reported by CppCheck.

Change-Id: I700e4c8ef6a4cb7f551e1d9c69f72d218b124dde
Signed-off-by: Albert I <krascgq@outlook.co.id>
This commit is contained in:
Antoine Giraudmaillet 2018-01-03 23:39:19 +00:00 committed by Max Weffers
parent 0b6a4108c1
commit 81eb3926d2
No known key found for this signature in database
GPG key ID: 795F73D22FB93FAE
3 changed files with 7 additions and 4 deletions

View file

@ -5640,6 +5640,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;
}

View file

@ -411,11 +411,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,

View file

@ -709,6 +709,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_H("Got a usb link_up event (Interface %s, %d) \n", dev_name, msg_ptr->nl_link_info.metainfo.ifi_index);