pmaports/temp/modemmanager/0002-base-manager-make-sure-g_autoptr-variables-are-initi.patch

33 lines
1.1 KiB
Diff

From 4853aa702ed298ebceea2e9cd737d048380db38f Mon Sep 17 00:00:00 2001
From: Aleksander Morgado <aleksander@aleksander.es>
Date: Sun, 23 May 2021 12:16:55 +0200
Subject: [PATCH 02/39] 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.
---
src/mm-base-manager.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/mm-base-manager.c b/src/mm-base-manager.c
index 0c393f11..5880ffad 100644
--- a/src/mm-base-manager.c
+++ b/src/mm-base-manager.c
@@ -681,11 +681,11 @@ mm_base_modem_sync_ready (MMBaseModem *self,
GAsyncResult *res,
gpointer user_data)
{
- g_autoptr(GError) error;
+ g_autoptr(GError) error = NULL;
mm_base_modem_sync_finish (self, res, &error);
if (error) {
- mm_obj_warn (self, "synchronization failed");
+ mm_obj_warn (self, "synchronization failed: %s", error->message);
return;
}
mm_obj_info (self, "synchronization finished");
--
2.31.1