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:14:18 +02:00
parent fd38203a2a
commit 3f4fee033b
+1 -1
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;