From e87c26ebe58aa9b778a06ebbb94659a1ef304e38 Mon Sep 17 00:00:00 2001 From: Nikias Bassen Date: Fri, 19 Jul 2019 02:15:40 +0700 Subject: syslog_relay: Terminate worker thread before freeing service client to prevent segfault --- src/syslog_relay.c | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/src/syslog_relay.c b/src/syslog_relay.c index 0d71392..579908c 100644 --- a/src/syslog_relay.c +++ b/src/syslog_relay.c @@ -104,15 +104,8 @@ LIBIMOBILEDEVICE_API syslog_relay_error_t syslog_relay_client_free(syslog_relay_ { if (!client) return SYSLOG_RELAY_E_INVALID_ARG; - + syslog_relay_stop_capture(client); syslog_relay_error_t err = syslog_relay_error(service_client_free(client->parent)); - client->parent = NULL; - if (client->worker) { - debug_info("Joining syslog capture callback worker thread"); - thread_join(client->worker); - thread_free(client->worker); - client->worker = THREAD_T_NULL; - } free(client); return err; -- cgit v1.1-32-gdbae