Call dhcp_release() before dhcp_invalidate(), as the latter function
frees the dhcp struct. Also do not free the structure twice.
---
 src/dhcp.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/src/dhcp.c b/src/dhcp.c
index d98f42d..c1dc5ec 100644
--- a/src/dhcp.c
+++ b/src/dhcp.c
@@ -590,10 +590,8 @@ static void remove_network(gpointer user_data)
 
        DBG("dhcp %p", dhcp);
 
-       dhcp_invalidate(dhcp, false);
        dhcp_release(dhcp);
-
-       g_free(dhcp);
+       dhcp_invalidate(dhcp, false);
 }
 
 int __connman_dhcp_start(struct connman_network *network, dhcp_cb callback)
-- 
1.8.5.3

_______________________________________________
connman mailing list
[email protected]
https://lists.connman.net/mailman/listinfo/connman

Reply via email to