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
|
void
|
||||||
mraa_deinit()
|
mraa_deinit()
|
||||||
{
|
{
|
||||||
|
if (plat != NULL) {
|
||||||
|
if (plat->pins != NULL) {
|
||||||
free(plat->pins);
|
free(plat->pins);
|
||||||
|
}
|
||||||
free(plat);
|
free(plat);
|
||||||
|
}
|
||||||
closelog();
|
closelog();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user