net: sockets: zsock_close: Be sure to free file descriptor

File descriptor I freed automagically when using POSIX subsystem's
close() function, but any subsys-adhoc functions like zsock_close()
should do that explicitly.

Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
This commit is contained in:
Paul Sokolovsky
2018-11-19 21:02:53 +03:00
committed by Carles Cufí
parent aa5bbd5dfe
commit 2e21a95fd4

View File

@@ -139,6 +139,8 @@ int _impl_zsock_close(int sock)
return -1;
}
z_free_fd(sock);
return zsock_close_ctx(ctx);
}