- To prevent "use after free", NULL should assign to the handle.
Change-Id: I974442074cb778d3f2e9797bc291b9098f3017f5
Signed-off-by: kibak.yoon <kibak.yoon@samsung.com>
if (ret != PERIPHERAL_ERROR_NONE) {
_E("Failed to export gpio");
peripheral_handle_gpio_destroy(gpio_handle);
+ gpio_handle = NULL;
goto out;
}
_E("Failed to create gpio fd list");
peripheral_interface_gpio_unexport(pin);
peripheral_handle_gpio_destroy(gpio_handle);
+ gpio_handle = NULL;
goto out;
}
peripheral_io_gdbus_gpio_complete_close(gpio, invocation, ret);
return true;
-}
\ No newline at end of file
+}