Merge pull request #609 from linyutsung/master

Fix onlpd memory leakage for s9180 bmc enabled platform
This commit is contained in:
Jeffrey Townsend
2019-08-29 14:14:33 -07:00
committed by GitHub
2 changed files with 24 additions and 0 deletions

View File

@@ -306,6 +306,8 @@ platform_psus_notify__(void)
ONLP_OID_TABLE_ITER_TYPE(si.hdr.coids, oidp, PSU) {
psu_oid_table[i++] = *oidp;
}
/* free allocated memory */
onlp_sys_info_free(&si);
}
for(i = 0; i < AIM_ARRAYSIZE(psu_oid_table); i++) {
@@ -417,6 +419,8 @@ platform_fans_notify__(void)
ONLP_OID_TABLE_ITER_TYPE(si.hdr.coids, oidp, FAN) {
fan_oid_table[i++] = *oidp;
}
/* free allocated memory */
onlp_sys_info_free(&si);
}
for(i = 0; i < AIM_ARRAYSIZE(fan_oid_table); i++) {

View File

@@ -84,6 +84,14 @@ onlp_sysi_onie_data_get(uint8_t** data, int* size)
return ONLP_STATUS_E_INTERNAL;
}
void
onlp_sysi_onie_data_free(uint8_t* data)
{
if (data) {
aim_free(data);
}
}
int
onlp_sysi_oids_get(onlp_oid_t* table, int max)
{
@@ -381,3 +389,15 @@ onlp_sysi_platform_info_get(onlp_platform_info_t* pi)
return ONLP_STATUS_OK;
}
void
onlp_sysi_platform_info_free(onlp_platform_info_t* pi)
{
if (pi->cpld_versions) {
aim_free(pi->cpld_versions);
}
if (pi->cpld_versions) {
aim_free(pi->other_versions);
}
}