summaryrefslogtreecommitdiff
path: root/daemon/gdm-session-record.c
diff options
context:
space:
mode:
authorAlessandro Bono <alessandro.bono369@gmail.com>2022-11-08 17:33:05 +0100
committerRay Strode <halfline@gmail.com>2023-04-28 19:41:28 +0000
commitdeb2aa7c1eeaac5a1df37ce240f859d756b1a83f (patch)
treee99b2e992d84514ec2a01986e74054f780f48656 /daemon/gdm-session-record.c
parent11dced65306d0ad548db9c60698d7e20c8965551 (diff)
downloadgdm-deb2aa7c1eeaac5a1df37ce240f859d756b1a83f.tar.gz
gdm-session-record: Use g_auto*
Diffstat (limited to 'daemon/gdm-session-record.c')
-rw-r--r--daemon/gdm-session-record.c5
1 files changed, 1 insertions, 4 deletions
diff --git a/daemon/gdm-session-record.c b/daemon/gdm-session-record.c
index ca2fc2bc..f913dee3 100644
--- a/daemon/gdm-session-record.c
+++ b/daemon/gdm-session-record.c
@@ -114,11 +114,9 @@ record_set_host (UTMP *u,
const char *x11_display_name,
const char *host_name)
{
- char *hostname;
+ g_autofree char *hostname = NULL;
#if defined(HAVE_UT_UT_HOST)
- hostname = NULL;
-
/*
* Set ut_host to hostname:$DISPLAY if remote, otherwise set
* to $DISPLAY
@@ -137,7 +135,6 @@ record_set_host (UTMP *u,
#ifdef HAVE_UT_UT_SYSLEN
u->ut_syslen = MIN (strlen (hostname), sizeof (u->ut_host));
#endif
- g_free (hostname);
}
#endif
}