diff options
author | Thomas Haller <thaller@redhat.com> | 2019-10-23 15:25:10 +0200 |
---|---|---|
committer | Thomas Haller <thaller@redhat.com> | 2019-10-23 15:25:46 +0200 |
commit | ae21d851e8d02fbe087f7cc0b7205193ba7118ac (patch) | |
tree | 79c6aa0aaf7a88ae10d1eb755058defddb5ff2f3 /src/devices/wwan | |
parent | 105ee6e5a9aae373e88d54ecbcd83ccb134cfc97 (diff) | |
download | NetworkManager-ae21d851e8d02fbe087f7cc0b7205193ba7118ac.tar.gz |
device/wwan: fix leak of "error" variable in connect_ready()
Fixes: 105ee6e5a9aa ('device: fix crash by handling connection cancellation')
Diffstat (limited to 'src/devices/wwan')
-rw-r--r-- | src/devices/wwan/nm-modem-broadband.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/devices/wwan/nm-modem-broadband.c b/src/devices/wwan/nm-modem-broadband.c index 0510902a31..eb5b21aa7e 100644 --- a/src/devices/wwan/nm-modem-broadband.c +++ b/src/devices/wwan/nm-modem-broadband.c @@ -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; |