From 3ef2e5f7ff25cfad87c7dbad7abe0c3bd3258846 Mon Sep 17 00:00:00 2001 From: BLINDAUER Emmanuel Date: Sun, 12 Nov 2017 11:58:45 +0100 Subject: [PATCH] don't forget a free use g_* --- sesman/sessionrecord.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sesman/sessionrecord.c b/sesman/sessionrecord.c index 22dbd3d8..2d0d8400 100644 --- a/sesman/sessionrecord.c +++ b/sesman/sessionrecord.c @@ -69,7 +69,7 @@ add_xtmp_entry(int pid, const char *line, const char *user, const char *rhostnam i--; } - hostname = strndup(rhostname, i); + hostname = g_strndup(rhostname, i); memset(&ut, 0, sizeof(ut)); @@ -97,6 +97,7 @@ add_xtmp_entry(int pid, const char *line, const char *user, const char *rhostnam log_message(LOG_LEVEL_DEBUG, "HAVE_UTMP_H"); updwtmp("/var/log/wtmp", &ut); #endif + g_free(hostname); return 0; }