From ad2e21b02399c02a748bb8b8ab0dc10f85e6662d Mon Sep 17 00:00:00 2001 From: Benjamin Jacobs Date: Tue, 7 Jun 2016 09:42:49 -0400 Subject: [PATCH] elput: Missing pointer initialization. Summary: Calling free() on an uninitialized pointer leads to crash, that can occurs when sd_session_get_seat fails. Fixes T3785. Reviewers: devilhorns Subscribers: cedric, jpeg Maniphest Tasks: T3785 Differential Revision: https://phab.enlightenment.org/D4015 @fix --- src/lib/elput/elput_logind.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib/elput/elput_logind.c b/src/lib/elput/elput_logind.c index 22cb1b0..799a26a 100644 --- a/src/lib/elput/elput_logind.c +++ b/src/lib/elput/elput_logind.c @@ -427,7 +427,7 @@ _logind_connect(Elput_Manager **manager, const char *seat, unsigned int tty) if (ret < 0) { ERR("Failed to get session seat"); - free(s); + if (s) free(s); goto seat_err; } else if ((seat) && (s) && (strcmp(seat, s))) -- 2.7.4