device/wwan: fix leak of "error" variable in connect_ready()

Fixes: 105ee6e5a9 ('device: fix crash by handling connection cancellation')
This commit is contained in:
Thomas Haller 2019-10-23 15:25:10 +02:00
parent 105ee6e5a9
commit ae21d851e8

View file

@ -341,15 +341,18 @@ connect_ready (MMModemSimple *simple_iface,
GAsyncResult *res,
NMModemBroadband *self)
{
ConnectContext *ctx = NULL;
ConnectContext *ctx;
GError *error = NULL;
NMModemIPMethod ip4_method = NM_MODEM_IP_METHOD_UNKNOWN;
NMModemIPMethod ip6_method = NM_MODEM_IP_METHOD_UNKNOWN;
MMBearer *bearer;
MMBearer *bearer = mm_modem_simple_connect_finish (simple_iface, res, &error);
bearer = mm_modem_simple_connect_finish (simple_iface, res, &error);
if (g_error_matches (error, G_IO_ERROR, G_IO_ERROR_CANCELLED))
if (g_error_matches (error, G_IO_ERROR, G_IO_ERROR_CANCELLED)) {
g_error_free (error);
return;
}
ctx = self->_priv.ctx;