From: Tobias Brunner Date: Mon, 25 Mar 2013 16:33:45 +0000 (+0100) Subject: error-notify: Close file descriptors in case clients are still connected X-Git-Tag: 5.0.3~45 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=237bb5d4670cc3be25a37ff32c5582dcbd7ddcbf;p=thirdparty%2Fstrongswan.git error-notify: Close file descriptors in case clients are still connected --- diff --git a/src/libcharon/plugins/error_notify/error_notify_socket.c b/src/libcharon/plugins/error_notify/error_notify_socket.c index fe3b6355d6..3ea657ba5c 100644 --- a/src/libcharon/plugins/error_notify/error_notify_socket.c +++ b/src/libcharon/plugins/error_notify/error_notify_socket.c @@ -176,6 +176,12 @@ static job_requeue_t accept_(private_error_notify_socket_t *this) METHOD(error_notify_socket_t, destroy, void, private_error_notify_socket_t *this) { + uintptr_t fd; + + while (this->connected->remove_last(this->connected, (void*)&fd) == SUCCESS) + { + close(fd); + } this->connected->destroy(this->connected); this->mutex->destroy(this->mutex); close(this->socket);