From: Alan Cox Date: Mon, 5 Mar 2018 19:29:47 +0000 (+0000) Subject: rename: fix leak I hope X-Git-Url: https://git.ndcode.org/public/gitweb.cgi?a=commitdiff_plain;h=3ca1ed8a130e8f86c9f879eeaf7c46533a233dee;p=FUZIX.git rename: fix leak I hope Rename needs some more thinking about --- diff --git a/Kernel/syscall_other.c b/Kernel/syscall_other.c index fc5597d9..95410ad9 100644 --- a/Kernel/syscall_other.c +++ b/Kernel/syscall_other.c @@ -94,9 +94,9 @@ arg_t _rename(void) goto nogood; } /* Drop the reference to the unlinked file */ - i_unlock_deref(dstp); - } - i_lock(dstp); + i_deref(dsti); + } else + i_lock(dstp); /* Ok we may proceed: we set up fname earlier */ if (!ch_link(dstp, "", lastname, srci)) { i_unlock(dstp);