Private
Public Access
2
0

firmata.c: fix possible crash if devs is wrong

Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
This commit is contained in:
Brendan Le Foll
2016-03-11 16:36:40 +00:00
parent 5789f5001d
commit 91452e5c83
2 changed files with 7 additions and 3 deletions

View File

@@ -464,6 +464,10 @@ mraa_firmata_plat_init(const char* uart_dev)
}
firmata_dev = firmata_new(uart_dev);
if (firmata_dev == NULL) {
free(b);
return NULL;
}
// if this isn't working then we have an issue with our uart
while (!firmata_dev->isReady) {