]> git.ipfire.org Git - thirdparty/strongswan.git/commitdiff
error-notify: Close file descriptors in case clients are still connected
authorTobias Brunner <tobias@strongswan.org>
Mon, 25 Mar 2013 16:33:45 +0000 (17:33 +0100)
committerTobias Brunner <tobias@strongswan.org>
Mon, 25 Mar 2013 17:34:54 +0000 (18:34 +0100)
src/libcharon/plugins/error_notify/error_notify_socket.c

index fe3b6355d665a67a96bc509c95b4480db6d4a4e6..3ea657ba5c34d0a4b01e3d9600c1c19f252b5f47 100644 (file)
@@ -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);