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)
This commit is contained in:
Aleksander Morgado
2021-04-08 22:24:04 +02:00
parent 3d665d2209
commit b766ded3ca

View File

@@ -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);