login: fix invalid free() in sd_session_get_vt()

We need to clear variables markes as _cleanup_free_. Otherwise, our
error-paths might corrupt random memory.
This commit is contained in:
David Herrmann 2013-10-10 13:09:37 +02:00
parent fd38203a2a
commit 3f4fee033b
Notes: Lennart Poettering 2014-02-17 18:55:27 +01:00
Backport: bugfix

View file

@ -350,7 +350,7 @@ _public_ int sd_session_get_tty(const char *session, char **tty) {
}
_public_ int sd_session_get_vt(const char *session, unsigned *vtnr) {
_cleanup_free_ char *vtnr_string;
_cleanup_free_ char *vtnr_string = NULL;
unsigned u;
int r;