Skip to content

Commit f09c7d6

Browse files
committed
net: posix: Fix close() not closing sockets properly
With CONFIG_POSIX_API enabled close() does not call sock_obj_core_dealloc. This results in sockets not being closed properly, which can be verified by running the shell command 'net sockets' Signed-off-by: Andreas Ålgård <[email protected]>
1 parent 9c0f92d commit f09c7d6

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

lib/os/fdtable.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -371,6 +371,8 @@ int zvfs_close(int fd)
371371

372372
zvfs_free_fd(fd);
373373

374+
(void)sock_obj_core_dealloc(fd);
375+
374376
return res;
375377
}
376378

0 commit comments

Comments
 (0)