Private
Public Access
2
0

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:
Brendan Le Foll
2014-11-19 23:44:57 +00:00
parent 9014fc61a0
commit e84baf6636

View File

@@ -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;