NULL,
&dbus_result);
- if (dbus_result == VPNSVC_ERROR_PERMISSION_DENIED)
+ if (dbus_result == VPNSVC_ERROR_PERMISSION_DENIED) {
+ close(iface_fd);
+ _vpnsvc_deinit_vpnsvc_tun_s(tmp_s);
return VPNSVC_ERROR_PERMISSION_DENIED;
+ }
op = _vpnsvc_invoke_dbus_method_with_fd(tmp_s->connection,
NETCONFIG_SERVICE_NAME,
iface_fd,
&dbus_result);
- if (dbus_result == VPNSVC_ERROR_PERMISSION_DENIED)
+ if (dbus_result == VPNSVC_ERROR_PERMISSION_DENIED) {
+ close(iface_fd);
+ _vpnsvc_deinit_vpnsvc_tun_s(tmp_s);
return VPNSVC_ERROR_PERMISSION_DENIED;
+ }
if (op == NULL) {
close(iface_fd); //LCOV_EXCL_LINE
g_variant_get(op, "(iis)", &result, &tmp_index, &tmp_name);
if (result != VPNSVC_ERROR_NONE) {
LOGE("vpnsvc_init() failed"); //LCOV_EXCL_LINE
+ close(iface_fd);
_vpnsvc_deinit_vpnsvc_tun_s(tmp_s); //LCOV_EXCL_LINE
result = VPNSVC_ERROR_PERMISSION_DENIED; //LCOV_EXCL_LINE
} else {