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

Aleksander Morgado aleksander at aleksander.es
Fri Aug 4 13:17:04 UTC 2017


On 04/08/17 00:54, Ben Chan wrote:
> 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(-)
> 

Pushed to git master, thanks.

> 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;
> 


-- 
Aleksander
https://aleksander.es


More information about the ModemManager-devel mailing list