From c0c62e4c01a2c5481c537d57fd0c12ab067fb4b5 Mon Sep 17 00:00:00 2001 From: Ray Strode Date: Thu, 30 Aug 2018 13:04:56 -0400 Subject: common: remove unnecessary free This commit drops an erroneous free call, that would potentially free a dangling pointer. Luckily the error condition can never occur because the error code checked is never returned, so the free call is dead code. This commit removes the free call. A subsequent commit will fix the error code checking. --- common/gdm-common.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'common') diff --git a/common/gdm-common.c b/common/gdm-common.c index 871f9bfc..9683d557 100644 --- a/common/gdm-common.c +++ b/common/gdm-common.c @@ -408,10 +408,8 @@ gdm_get_login_window_session_id (const char *seat_id, res = sd_session_get_class (sessions[i], &service_class); if (res < 0) { - if (res == -ENOENT) { - free (service_class); + if (res == -ENOENT) continue; - } g_debug ("failed to determine class of session %s: %s", sessions[i], strerror (-res)); ret = FALSE; -- cgit v1.2.1