From a0eb2a751c6f3e9c233772cd9af8e8ee1504d27a Mon Sep 17 00:00:00 2001 From: "Jasper St. Pierre" Date: Fri, 21 Feb 2014 11:22:42 -0500 Subject: logind-session: Fix invalid free in the error case utf8 needs to be initialized to NULL for the free for the early return, otherwise we try to free invalid data. --- src/login/logind-session.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/login/logind-session.c b/src/login/logind-session.c index 81d12cbce..548f04920 100644 --- a/src/login/logind-session.c +++ b/src/login/logind-session.c @@ -1008,7 +1008,7 @@ error: } void session_restore_vt(Session *s) { - _cleanup_free_ char *utf8; + _cleanup_free_ char *utf8 = NULL; int vt, kb = K_XLATE; struct vt_mode mode = { 0 }; -- cgit v1.2.3