kernel/fs: Fix another instance of free() being called on a FD.

Fixes the second panic in #15213.
This commit is contained in:
Augustin Cavalier 2019-08-08 23:34:40 -04:00
parent b711002d34
commit 6a23120503

View File

@ -361,8 +361,10 @@ create_socket_fd(net_socket* socket, bool kernel)
// publish it
int fd = new_fd(get_current_io_context(kernel), descriptor);
if (fd < 0)
free(descriptor);
if (fd < 0) {
descriptor->ops = NULL;
put_fd(descriptor);
}
return fd;
}