diff options
-rw-r--r-- | libdiskfs/dir-renamed.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/libdiskfs/dir-renamed.c b/libdiskfs/dir-renamed.c index 69fd7fe3..f3e1948a 100644 --- a/libdiskfs/dir-renamed.c +++ b/libdiskfs/dir-renamed.c @@ -30,19 +30,20 @@ checkpath(struct node *source, struct protid *cred) { error_t err; - struct node *np; + struct node *np, *newnp; for (np = target, err = 0; /* nothing */; /* This special lookup does a diskfs_nput on its first argument when it succeeds. */ - err = diskfs_lookup (np, "..", LOOKUP | SPEC_DOTDOT, &np, 0, cred)) + err = diskfs_lookup (np, "..", LOOKUP | SPEC_DOTDOT, &newnp, 0, cred)) { if (err) { diskfs_nput (np); return err; } + np = newnp; if (np == source) { |