diff options
author | Robert Ancell <robert.ancell@canonical.com> | 2017-09-27 17:35:55 -0400 |
---|---|---|
committer | Robert Ancell <robert.ancell@canonical.com> | 2017-09-27 17:35:55 -0400 |
commit | 90c4278a35e4666e7c830fedc8826cd332a1753b (patch) | |
tree | f6625149b7e8da1573cfab7ed46c0a99523216eb /src/plymouth.c | |
parent | 2b7eaa44d401a0a187917e53385d079e688f5172 (diff) | |
download | lightdm-git-90c4278a35e4666e7c830fedc8826cd332a1753b.tar.gz |
Use g_auto to automatically free memory
Diffstat (limited to 'src/plymouth.c')
-rw-r--r-- | src/plymouth.c | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/src/plymouth.c b/src/plymouth.c index 03b31127..ec9377c8 100644 --- a/src/plymouth.c +++ b/src/plymouth.c @@ -24,18 +24,15 @@ static gboolean has_active_vt = FALSE; static gboolean plymouth_run_command (const gchar *command, gint *exit_status) { - gchar *command_line; + g_autofree gchar *command_line = NULL; gboolean result; - GError *error = NULL; + g_autoptr(GError) error = NULL; command_line = g_strdup_printf ("plymouth %s", command); result = g_spawn_command_line_sync (command_line, NULL, NULL, exit_status, &error); if (error) g_debug ("Could not run %s: %s", command_line, error->message); - g_clear_error (&error); - - g_free (command_line); return result; } |