Hi Philip, >> +static void cinterion_set_online(struct ofono_modem *modem, ofono_bool_t online, >> + ofono_modem_online_cb_t cb, void *user_data) >> +{ >> + GAtChat *chat = ofono_modem_get_data(modem); >> + struct cb_data *cbd = cb_data_new(cb, user_data); >> + char const *command = online ? "AT+CFUN=1" : "AT+CFUN=7"; >> + >> + DBG("modem %p %s", modem, online ? "online" : "offline"); >> + >> + if (g_at_chat_send(chat, command, NULL, set_online_cb, cbd, g_free)) >> + return; >> + >> + g_free(cbd); >> + >> + CALLBACK_WITH_FAILURE(cb, cbd->data); >> +} > > Doesn't this expand into a use after free bug if g_at_chat_send() fails? > Yes it does! I fixed a few more occurrences of this bug. Thanks for pointing it out. Regards, -Denis