From: Yu A Wang Date: Thu, 8 Dec 2011 07:31:05 +0000 (-0500) Subject: gdhcp: Check listerner_watch before remove it X-Git-Tag: 0.79~282 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=83a6923af0156de7575fac4bfb0ad2ee5023b361;p=platform%2Fupstream%2Fconnman.git gdhcp: Check listerner_watch before remove it Fixed following error: connmand[4547]: src/dhcp.c:dhcp_release() dhcp 0x8c6d3e8 connmand[4547]: DHCP: switch listening mode (3 ==> 0) (connmand:4547): GLib-CRITICAL **: g_source_remove: assertion `tag > 0' failed --- diff --git a/gdhcp/client.c b/gdhcp/client.c index 3270346..6df3281 100644 --- a/gdhcp/client.c +++ b/gdhcp/client.c @@ -777,7 +777,8 @@ static int switch_listening_mode(GDHCPClient *dhcp_client, return 0; if (dhcp_client->listen_mode != L_NONE) { - g_source_remove(dhcp_client->listener_watch); + if (dhcp_client->listener_watch > 0) + g_source_remove(dhcp_client->listener_watch); dhcp_client->listener_channel = NULL; dhcp_client->listen_mode = L_NONE; dhcp_client->listener_sockfd = -1;