summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAleksander Morgado <aleksander@aleksander.es>2020-01-03 22:25:44 +0100
committerAleksander Morgado <aleksander@aleksander.es>2020-01-03 22:52:20 +0100
commit46d305823714de57a549a2a22aa918e21ff5843a (patch)
treef4ab9cad477d02537b36b48f491923f9b90fc5d7
parent4ea5184d4850b5da709f71e9b8e37b5219982704 (diff)
iface-modem-voice: fix segfault when voice support check fails
The error returned in support_check_finish() should be treated as optional, as in all the other optional feature interfaces. Fixes https://gitlab.freedesktop.org/mobile-broadband/ModemManager/issues/172 (cherry picked from commit 0d8a5e2a43e6baff0c282a3d2b15d03063c48199)
-rw-r--r--src/mm-iface-modem-voice.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/mm-iface-modem-voice.c b/src/mm-iface-modem-voice.c
index 9c3b84c5..592afc41 100644
--- a/src/mm-iface-modem-voice.c
+++ b/src/mm-iface-modem-voice.c
@@ -2813,8 +2813,10 @@ check_support_ready (MMIfaceModemVoice *self,
GError *error = NULL;
if (!MM_IFACE_MODEM_VOICE_GET_INTERFACE (self)->check_support_finish (self, res, &error)) {
- mm_dbg ("Voice support check failed: '%s'", error->message);
- g_error_free (error);
+ if (error) {
+ mm_dbg ("Voice support check failed: '%s'", error->message);
+ g_error_free (error);
+ }
g_task_return_new_error (task, MM_CORE_ERROR, MM_CORE_ERROR_UNSUPPORTED, "Voice not supported");
g_object_unref (task);
return;