From 434d46d978c3d5b99b4856552ee5ab56eb156424 Mon Sep 17 00:00:00 2001 From: Artem Bityutskiy Date: Fri, 7 Sep 2012 10:04:40 +0300 Subject: [PATCH] tethering: Fix error path in __connman_tethering_set_enabled() In some cases we did not destroy the bridge and ip pool. --- src/tethering.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/tethering.c b/src/tethering.c index 2d66cda..e343237 100644 --- a/src/tethering.c +++ b/src/tethering.c @@ -206,6 +206,7 @@ void __connman_tethering_set_enabled(void) tethering_restart, NULL); if (dhcp_ippool == NULL) { connman_error("Fail to create IP pool"); + __connman_bridge_remove(BRIDGE_NAME); return; } @@ -217,6 +218,7 @@ void __connman_tethering_set_enabled(void) err = __connman_bridge_enable(BRIDGE_NAME, gateway, broadcast); if (err < 0 && err != -EALREADY) { + __connman_ippool_unref(dhcp_ippool); __connman_bridge_remove(BRIDGE_NAME); return; } @@ -234,6 +236,7 @@ void __connman_tethering_set_enabled(void) 24 * 3600, dns); if (tethering_dhcp_server == NULL) { __connman_bridge_disable(BRIDGE_NAME); + __connman_ippool_unref(dhcp_ippool); __connman_bridge_remove(BRIDGE_NAME); return; } -- 2.7.4