Fix two issues with the pm-powersave code

Signed-off-by: Richard Hughes <richard@hughsie.com>
This commit is contained in:
Roland Dreier 2009-06-28 08:15:52 +01:00 committed by Richard Hughes
parent e66bc06cfd
commit e808a5063b

View file

@ -457,7 +457,7 @@ dkp_daemon_set_pmutils_powersave (DkpDaemon *daemon, gboolean powersave)
{
gboolean ret;
gchar *command;
GError *error;
GError *error = NULL;
/* run script from pm-utils */
command = g_strdup_printf ("pm-powersave %s", powersave ? "true" : "false");
@ -466,8 +466,10 @@ dkp_daemon_set_pmutils_powersave (DkpDaemon *daemon, gboolean powersave)
if (!ret) {
egg_warning ("failed to run script: %s", error->message);
g_error_free (error);
goto out;
}
out:
g_free (command);
return ret;
}