Hi Pekka, > --- > plugins/dhclient.c | 12 +++++++++--- > 1 files changed, 9 insertions(+), 3 deletions(-) > > diff --git a/plugins/dhclient.c b/plugins/dhclient.c > index fd86773..01b87f3 100644 > --- a/plugins/dhclient.c > +++ b/plugins/dhclient.c > @@ -114,15 +114,21 @@ struct dhclient_data { > char *ifname; > }; > > +static void dhclient_unlink(const char *ifname); > +
if you really need this, then just move dhclient_unlink() to a proper location. I hate forward references if they are not needed. > static void dhclient_died(struct connman_task *task, void *user_data) > { > struct dhclient_data *dhclient = user_data; > > + connman_dhcp_set_data(dhclient->dhcp, NULL); > + > connman_dhcp_unref(dhclient->dhcp); > > connman_task_destroy(dhclient->task); > dhclient->task = NULL; > > + dhclient_unlink(dhclient->ifname); > + > g_free(dhclient->ifname); > g_free(dhclient); > } > @@ -212,10 +218,10 @@ static int dhclient_release(struct connman_dhcp *dhcp) > > DBG("dhcp %p", dhcp); > > - if (dhclient->task != NULL) > - connman_task_stop(dhclient->task); > + if (dhclient == NULL) > + return -ESRCH; > > - dhclient_unlink(dhclient->ifname); > + connman_task_stop(dhclient->task); > > return 0; > } Regards Marcel _______________________________________________ connman mailing list connman@connman.net http://lists.connman.net/listinfo/connman