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.
This commit is contained in:
Jasper St. Pierre
2014-02-21 19:50:38 +01:00
committed by Kay Sievers
parent a2fef7701b
commit a0eb2a751c
+1 -1
View File
@@ -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 };