summaryrefslogtreecommitdiff
path: root/src/devices/wwan
diff options
context:
space:
mode:
authorThomas Haller <thaller@redhat.com>2019-10-23 15:25:10 +0200
committerThomas Haller <thaller@redhat.com>2019-10-23 15:25:46 +0200
commitae21d851e8d02fbe087f7cc0b7205193ba7118ac (patch)
tree79c6aa0aaf7a88ae10d1eb755058defddb5ff2f3 /src/devices/wwan
parent105ee6e5a9aae373e88d54ecbcd83ccb134cfc97 (diff)
downloadNetworkManager-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.c9
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;