mgcp: Fix a filedescriptor leak in case the bind is failing.
This commit is contained in:
parent
0e01d09500
commit
6f36e92cab
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue