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:
@@ -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;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user