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
This commit is contained in:
Benjamin Jacobs 2016-06-07 09:42:49 -04:00 committed by Chris Michael
parent 05732c7472
commit ad2e21b023
1 changed files with 1 additions and 1 deletions

View File

@ -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)))