mirror of
https://github.com/systemd/systemd
synced 2024-09-20 00:21:55 +00:00
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:
parent
fd38203a2a
commit
3f4fee033b
Notes:
Lennart Poettering
2014-02-17 18:55:27 +01:00
Backport: bugfix
|
@ -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;
|
||||
|
||||
|
|
Loading…
Reference in a new issue