aboutsummaryrefslogtreecommitdiffstats
path: root/main/upower/lib-Fix-memory-leak-in-up_client_get_devices.patch
diff options
context:
space:
mode:
authorNatanael Copa <ncopa@alpinelinux.org>2015-07-23 06:43:32 +0000
committerNatanael Copa <ncopa@alpinelinux.org>2015-07-23 06:43:32 +0000
commitd3062118c9db1d5cdddf1a62a1edae8ee7732cd1 (patch)
treefd40fd382053074375c45911debd77f5e670b9c9 /main/upower/lib-Fix-memory-leak-in-up_client_get_devices.patch
parent6986909c30859510ac7e183ee952b4b017f2115a (diff)
downloadaports-d3062118c9db1d5cdddf1a62a1edae8ee7732cd1.tar.bz2
aports-d3062118c9db1d5cdddf1a62a1edae8ee7732cd1.tar.xz
main/upower: add fixes from upstream
Diffstat (limited to 'main/upower/lib-Fix-memory-leak-in-up_client_get_devices.patch')
-rw-r--r--main/upower/lib-Fix-memory-leak-in-up_client_get_devices.patch33
1 files changed, 33 insertions, 0 deletions
diff --git a/main/upower/lib-Fix-memory-leak-in-up_client_get_devices.patch b/main/upower/lib-Fix-memory-leak-in-up_client_get_devices.patch
new file mode 100644
index 0000000000..3418b04168
--- /dev/null
+++ b/main/upower/lib-Fix-memory-leak-in-up_client_get_devices.patch
@@ -0,0 +1,33 @@
+From fe37183fba649b999af3f66b9e0b0d70a054426c Mon Sep 17 00:00:00 2001
+From: Bastien Nocera <hadess@hadess.net>
+Date: Wed, 17 Jun 2015 10:52:12 +0200
+Subject: lib: Fix memory leak in up_client_get_devices()
+
+When up_client_get_devices() fails to contact the D-Bus daemon, don't
+leak the newly created array.
+
+diff --git a/libupower-glib/up-client.c b/libupower-glib/up-client.c
+index 48d99a0..4780aa5 100644
+--- a/libupower-glib/up-client.c
++++ b/libupower-glib/up-client.c
+@@ -95,8 +95,6 @@ up_client_get_devices (UpClient *client)
+
+ g_return_val_if_fail (UP_IS_CLIENT (client), NULL);
+
+- array = g_ptr_array_new ();
+-
+ if (up_client_glue_call_enumerate_devices_sync (client->priv->proxy,
+ &devices,
+ NULL,
+@@ -106,6 +104,8 @@ up_client_get_devices (UpClient *client)
+ return NULL;
+ }
+
++ array = g_ptr_array_new ();
++
+ for (i = 0; devices[i] != NULL; i++) {
+ UpDevice *device;
+ const char *object_path = devices[i];
+--
+cgit v0.10.2
+