Hi,

On Tue, 2014-11-11 at 12:43 +0100, Erik Larsson wrote:
> When browser is requested and users tries to disconnect reply will
> be NULL. This fix check the reply message before acting on it.
> ---
>  src/agent-connman.c | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/src/agent-connman.c b/src/agent-connman.c
> index b2049a3..ce799f2 100644
> --- a/src/agent-connman.c
> +++ b/src/agent-connman.c
> @@ -582,6 +582,9 @@ static void request_browser_reply(DBusMessage *reply, 
> void *user_data)
>       bool result = false;
>       const char *error = NULL;
>  
> +     if (!reply)
> +             goto out;
> +
>       if (dbus_message_get_type(reply) == DBUS_MESSAGE_TYPE_ERROR) {
>               error = dbus_message_get_error_name(reply);
>               goto done;
> @@ -592,6 +595,7 @@ static void request_browser_reply(DBusMessage *reply, 
> void *user_data)
>  done:
>       browser_reply_data->callback(browser_reply_data->service, result,
>                                       error, browser_reply_data->user_data);
> +out:
>       g_free(browser_reply_data);
>  }

The browser_reply_data->callback needs to be called also in the
cancelled case, as that will set the wispr code requesting the browser
into a sane state.

Cheers,

        Patrik


_______________________________________________
connman mailing list
[email protected]
https://lists.connman.net/mailman/listinfo/connman

Reply via email to