Check if the socket has been created successfully.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@42766 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -185,12 +185,17 @@ create_socket(int family, int type, int protocol, net_socket_private** _socket)
|
|||||||
struct net_socket_private* socket = new(std::nothrow) net_socket_private;
|
struct net_socket_private* socket = new(std::nothrow) net_socket_private;
|
||||||
if (socket == NULL)
|
if (socket == NULL)
|
||||||
return B_NO_MEMORY;
|
return B_NO_MEMORY;
|
||||||
|
status_t status = socket->InitCheck();
|
||||||
|
if (status != B_OK) {
|
||||||
|
delete socket;
|
||||||
|
return status;
|
||||||
|
}
|
||||||
|
|
||||||
socket->family = family;
|
socket->family = family;
|
||||||
socket->type = type;
|
socket->type = type;
|
||||||
socket->protocol = protocol;
|
socket->protocol = protocol;
|
||||||
|
|
||||||
status_t status = get_domain_protocols(socket);
|
status = get_domain_protocols(socket);
|
||||||
if (status != B_OK) {
|
if (status != B_OK) {
|
||||||
delete socket;
|
delete socket;
|
||||||
return status;
|
return status;
|
||||||
|
|||||||
Reference in New Issue
Block a user