From b766ded3ca58cee202bd4567dd5530f04dc2290d Mon Sep 17 00:00:00 2001 From: Aleksander Morgado Date: Thu, 8 Apr 2021 22:24:04 +0200 Subject: 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) --- src/mm-iface-modem-time.c | 3 +-- 1 file changed, 1 insertion(+), 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); -- cgit v1.2.3