mraa.c: Fix for various small memory leaks
In the process of using the mraa mock platform to identify memory leaks in UPM libraries. This commit fixes some non-critical places where memory was getting lost in mraa. Signed-off-by: Noel Eck <noel.eck@intel.com> Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
This commit is contained in:
committed by
Brendan Le Foll
parent
b937c521f6
commit
65f7d2a250
11
src/mraa.c
11
src/mraa.c
@@ -230,11 +230,17 @@ mraa_deinit()
|
||||
if (plat->pins != NULL) {
|
||||
free(plat->pins);
|
||||
}
|
||||
if (plat->adv_func != NULL) {
|
||||
free(plat->adv_func);
|
||||
}
|
||||
mraa_board_t* sub_plat = plat->sub_platform;
|
||||
if (sub_plat != NULL) {
|
||||
if (sub_plat->pins != NULL) {
|
||||
free(sub_plat->pins);
|
||||
}
|
||||
if (sub_plat->adv_func != NULL) {
|
||||
free(sub_plat->adv_func);
|
||||
}
|
||||
free(sub_plat);
|
||||
}
|
||||
#if defined(JSONPLAT)
|
||||
@@ -252,6 +258,11 @@ mraa_deinit()
|
||||
#endif
|
||||
free(plat);
|
||||
|
||||
if (lang_func != NULL)
|
||||
free(lang_func);
|
||||
|
||||
if (platform_name != NULL)
|
||||
free(platform_name);
|
||||
}
|
||||
if (plat_iio != NULL) {
|
||||
free(plat_iio);
|
||||
|
||||
Reference in New Issue
Block a user