From af42e80e56a7ca9a0843457dae28e9d78121b6b9 Mon Sep 17 00:00:00 2001 From: monsta Date: Tue, 7 Mar 2017 21:17:40 +0300 Subject: use proper return type and fix a small memleak --- src/gpm-control.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/gpm-control.c b/src/gpm-control.c index 9a1273b..d394d93 100644 --- a/src/gpm-control.c +++ b/src/gpm-control.c @@ -273,7 +273,8 @@ gpm_control_suspend (GpmControl *control, GError **error) if (proxy == NULL) { egg_error("Error connecting to dbus - %s", dbus_error->message); g_error_free (dbus_error); - return -1; + ret = FALSE; + goto out; } res = g_dbus_proxy_call_sync (proxy, "Suspend", g_variant_new( "(b)",FALSE), @@ -387,7 +388,8 @@ gpm_control_hibernate (GpmControl *control, GError **error) if (proxy == NULL) { egg_error("Error connecting to dbus - %s", dbus_error->message); g_error_free (dbus_error); - return -1; + ret = FALSE; + goto out; } res = g_dbus_proxy_call_sync (proxy, "Hibernate", g_variant_new( "(b)",FALSE), -- cgit v1.2.1