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
This commit is contained in:
Aleksander Morgado
2020-01-03 22:25:44 +01:00
parent b774cbe658
commit 0d8a5e2a43
+4 -2
View File
@@ -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;