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:
@@ -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");
|
||||||
|
Reference in New Issue
Block a user