[PATCH] broadband-modem: ensure `match_info' is always initialized

Ben Chan benchan at chromium.org
Thu Aug 3 22:54:38 UTC 2017


This patch initializes `match_info' in registration_status_check_ready()
to NULL by default, such that `match_info' is always initialized even if
`self->priv->modem_3gpp_registration_regex' contains no elements.
Though `self->priv->modem_3gpp_registration_regex' always contains some
elements in the current implementation, it's better not to rely on that.
---
 src/mm-broadband-modem.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/mm-broadband-modem.c b/src/mm-broadband-modem.c
index 3e30aa90..552bdc5f 100644
--- a/src/mm-broadband-modem.c
+++ b/src/mm-broadband-modem.c
@@ -3952,7 +3952,7 @@ registration_status_check_ready (MMBroadbandModem *self,
     RunRegistrationChecksContext *ctx;
     const gchar *response;
     GError *error = NULL;
-    GMatchInfo *match_info;
+    GMatchInfo *match_info = NULL;
     guint i;
     gboolean parsed;
     gboolean cgreg;
-- 
2.14.0.rc1.383.gd1ce394fe2-goog



More information about the ModemManager-devel mailing list