aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHolger Hans Peter Freyther <zecke@selfish.org>2010-04-22 12:05:23 +0800
committerHolger Hans Peter Freyther <zecke@selfish.org>2010-04-22 12:13:44 +0800
commit7e3724ad18119967cd0fbaaee601d3e0d06e5ad4 (patch)
treed2eccde0b106a947ec873d495d00f559fba6281b
parent569dccf947b36205d9cc156c231016005b277cdb (diff)
nat: Move the write queue init to the allocation function
This is required for unit tests that want to queue messages and see if we can provoke a memleak.
-rw-r--r--openbsc/src/nat/bsc_nat.c1
-rw-r--r--openbsc/src/nat/bsc_nat_utils.c1
2 files changed, 1 insertions, 1 deletions
diff --git a/openbsc/src/nat/bsc_nat.c b/openbsc/src/nat/bsc_nat.c
index 0a0a1252..20ddec27 100644
--- a/openbsc/src/nat/bsc_nat.c
+++ b/openbsc/src/nat/bsc_nat.c
@@ -676,7 +676,6 @@ static int ipaccess_listen_bsc_cb(struct bsc_fd *bfd, unsigned int what)
return -1;
}
- write_queue_init(&bsc->write_queue, 100);
bsc->write_queue.bfd.data = bsc;
bsc->write_queue.bfd.fd = ret;
bsc->write_queue.read_cb = ipaccess_bsc_read_cb;
diff --git a/openbsc/src/nat/bsc_nat_utils.c b/openbsc/src/nat/bsc_nat_utils.c
index a2078d00..d9fceaf8 100644
--- a/openbsc/src/nat/bsc_nat_utils.c
+++ b/openbsc/src/nat/bsc_nat_utils.c
@@ -70,6 +70,7 @@ struct bsc_connection *bsc_connection_alloc(struct bsc_nat *nat)
return NULL;
con->nat = nat;
+ write_queue_init(&con->write_queue, 100);
return con;
}