diff options
author | Colin Watson <cjwatson@canonical.com> | 2013-01-29 13:57:53 +0000 |
---|---|---|
committer | Martin Pitt <martinpitt@gnome.org> | 2013-01-29 15:08:18 +0100 |
commit | b59d9848d40ded74a6ae71d1bc7b912a904da435 (patch) | |
tree | f2506542d34de4cac42605b702bc89673762d95f /src/linux/up-device-supply.c | |
parent | 60732b12d64c52e92e534dc9f711f414f2e0d41f (diff) | |
download | upower-b59d9848d40ded74a6ae71d1bc7b912a904da435.tar.gz |
Fix two memory leaks
up_device_supply_get_design_voltage(): up_device_supply_get_string() returns a
newly allocated copy.
up_history_finalize(): Forgot to free history->priv->dir
https://bugs.freedesktop.org/show_bug.cgi?id=60019
Diffstat (limited to 'src/linux/up-device-supply.c')
-rw-r--r-- | src/linux/up-device-supply.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/linux/up-device-supply.c b/src/linux/up-device-supply.c index 309c0e3..8462673 100644 --- a/src/linux/up-device-supply.c +++ b/src/linux/up-device-supply.c @@ -374,7 +374,7 @@ static gdouble up_device_supply_get_design_voltage (const gchar *native_path) { gdouble voltage; - const gchar *device_type; + gchar *device_type = NULL; /* design maximum */ voltage = sysfs_get_double (native_path, "voltage_max_design") / 1000000.0; @@ -416,6 +416,7 @@ up_device_supply_get_design_voltage (const gchar *native_path) g_warning ("no voltage values, using 10V as approximation"); voltage = 10.0f; out: + g_free (device_type); return voltage; } |