From 2510148b16a71504dff3880c8af416fd85a2885d Mon Sep 17 00:00:00 2001
From: Vlad Orlov <monsta@inbox.ru>
Date: Fri, 13 Mar 2015 13:17:31 +0100
Subject: lib: Fix crash on uninitialized variant
Initialize the GVariant* pointers, so that they aren't uninitialized when
jumping to "out:" and unref'ing them.
https://bugs.freedesktop.org/show_bug.cgi?id=89476
https://bugs.debian.org/774546
https://bugs.launchpad.net/ubuntu-mate/+bug/1428337
diff --git a/libupower-glib/up-device.c b/libupower-glib/up-device.c
index 9f6e0e1..f053f3d 100644
--- a/libupower-glib/up-device.c
+++ b/libupower-glib/up-device.c
@@ -422,7 +422,7 @@ GPtrArray *
up_device_get_history_sync (UpDevice *device, const gchar *type, guint timespec, guint resolution, GCancellable *cancellable, GError **error)
{
GError *error_local = NULL;
- GVariant *gva;
+ GVariant *gva = NULL;
guint i;
GPtrArray *array = NULL;
gboolean ret;
@@ -502,7 +502,7 @@ GPtrArray *
up_device_get_statistics_sync (UpDevice *device, const gchar *type, GCancellable *cancellable, GError **error)
{
GError *error_local = NULL;
- GVariant *gva;
+ GVariant *gva = NULL;
guint i;
GPtrArray *array = NULL;
gboolean ret;
--
cgit v0.10.2