aboutsummaryrefslogtreecommitdiff
path: root/pflocal/connq.c
diff options
context:
space:
mode:
authorMarcus Brinkmann <marcus@gnu.org>2001-02-12 17:24:36 +0000
committerMarcus Brinkmann <marcus@gnu.org>2001-02-12 17:24:36 +0000
commit2888457f4fc3ebfd5ec6e4f6baf5e02223b1c5c6 (patch)
treee5c428b9e17036ecffafcdbc7b14e6d9107fb706 /pflocal/connq.c
parent9fc0f76454246c2c2f3984928627a22c76beec5a (diff)
downloadhurd-2888457f4fc3ebfd5ec6e4f6baf5e02223b1c5c6.tar.gz
hurd-2888457f4fc3ebfd5ec6e4f6baf5e02223b1c5c6.tar.bz2
hurd-2888457f4fc3ebfd5ec6e4f6baf5e02223b1c5c6.zip
2001-02-11 Marcus Brinkmann <marcus@gnu.org>
* connq.c (connq_destroy): New function. * connq.h: Prototype connq_destroy. * sock.c (sock_free): Call connq_destroy when listen or connect queue exist.
Diffstat (limited to 'pflocal/connq.c')
-rw-r--r--pflocal/connq.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/pflocal/connq.c b/pflocal/connq.c
index 862c9a14..2b8d68a4 100644
--- a/pflocal/connq.c
+++ b/pflocal/connq.c
@@ -108,6 +108,20 @@ connq_create (struct connq **cq)
*cq = new;
return 0;
}
+
+/* Destroy a queue. */
+void
+connq_destroy (struct connq *cq)
+{
+ /* Everybody in the queue should hold a reference to the socket
+ containing the queue. */
+ assert (cq->length == 0);
+ /* Nevertheless, malloc(0) or realloc(0) might allocate some small
+ space. */
+ if (cq->queue)
+ free (cq->queue);
+ free (cq);
+}
/* ---------------------------------------------------------------- */