mirror of
https://github.com/open5gs/open5gs.git
synced 2026-04-28 03:19:31 +00:00
free socket fd
call ogs_sock_destroy to free sock when fail to get socket fd
This commit is contained in:
parent
6ad320a97c
commit
bd080f5095
1 changed files with 2 additions and 0 deletions
|
|
@ -84,6 +84,8 @@ ogs_sock_t *ogs_sock_socket(int family, int type, int protocol)
|
|||
sock->family = family;
|
||||
sock->fd = socket(sock->family, type, protocol);
|
||||
if (sock->fd < 0) {
|
||||
ogs_sock_destroy(sock);
|
||||
|
||||
ogs_log_message(OGS_LOG_ERROR, ogs_socket_errno,
|
||||
"socket create(%d:%d:%d) failed", sock->family, type, protocol);
|
||||
return NULL;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue