mraa.c: Fixed potential segfault on free()-ing NULL in mraa_deinit()
Signed-off-by: Alex Tereschenko <alext.mkrs@gmail.com> Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
This commit is contained in:
committed by
Brendan Le Foll
parent
e5835fa0da
commit
3c4742c6e4
@@ -118,8 +118,12 @@ mraa_init()
|
||||
void
|
||||
mraa_deinit()
|
||||
{
|
||||
free(plat->pins);
|
||||
free(plat);
|
||||
if (plat != NULL) {
|
||||
if (plat->pins != NULL) {
|
||||
free(plat->pins);
|
||||
}
|
||||
free(plat);
|
||||
}
|
||||
closelog();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user