mgcp: Fix a filedescriptor leak in case the bind is failing.

This commit is contained in:
Holger Hans Peter Freyther 2010-08-06 03:00:17 +08:00
parent 0e01d09500
commit 6f36e92cab
1 changed files with 2 additions and 0 deletions

View File

@ -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;
}