mirror of
https://github.com/Mathewnd/Astral.git
synced 2026-11-01 23:18:21 +00:00
syscalls: properly free the fd on an open failure
This commit is contained in:
@@ -80,7 +80,9 @@ syscallret syscall_open(const char* pathname, int flags, mode_t mode){
|
|||||||
|
|
||||||
if(file)
|
if(file)
|
||||||
vfs_close(file);
|
vfs_close(file);
|
||||||
|
|
||||||
fd_release(fd);
|
fd_release(fd);
|
||||||
|
fd_free(&proc->fdtable, fd);
|
||||||
fd->node = NULL;
|
fd->node = NULL;
|
||||||
free(name);
|
free(name);
|
||||||
return retv;
|
return retv;
|
||||||
|
|||||||
Reference in New Issue
Block a user