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 0c6e425603830f2bf74bef83523bc7fe1146de48..58453b516f24392a64016a657fb16754b5609e7c 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 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;
                 return r;
+        }
 
         session_swap_controller(s, t);
 
 
         session_swap_controller(s, t);