Fix double close issue 81/279881/1
authorHwankyu Jhun <h.jhun@samsung.com>
Fri, 19 Aug 2022 00:48:12 +0000 (00:48 +0000)
committerHwankyu Jhun <h.jhun@samsung.com>
Fri, 19 Aug 2022 00:48:56 +0000 (00:48 +0000)
When calling g_io_channel_shutdown(), the file descriptor is closed.
Calling the close in the __destroy_client_channel() is not needed.

Change-Id: I443253f29c000adcdae87f74c415b00de75223af
Signed-off-by: Hwankyu Jhun <h.jhun@samsung.com>
src/aul_launch.c

index 18dbe8a..e6a0d33 100644 (file)
@@ -113,9 +113,6 @@ static void __destroy_client_channel(gpointer data)
        g_rec_mutex_unlock(&channel->mutex);
        g_rec_mutex_clear(&channel->mutex);
 
-       if (channel->fd > -1)
-               close(channel->fd);
-
        free(channel);
 }
 
@@ -620,6 +617,7 @@ static bool __connected_event_cb(int fd, int condition, void *user_data)
                _E("Failed to add io job. error(%d)", ret);
                __remove_client_channel(channel);
                __destroy_client_channel(channel);
+               close(clifd);
                return true;
        }