Skip to content

Commit d3ce0b2

Browse files
authored
Merge pull request #3534 from Keyun-Johan/mydoc
socket_new() 错误返回时的问题
2 parents 05cd6ea + 5ea6379 commit d3ce0b2

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

components/net/sal_socket/src/sal_socket.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -924,6 +924,7 @@ int sal_socket(int domain, int type, int protocol)
924924
sock = sal_get_socket(socket);
925925
if (sock == RT_NULL)
926926
{
927+
socket_delete(socket);
927928
return -1;
928929
}
929930

@@ -956,7 +957,7 @@ int sal_socket(int domain, int type, int protocol)
956957
sock->user_data = (void *) proto_socket;
957958
return sock->socket;
958959
}
959-
960+
socket_delete(socket);
960961
return -1;
961962
}
962963

0 commit comments

Comments
 (0)