summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMiles Bader <miles@gnu.org>1996-07-28 02:07:49 +0000
committerMiles Bader <miles@gnu.org>1996-07-28 02:07:49 +0000
commitf36a186b7784e30c0f83018b7c3f8f77dc9062b4 (patch)
tree7585e2b6a3c490f0ea6dca44ac417e98b092734f
parentda5a13c67521f1aace2fe110111014780f9290fb (diff)
(diskfs_lookup): Don't nput *NP if we didn't find a file.
-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;
}