[gnome-session] session-fill: Fix a leak inside a loop body
- From: Ray Strode <halfline src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-session] session-fill: Fix a leak inside a loop body
- Date: Fri, 10 Dec 2021 14:53:57 +0000 (UTC)
commit e47009d16a655fd422325cd9901dc99edd239904
Author: Philip Withnall <pwithnall endlessos org>
Date: Mon Nov 15 21:37:13 2021 +0000
session-fill: Fix a leak inside a loop body
Signed-off-by: Philip Withnall <pwithnall endlessos org>
gnome-session/gsm-session-fill.c | 6 +-----
1 file changed, 1 insertion(+), 5 deletions(-)
---
diff --git a/gnome-session/gsm-session-fill.c b/gnome-session/gsm-session-fill.c
index 6b31634d..93a6dbc0 100644
--- a/gnome-session/gsm-session-fill.c
+++ b/gnome-session/gsm-session-fill.c
@@ -212,7 +212,6 @@ find_valid_session_keyfile (const char *session)
int i;
GKeyFile *keyfile;
char *basename;
- char *path;
dirs = g_ptr_array_new ();
@@ -228,10 +227,9 @@ find_valid_session_keyfile (const char *session)
keyfile = NULL;
basename = g_strdup_printf ("%s.session", session);
- path = NULL;
for (i = 0; i < dirs->len; i++) {
- path = g_build_filename (dirs->pdata[i], "gnome-session", "sessions", basename, NULL);
+ g_autofree gchar *path = g_build_filename (dirs->pdata[i], "gnome-session", "sessions",
basename, NULL);
keyfile = get_session_keyfile_if_valid (path);
if (keyfile != NULL)
break;
@@ -241,8 +239,6 @@ find_valid_session_keyfile (const char *session)
g_ptr_array_free (dirs, TRUE);
if (basename)
g_free (basename);
- if (path)
- g_free (path);
return keyfile;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]