aboutsummaryrefslogtreecommitdiff
path: root/pk/syscall.c
diff options
context:
space:
mode:
Diffstat (limited to 'pk/syscall.c')
-rw-r--r--pk/syscall.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/pk/syscall.c b/pk/syscall.c
index 03eee27..f8d2157 100644
--- a/pk/syscall.c
+++ b/pk/syscall.c
@@ -145,8 +145,8 @@ int sys_openat(int dirfd, const char* name, int flags, int mode)
return PTR_ERR(file);
int fd = file_dup(file);
+ file_decref(file); // counteract file_dup's file_incref
if (fd < 0) {
- file_decref(file);
return -ENOMEM;
}