summaryrefslogtreecommitdiff
path: root/src/login
diff options
context:
space:
mode:
authorDavid Herrmann <dh.herrmann@gmail.com>2013-10-10 13:09:37 +0200
committerDavid Herrmann <dh.herrmann@gmail.com>2013-10-10 13:14:18 +0200
commit3f4fee033bf0f623de74f3e8a14c42b8ff81c36e (patch)
treee93619f60e111e91e4ebe93ff02b78084c4039bd /src/login
parentfd38203a2a7bfbdc6cb5fd4dc54378e70f7d6778 (diff)
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.
Diffstat (limited to 'src/login')
-rw-r--r--src/login/sd-login.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/login/sd-login.c b/src/login/sd-login.c
index 71d8c2942e..6c27dfeb75 100644
--- a/src/login/sd-login.c
+++ b/src/login/sd-login.c
@@ -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;