summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--libdiskfs/lookup.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libdiskfs/lookup.c b/libdiskfs/lookup.c
index f38efed2..40ce8937 100644
--- a/libdiskfs/lookup.c
+++ b/libdiskfs/lookup.c
@@ -129,7 +129,7 @@ diskfs_lookup (struct node *dp, char *name, enum lookup_type type,
error_t err2 = diskfs_checkdirmod (dp, (err || !np) ? 0 : *np, cred);
if (err2)
{
- if (np)
+ if (np && !err)
diskfs_nput (*np);
return err2;
}