initio.c: Add fix for potential leak memory
Signed-off-by: Adelin Dobre <adelin.dobre@rinftech.com> Signed-off-by: Mihai Tudor Panu <mihai.tudor.panu@intel.com>
This commit is contained in:
committed by
Mihai Tudor Panu
parent
ba201fcad2
commit
1278089e84
@@ -701,6 +701,7 @@ mraa_io_init(const char* strdesc, mraa_io_descriptor** desc)
|
|||||||
if (!dev) {
|
if (!dev) {
|
||||||
syslog(LOG_ERR, "mraa_io_init: error parsing pwm init string '%s'", str_descs[i]);
|
syslog(LOG_ERR, "mraa_io_init: error parsing pwm init string '%s'", str_descs[i]);
|
||||||
status = MRAA_ERROR_INVALID_HANDLE;
|
status = MRAA_ERROR_INVALID_HANDLE;
|
||||||
|
free(new_desc);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (status == MRAA_SUCCESS) {
|
if (status == MRAA_SUCCESS) {
|
||||||
|
|||||||
Reference in New Issue
Block a user