aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAleksander Morgado <aleksander@aleksander.es>2021-04-08 22:24:04 +0200
committerAleksander Morgado <aleksander@aleksander.es>2021-04-09 00:55:56 +0200
commitb766ded3ca58cee202bd4567dd5530f04dc2290d (patch)
treef6418407abdec593e3e908fb3f8500ddef71c184
parent3d665d22093b985f6860170bca8d33a5562056d1 (diff)
iface-modem-time: fix invalid read when loading network timezone fails
==226546== Invalid read of size 4 ==226546== at 0x5068CB7: g_error_matches (in /usr/lib/libglib-2.0.so.0.6600.7) ==226546== by 0x1BAC86: load_network_timezone_ready (mm-iface-modem-time.c:218) ==226546== by 0x4EA827E: g_simple_async_result_complete (in /usr/lib/libgio-2.0.so.0.6600.7) ==226546== by 0x17AE2C: at_command_ready (mm-base-modem-at.c:538) ==226546== by 0x4EA827E: g_simple_async_result_complete (in /usr/lib/libgio-2.0.so.0.6600.7) ==226546== by 0x24B475: serial_command_ready (mm-port-serial-at.c:378) ==226546== by 0x4EA827E: g_simple_async_result_complete (in /usr/lib/libgio-2.0.so.0.6600.7) ==226546== by 0x244F94: command_context_complete_and_free (mm-port-serial.c:141) ==226546== by 0x246861: port_serial_got_response (mm-port-serial.c:755) ==226546== by 0x246923: port_serial_timed_out (mm-port-serial.c:785) ==226546== by 0x50863C3: ??? (in /usr/lib/libglib-2.0.so.0.6600.7) ==226546== by 0x5085B83: g_main_context_dispatch (in /usr/lib/libglib-2.0.so.0.6600.7)
-rw-r--r--src/mm-iface-modem-time.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/src/mm-iface-modem-time.c b/src/mm-iface-modem-time.c
index f02bc34e..5770e7b7 100644
--- a/src/mm-iface-modem-time.c
+++ b/src/mm-iface-modem-time.c
@@ -194,7 +194,7 @@ static void
load_network_timezone_ready (MMIfaceModemTime *self,
GAsyncResult *res)
{
- GError *error = NULL;
+ g_autoptr(GError) error = NULL;
MMNetworkTimezone *tz;
/* Finish the async operation */
@@ -203,7 +203,6 @@ load_network_timezone_ready (MMIfaceModemTime *self,
NetworkTimezoneContext *ctx;
mm_obj_dbg (self, "couldn't load network timezone: %s", error->message);
- g_error_free (error);
/* Note: may be NULL if the polling has been removed while processing the async operation */
ctx = (NetworkTimezoneContext *) g_object_get_qdata (G_OBJECT (self), network_timezone_context_quark);