From a0e5d36305e1d8bd8176c78fac3fef10c30bf99e Mon Sep 17 00:00:00 2001 From: Paul Betts Date: Tue, 21 Apr 2015 14:09:48 -0700 Subject: [PATCH] Free some stuff --- brightray/browser/linux/notification_presenter_linux.cc | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/brightray/browser/linux/notification_presenter_linux.cc b/brightray/browser/linux/notification_presenter_linux.cc index 1995fce2f2..3ff75c5115 100644 --- a/brightray/browser/linux/notification_presenter_linux.cc +++ b/brightray/browser/linux/notification_presenter_linux.cc @@ -27,7 +27,7 @@ static bool UnityIsRunning() { } struct DBusError err; - struct DBusConnection* bus; + struct DBusConnection* bus = NULL; dbus_error_init(&err); @@ -35,6 +35,7 @@ static bool UnityIsRunning() { if (dbus_error_is_set(&err)) { g_debug("Failed to get Session Bus reference"); unity_result = false; + dbus_error_free(&err); goto out; } @@ -43,9 +44,12 @@ static bool UnityIsRunning() { if (dbus_error_is_set(&err)) { unity_result = false; + dbus_error_free(&err); } out: + if (bus) dbus_connection_unref(bus); + unity_has_result = true; return unity_result; } @@ -110,6 +114,7 @@ void NotificationPresenterLinux::ShowNotification( notify_notification_set_image_from_pixbuf(notification, pixbuf); notify_notification_set_timeout(notification, NOTIFY_EXPIRES_DEFAULT); + g_object_unref(pixbuf); GError* error = nullptr; notify_notification_show(notification, &error);