net: lwm2m: Initialize socket FD to an invalid value
During registration, first thing LWM2M does is trying to close a socket indicated by sock_fd stored in its context. In case it is not initialized to some invalid value (-1 in this case), LWM2M may close an ambigous socket. Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
This commit is contained in:
parent
18c9c8cf27
commit
8d984b336e
1 changed files with 1 additions and 0 deletions
|
@ -891,6 +891,7 @@ void lwm2m_rd_client_start(struct lwm2m_ctx *client_ctx, const char *ep_name,
|
|||
lwm2m_ctx_event_cb_t event_cb)
|
||||
{
|
||||
client.ctx = client_ctx;
|
||||
client.ctx->sock_fd = -1;
|
||||
client.event_cb = event_cb;
|
||||
|
||||
set_sm_state(ENGINE_INIT);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue