about summary refs log tree commit diff
path: root/src/core/devices/wwan
diff options
context:
space:
mode:
Diffstat (limited to 'src/core/devices/wwan')
-rw-r--r--src/core/devices/wwan/nm-modem-broadband.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/core/devices/wwan/nm-modem-broadband.c b/src/core/devices/wwan/nm-modem-broadband.c
index ca028804..1297d964 100644
--- a/src/core/devices/wwan/nm-modem-broadband.c
+++ b/src/core/devices/wwan/nm-modem-broadband.c
@@ -369,10 +369,10 @@ static void
 connect_ready(MMModemSimple *simple_iface, GAsyncResult *res, NMModemBroadband *self)
 {
     ConnectContext *ctx;
-    GError *        error      = NULL;
-    NMModemIPMethod ip4_method = NM_MODEM_IP_METHOD_UNKNOWN;
-    NMModemIPMethod ip6_method = NM_MODEM_IP_METHOD_UNKNOWN;
-    MMBearer *      bearer;
+    GError *        error            = NULL;
+    NMModemIPMethod ip4_method       = NM_MODEM_IP_METHOD_UNKNOWN;
+    NMModemIPMethod ip6_method       = NM_MODEM_IP_METHOD_UNKNOWN;
+    gs_unref_object MMBearer *bearer = NULL;
 
     bearer = mm_modem_simple_connect_finish(simple_iface, res, &error);
 
@@ -386,7 +386,7 @@ connect_ready(MMModemSimple *simple_iface, GAsyncResult *res, NMModemBroadband *
     if (!ctx)
         return;
 
-    self->_priv.bearer = bearer;
+    self->_priv.bearer = g_steal_pointer(&bearer);
 
     if (!self->_priv.bearer) {
         if (g_error_matches(error, MM_MOBILE_EQUIPMENT_ERROR, MM_MOBILE_EQUIPMENT_ERROR_SIM_PIN)