Linux bluetooth development
 help / color / mirror / Atom feed
From: Bastien Nocera <hadess@hadess.net>
To: Syam Sidhardhan <s.syam@samsung.com>
Cc: linux-bluetooth@vger.kernel.org
Subject: Re: [PATCH BlueZ v0 4/4] cups: Free D-Bus error
Date: Mon, 17 Sep 2012 12:44:36 +0100	[thread overview]
Message-ID: <1347882276.7515.6.camel@sirocco.hadess.net> (raw)
In-Reply-To: <1347639011-22924-4-git-send-email-s.syam@samsung.com>

Em Fri, 2012-09-14 às 21:40 +0530, Syam Sidhardhan escreveu:
> If D-Bus error is set we should free it.

Looks good to me.

> ---
>  profiles/cups/main.c |    9 +++++++--
>  1 files changed, 7 insertions(+), 2 deletions(-)
> 
> diff --git a/profiles/cups/main.c b/profiles/cups/main.c
> index a884c6e..5aa927f 100644
> --- a/profiles/cups/main.c
> +++ b/profiles/cups/main.c
> @@ -446,8 +446,10 @@ static gboolean list_known_printers(const char *adapter)
>  
>  	dbus_message_unref(message);
>  
> -	if (dbus_error_is_set(&error))
> +	if (dbus_error_is_set(&error)) {
> +		dbus_error_free(&error);
>  		return FALSE;
> +	}
>  
>  	dbus_message_iter_init(reply, &reply_iter);
>  	if (dbus_message_iter_get_arg_type(&reply_iter) != DBUS_TYPE_ARRAY) {
> @@ -549,8 +551,10 @@ static gboolean list_printers(void)
>  
>  	dbus_error_init(&error);
>  	hcid_exists = dbus_bus_name_has_owner(conn, "org.bluez", &error);
> -	if (dbus_error_is_set(&error))
> +	if (dbus_error_is_set(&error)) {
> +		dbus_error_free(&error);
>  		return TRUE;
> +	}
>  
>  	if (!hcid_exists)
>  		return TRUE;
> @@ -570,6 +574,7 @@ static gboolean list_printers(void)
>  	dbus_message_unref(message);
>  
>  	if (dbus_error_is_set(&error)) {
> +		dbus_error_free(&error);
>  		dbus_connection_unref(conn);
>  		/* No adapter */
>  		return TRUE;



  reply	other threads:[~2012-09-17 11:44 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-09-14 16:10 [PATCH BlueZ v0 1/4] device: Remove dead code from get_properties() Syam Sidhardhan
2012-09-14 16:10 ` [PATCH BlueZ v0 2/4] adapter: Remove dead code from adapter_emit_device_found() Syam Sidhardhan
2012-09-14 16:10 ` [PATCH BlueZ v0 3/4] gstavdtpsink: Free the D-Bus error on reply failure Syam Sidhardhan
2012-09-14 16:10 ` [PATCH BlueZ v0 4/4] cups: Free D-Bus error Syam Sidhardhan
2012-09-17 11:44   ` Bastien Nocera [this message]
2012-09-17 13:55 ` [PATCH BlueZ v0 1/4] device: Remove dead code from get_properties() Luiz Augusto von Dentz

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1347882276.7515.6.camel@sirocco.hadess.net \
    --to=hadess@hadess.net \
    --cc=linux-bluetooth@vger.kernel.org \
    --cc=s.syam@samsung.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox