syscalls: properly free the fd on an open failure

This commit is contained in:
Matheus
2022-09-20 16:59:40 -03:00
parent 5f9aba07b2
commit 44b6b26eb8
+2
View File
@@ -80,7 +80,9 @@ syscallret syscall_open(const char* pathname, int flags, mode_t mode){
if(file)
vfs_close(file);
fd_release(fd);
fd_free(&proc->fdtable, fd);
fd->node = NULL;
free(name);
return retv;