summaryrefslogtreecommitdiffstats
path: root/openbsc/src
diff options
context:
space:
mode:
authorHolger Hans Peter Freyther <zecke@selfish.org>2010-08-06 03:00:17 +0800
committerHolger Hans Peter Freyther <zecke@selfish.org>2010-08-06 03:00:17 +0800
commit6f36e92cabc426c872a619bb253e08e54e48982c (patch)
treebee4b6f91b9d149d6cbd2efd32f4bdd85c56f7e3 /openbsc/src
parent0e01d0950030ea37420d079c8190ae19589e2c86 (diff)
mgcp: Fix a filedescriptor leak in case the bind is failing.
Diffstat (limited to 'openbsc/src')
-rw-r--r--openbsc/src/mgcp/mgcp_network.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/openbsc/src/mgcp/mgcp_network.c b/openbsc/src/mgcp/mgcp_network.c
index bbc46f418..2123db77c 100644
--- a/openbsc/src/mgcp/mgcp_network.c
+++ b/openbsc/src/mgcp/mgcp_network.c
@@ -346,6 +346,8 @@ static int create_bind(const char *source_addr, struct bsc_fd *fd, int port)
inet_aton(source_addr, &addr.sin_addr);
if (bind(fd->fd, (struct sockaddr *) &addr, sizeof(addr)) < 0) {
+ close(fd->fd);
+ fd->fd = -1;
return -1;
}