1
0
mirror of https://github.com/systemd/systemd.git synced 2025-03-19 22:50:17 +03:00

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 11:22:42 -05:00 committed by Kay Sievers
parent a2fef7701b
commit a0eb2a751c
Notes: Lennart Poettering 2014-02-24 03:42:15 +01:00
Backport: bugfix

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 };