voicecall: Fix crash
authorDenis Kenzior <denkenz@gmail.com>
Sun, 25 Nov 2012 03:55:04 +0000 (21:55 -0600)
committerDenis Kenzior <denkenz@gmail.com>
Wed, 28 Nov 2012 16:31:14 +0000 (10:31 -0600)
src/voicecall.c

index 900477d..89ad237 100644 (file)
@@ -3873,11 +3873,14 @@ void __ofono_voicecall_set_alpha_and_icon_id(struct ofono_voicecall *vc,
 
 void __ofono_voicecall_clear_alpha_and_icon_id(struct ofono_voicecall *vc)
 {
-       g_free(vc->dial_req->message);
-       vc->dial_req->message = NULL;
 
-       g_free(vc->dial_req);
-       vc->dial_req = NULL;
+       if (vc->dial_req) {
+               g_free(vc->dial_req->message);
+               vc->dial_req->message = NULL;
+
+               g_free(vc->dial_req);
+               vc->dial_req = NULL;
+       }
 
        vc->flags &= ~VOICECALL_FLAG_STK_MODEM_CALLSETUP;
 }