From 941a41d30f1a468e7d689962a6658b39e9acede1 Mon Sep 17 00:00:00 2001 From: Ben Chan Date: Thu, 3 Aug 2017 15:54:38 -0700 Subject: [PATCH] broadband-modem: ensure `match_info' is always initialized 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;