From 685d07096683a1166a69302bcf967fa0518fb121 Mon Sep 17 00:00:00 2001 From: Luiz Augusto von Dentz Date: Thu, 5 Mar 2015 10:50:54 +0200 Subject: [PATCH] core/gatt: Simplify service_free This remove NULL checks for functions that are safe to call even if the pointer is NULL. --- src/gatt-database.c | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/src/gatt-database.c b/src/gatt-database.c index d4dd6610b..e887bd278 100644 --- a/src/gatt-database.c +++ b/src/gatt-database.c @@ -351,20 +351,15 @@ static void service_free(void *data) g_dbus_client_set_proxy_handlers(service->client, NULL, NULL, NULL, NULL); g_dbus_client_set_ready_watch(service->client, NULL, NULL); + g_dbus_proxy_unref(service->proxy); g_dbus_client_unref(service->client); } - if (service->proxy) - g_dbus_proxy_unref(service->proxy); - if (service->reg) dbus_message_unref(service->reg); - if (service->owner) - g_free(service->owner); - - if (service->path) - g_free(service->path); + g_free(service->owner); + g_free(service->path); free(service); } -- 2.47.3