|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
From 13f493dc9ace9861c1f27c4d37e8cd6d52fe6a32 Mon Sep 17 00:00:00 2001
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
From: Thomas Hindoe Paaboel Andersen <phomes@gmail.com>
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
Date: Sun, 31 Aug 2014 23:34:01 +0200
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
Subject: [PATCH] login: fix mem leak
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
---
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
src/login/logind-session.c | 4 +++-
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
1 file changed, 3 insertions(+), 1 deletion(-)
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
diff --git a/src/login/logind-session.c b/src/login/logind-session.c
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
index 0c6e425603..58453b516f 100644
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
--- a/src/login/logind-session.c
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
+++ b/src/login/logind-session.c
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
@@ -1114,8 +1114,10 @@ int session_set_controller(Session *s, const char *sender, bool force) {
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
* If logind crashes/restarts, we restore the controller during restart
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
* or reset the VT in case it crashed/exited, too. */
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
r = session_prepare_vt(s);
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
- if (r < 0)
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
+ if (r < 0) {
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
+ free(t);
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
return r;
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
+ }
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
session_swap_controller(s, t);
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
|