Nanostack: fix error code

Return NSAPI_ERROR_NO_MEMORY if socket->open() fails
pull/7678/head
Juha Ylinen 2018-08-02 14:19:22 +03:00
parent 8f7024a226
commit 942b77255b
1 changed files with 2 additions and 2 deletions

View File

@ -552,8 +552,8 @@ nsapi_error_t Nanostack::socket_open(void **handle, nsapi_protocol_t protocol)
}
if (!socket->open()) {
delete socket;
tr_debug("socket_open() ret=%i", NSAPI_ERROR_DEVICE_ERROR);
return NSAPI_ERROR_DEVICE_ERROR;
tr_debug("socket_open() ret=%i", NSAPI_ERROR_NO_MEMORY);
return NSAPI_ERROR_NO_MEMORY;
}
*handle = (void*)socket;