chiark / gitweb /
login: fix mem leak
authorThomas Hindoe Paaboel Andersen <phomes@gmail.com>
Sun, 31 Aug 2014 21:34:01 +0000 (23:34 +0200)
committerThomas Hindoe Paaboel Andersen <phomes@gmail.com>
Sun, 31 Aug 2014 21:41:10 +0000 (23:41 +0200)
src/login/logind-session.c

index 0c6e425..58453b5 100644 (file)
@@ -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);