Hi,

2011/2/15 Andreas Westin <andreas.wes...@stericsson.com>:
> From: Jessica Nilsson <jessica.j.nils...@stericsson.com>
>
> ---
>  drivers/isimodem/gprs-context.c |   95 +++++++++++++++++++++++++-------------
>  1 files changed, 62 insertions(+), 33 deletions(-)
>
> diff --git a/drivers/isimodem/gprs-context.c b/drivers/isimodem/gprs-context.c
> index 6d579d8..f458fcc 100644
> --- a/drivers/isimodem/gprs-context.c
> +++ b/drivers/isimodem/gprs-context.c
> @@ -347,32 +347,52 @@ static void send_context_authenticate(GIsiClient 
> *client, void *opaque)
>        struct context_data *cd = opaque;
>        size_t username_len = strlen(cd->username);
>        size_t password_len = strlen(cd->password);
> +       size_t sb_user_info_len = (3 + username_len + 3) & ~3;
> +       size_t fill_sb_user_info_count =
> +                       sb_user_info_len - (3 + username_len);
> +       uint8_t *fill_sb_user_info_data =
> +                       g_try_malloc0(fill_sb_user_info_count);
> +       size_t sb_password_info_len = (3 + password_len + 3) & ~3;
> +       size_t fill_sb_password_info_count =
> +                       sb_user_info_len - (3 + password_len);

This should be sb_password_info_len, no?

> +       uint8_t *fill_sb_password_info_data =
> +                       g_try_malloc0(fill_sb_password_info_count);

There's no reason to allocate the padding from heap. (Especially if
they're never freed.)

I applied this patch, but fixed the above issues afterwards. Please
check that it's still doing the right thing.

Cheers,
Aki
_______________________________________________
ofono mailing list
ofono@ofono.org
http://lists.ofono.org/listinfo/ofono

Reply via email to