cinterion: Correct use of freed structure
authorAlex J Lennon <ajlennon@dynamicdevices.co.uk>
Wed, 13 May 2015 16:08:47 +0000 (17:08 +0100)
committerDenis Kenzior <denkenz@gmail.com>
Wed, 13 May 2015 20:56:34 +0000 (15:56 -0500)
On error struct cb_data *cbd was used after in cinterion_set_online
after already being freed.

plugins/cinterion.c

index 6d85189..a18b9fe 100644 (file)
@@ -166,9 +166,9 @@ static void cinterion_set_online(struct ofono_modem *modem, ofono_bool_t online,
        if (g_at_chat_send(chat, command, NULL, set_online_cb, cbd, g_free))
                return;
 
-       g_free(cbd);
-
        CALLBACK_WITH_FAILURE(cb, cbd->data);
+
+       g_free(cbd);
 }
 
 static void cinterion_pre_sim(struct ofono_modem *modem)