base-manager: make sure g_autoptr() variables are initialized to NULL

Otherwise, we may have memory issues if the variable isn't initialized
and the method exits.
This commit is contained in:
Aleksander Morgado
2021-05-23 12:16:55 +02:00
parent 38740e9d11
commit 01223b2d4d

View File

@@ -741,11 +741,11 @@ mm_base_modem_sync_ready (MMBaseModem *self,
GAsyncResult *res, GAsyncResult *res,
gpointer user_data) gpointer user_data)
{ {
g_autoptr(GError) error; g_autoptr(GError) error = NULL;
mm_base_modem_sync_finish (self, res, &error); mm_base_modem_sync_finish (self, res, &error);
if (error) { if (error) {
mm_obj_warn (self, "synchronization failed"); mm_obj_warn (self, "synchronization failed: %s", error->message);
return; return;
} }
mm_obj_info (self, "synchronization finished"); mm_obj_info (self, "synchronization finished");