summaryrefslogtreecommitdiff
path: root/profiles/cups
diff options
context:
space:
mode:
authorSyam Sidhardhan <s.syam@samsung.com>2012-09-14 21:40:11 +0530
committerLuiz Augusto von Dentz <luiz.von.dentz@intel.com>2012-09-17 16:49:43 +0300
commit7cc3243d868840e025798e95ffcd46294a9a5b93 (patch)
tree58e938f22a553af5b5f225e764b5b94f22615492 /profiles/cups
parent7730ff4a3615d4dd6961d5296ee7aab06ce0d5cb (diff)
downloadbluez-7cc3243d868840e025798e95ffcd46294a9a5b93.tar.gz
cups: Free D-Bus error
If D-Bus error is set we should free it.
Diffstat (limited to 'profiles/cups')
-rw-r--r--profiles/cups/main.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/profiles/cups/main.c b/profiles/cups/main.c
index a884c6e7b..5aa927f52 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;