[gnome-bluetooth/gnome-3-4] lib: return early in BluetoothAgent in case of errors
- From: Bastien Nocera <hadess src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-bluetooth/gnome-3-4] lib: return early in BluetoothAgent in case of errors
- Date: Fri, 7 Sep 2012 12:27:26 +0000 (UTC)
commit b4eeab283009e87e44e8bb1d01ba916a855ab8a5
Author: Giovanni Campagna <gcampagna src gnome org>
Date: Thu Sep 6 21:14:38 2012 +0200
lib: return early in BluetoothAgent in case of errors
Prevents a warning from unreffing a NULL variant.
https://bugzilla.gnome.org/show_bug.cgi?id=683523
lib/bluetooth-agent.c | 2 ++
1 files changed, 2 insertions(+), 0 deletions(-)
---
diff --git a/lib/bluetooth-agent.c b/lib/bluetooth-agent.c
index 240ed0d..f8b5cd0 100644
--- a/lib/bluetooth-agent.c
+++ b/lib/bluetooth-agent.c
@@ -468,6 +468,7 @@ gboolean bluetooth_agent_register(BluetoothAgent *agent)
g_warning ("Failed to register object: %s", error->message);
g_error_free (error);
error = NULL;
+ return FALSE;
}
r = g_dbus_proxy_call_sync (priv->adapter, "RegisterAgent",
@@ -477,6 +478,7 @@ gboolean bluetooth_agent_register(BluetoothAgent *agent)
if (r == NULL) {
g_printerr ("Agent registration failed: %s\n", error->message);
g_error_free (error);
+ return FALSE;
}
g_variant_unref (r);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]