Based on 13f493dc9ace9861c1f27c4d37e8cd6d52fe6a32 Mon Sep 17 00:00:00 2001
From: Thomas Hindoe Paaboel Andersen <phomes@gmail.com>
Date: Sun, 31 Aug 2014 23:34:01 +0200
Subject: [PATCH] login: fix mem leak

---
 src/login/logind-session.c |    4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

--- src/login/logind-session.c
+++ src/login/logind-session.c	2014-09-01 12:59:27.870235647 +0000
@@ -1101,8 +1101,10 @@ int session_set_controller(Session *s, c
          * If logind crashes/restarts, we restore the controller during restart
          * or reset the VT in case it crashed/exited, too. */
         r = session_mute_vt(s);
-        if (r < 0)
+        if (r < 0) {
+                free(t);
                 return r;
+        }
 
         session_swap_controller(s, t);
 
