diff options
Diffstat (limited to 'src/mds-server/client.c')
-rw-r--r-- | src/mds-server/client.c | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/src/mds-server/client.c b/src/mds-server/client.c index 08205b2..0e8e0b5 100644 --- a/src/mds-server/client.c +++ b/src/mds-server/client.c @@ -21,10 +21,33 @@ #include <stdlib.h> #include <string.h> +#include <pthread.h> /** + * Release all resources assoicated with a client + * + * @param this The client information + */ +void client_destroy(client_t* restrict this) +{ + if (this->interception_conditions != NULL) + { + size_t i; + for (i = 0; i < this->interception_conditions_count; i++) + free(this->interception_conditions[i].condition); + free(this->interception_conditions); + } + if (this->mutex_created) + pthread_mutex_destroy(&(this->mutex)); + mds_message_destroy(&(this->message)); + free(this->send_pending); + free(this); +} + + +/** * Calculate the buffer size need to marshal client information * * @param this The client information |