summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Haller <thaller@redhat.com>2018-01-11 09:44:28 +0100
committerThomas Haller <thaller@redhat.com>2018-02-21 20:28:46 +0100
commita169d689babd350b1c48e7397ffbf23447849b22 (patch)
tree288dd50b8f0fd0d6450e8ef9a42621006e66c956
parent0ef23b139d95d455343ad1ca19c984c98dd7dc39 (diff)
downloadNetworkManager-a169d689babd350b1c48e7397ffbf23447849b22.tar.gz
wwan: avoid dangling pointer for error variable in connect_ready()
-rw-r--r--src/devices/wwan/nm-modem-broadband.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/devices/wwan/nm-modem-broadband.c b/src/devices/wwan/nm-modem-broadband.c
index fcff57b399..dd3328f867 100644
--- a/src/devices/wwan/nm-modem-broadband.c
+++ b/src/devices/wwan/nm-modem-broadband.c
@@ -385,9 +385,10 @@ connect_ready (MMModemSimple *simple_iface,
g_dbus_error_strip_remote_error (error);
ctx->first_error = error;
} else
- g_error_free (error);
+ g_clear_error (&error);
- if (ctx->ip_type_tries == 0 && g_error_matches (error, MM_CORE_ERROR, MM_CORE_ERROR_RETRY)) {
+ if ( ctx->ip_type_tries == 0
+ && g_error_matches (error, MM_CORE_ERROR, MM_CORE_ERROR_RETRY)) {
/* Try one more time */
ctx->ip_type_tries++;
} else {