Private
Public Access
2
0

mraa.c: fix memleak in find_i2c_bus_pci

Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
This commit is contained in:
Brendan Le Foll
2016-11-04 13:13:21 +00:00
parent dbcba5cbeb
commit 3d790a8278

View File

@@ -957,9 +957,15 @@ mraa_find_i2c_bus_pci(const char* pci_device, const char *pci_id, const char* ad
if (token != NULL) {
int ret = -1;
if (mraa_atoi(token, &ret) == MRAA_SUCCESS) {
free(dup);
free(namelist[n]);
free(namelist);
syslog(LOG_NOTICE, "Adding i2c bus found on i2c-%d on adapter %s", ret, adapter_name);
return ret;
}
free(dup);
free(namelist[n]);
free(namelist);
return -1;
}
}