summaryrefslogtreecommitdiff
path: root/libdiskfs/dir-rename.c
diff options
context:
space:
mode:
Diffstat (limited to 'libdiskfs/dir-rename.c')
-rw-r--r--libdiskfs/dir-rename.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/libdiskfs/dir-rename.c b/libdiskfs/dir-rename.c
index 6fc7e0f5..0bda7b91 100644
--- a/libdiskfs/dir-rename.c
+++ b/libdiskfs/dir-rename.c
@@ -138,6 +138,7 @@ diskfs_S_dir_rename (struct protid *fromcred,
{
diskfs_drop_dirstat (tdp, ds);
diskfs_nrele (fnp);
+ diskfs_nput (tnp);
mutex_unlock (&tdp->lock);
return EISDIR;
}
@@ -149,6 +150,8 @@ diskfs_S_dir_rename (struct protid *fromcred,
{
diskfs_drop_dirstat (tdp, ds);
diskfs_nput (fnp);
+ if (tnp)
+ diskfs_nput (tnp);
mutex_unlock (&tdp->lock);
return EMLINK;
}