summaryrefslogtreecommitdiffstats
path: root/src/installation_proxy.c
diff options
context:
space:
mode:
authorGravatar Nikias Bassen2019-07-19 02:21:51 +0700
committerGravatar Nikias Bassen2019-07-19 02:21:51 +0700
commit98ac7da5255a69fa4620e325228a1c7d79ba42d7 (patch)
tree09b2c8ddc9f9336276d90c2e667da20d626a5c46 /src/installation_proxy.c
parente87c26ebe58aa9b778a06ebbb94659a1ef304e38 (diff)
downloadlibimobiledevice-98ac7da5255a69fa4620e325228a1c7d79ba42d7.tar.gz
libimobiledevice-98ac7da5255a69fa4620e325228a1c7d79ba42d7.tar.bz2
installation_proxy: Terminate worker thread before freeing property list service client to prevent segfault
Diffstat (limited to 'src/installation_proxy.c')
-rw-r--r--src/installation_proxy.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/installation_proxy.c b/src/installation_proxy.c
index 7c2d336..9a6f1ab 100644
--- a/src/installation_proxy.c
+++ b/src/installation_proxy.c
@@ -261,7 +261,7 @@ LIBIMOBILEDEVICE_API instproxy_error_t instproxy_client_free(instproxy_client_t
261 if (!client) 261 if (!client)
262 return INSTPROXY_E_INVALID_ARG; 262 return INSTPROXY_E_INVALID_ARG;
263 263
264 property_list_service_client_free(client->parent); 264 property_list_service_client_t parent = client->parent;
265 client->parent = NULL; 265 client->parent = NULL;
266 if (client->receive_status_thread) { 266 if (client->receive_status_thread) {
267 debug_info("joining receive_status_thread"); 267 debug_info("joining receive_status_thread");
@@ -269,6 +269,7 @@ LIBIMOBILEDEVICE_API instproxy_error_t instproxy_client_free(instproxy_client_t
269 thread_free(client->receive_status_thread); 269 thread_free(client->receive_status_thread);
270 client->receive_status_thread = THREAD_T_NULL; 270 client->receive_status_thread = THREAD_T_NULL;
271 } 271 }
272 property_list_service_client_free(parent);
272 mutex_destroy(&client->mutex); 273 mutex_destroy(&client->mutex);
273 free(client); 274 free(client);
274 275