gpio.c: free context if we fail to write to export
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
This commit is contained in:
@@ -129,6 +129,7 @@ mraa_gpio_init_raw(int pin)
|
||||
if (write(export, bu, length*sizeof(char)) == -1) {
|
||||
syslog(LOG_ERR, "gpio: Failed to write to export");
|
||||
close(export);
|
||||
free(dev);
|
||||
return NULL;
|
||||
}
|
||||
dev->owner = 1;
|
||||
|
||||
Reference in New Issue
Block a user