Commit 6f8c1196 authored by Paul Szabo's avatar Paul Szabo Committed by Ray Strode

session-record: fix use after free

hostname is getting freed before it's getting used if ut_syslen
is available.

This commit moves the free down a couple of lines
parent 0539a8ba
......@@ -161,11 +161,10 @@ record_set_host (UTMP *u,
if (hostname != NULL) {
strncpy (u->ut_host, hostname, sizeof (u->ut_host));
g_debug ("using ut_host %.*s", (int) sizeof (u->ut_host), u->ut_host);
g_free (hostname);
u->ut_syslen = MIN (strlen (hostname), sizeof (u->ut_host));
g_free (hostname);
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment