Skip to content

Commit

Permalink
installation_proxy: Terminate worker thread before freeing property l…
Browse files Browse the repository at this point in the history
…ist service client to prevent segfault
  • Loading branch information
nikias committed Jul 18, 2019
1 parent e87c26e commit 98ac7da
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/installation_proxy.c
Original file line number Diff line number Diff line change
Expand Up @@ -261,14 +261,15 @@ LIBIMOBILEDEVICE_API instproxy_error_t instproxy_client_free(instproxy_client_t
if (!client)
return INSTPROXY_E_INVALID_ARG;

property_list_service_client_free(client->parent);
property_list_service_client_t parent = client->parent;
client->parent = NULL;
if (client->receive_status_thread) {
debug_info("joining receive_status_thread");
thread_join(client->receive_status_thread);
thread_free(client->receive_status_thread);
client->receive_status_thread = THREAD_T_NULL;
}
property_list_service_client_free(parent);
mutex_destroy(&client->mutex);
free(client);

Expand Down

0 comments on commit 98ac7da

Please sign in to comment.