summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorThomas Hindoe Paaboel Andersen <phomes@gmail.com>2014-08-31 23:34:01 +0200
committerThomas Hindoe Paaboel Andersen <phomes@gmail.com>2014-08-31 23:41:10 +0200
commit13f493dc9ace9861c1f27c4d37e8cd6d52fe6a32 (patch)
tree2f3cd512f1c2575907dd4e0b6edc2d586caa8363 /src
parent9e60277835e61597011358afcdbfb3dd712ce128 (diff)
login: fix mem leak
Diffstat (limited to 'src')
-rw-r--r--src/login/logind-session.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/login/logind-session.c b/src/login/logind-session.c
index 0c6e425603..58453b516f 100644
--- a/src/login/logind-session.c
+++ b/src/login/logind-session.c
@@ -1114,8 +1114,10 @@ int session_set_controller(Session *s, const char *sender, bool force) {
* If logind crashes/restarts, we restore the controller during restart
* or reset the VT in case it crashed/exited, too. */
r = session_prepare_vt(s);
- if (r < 0)
+ if (r < 0) {
+ free(t);
return r;
+ }
session_swap_controller(s, t);