summaryrefslogtreecommitdiff
path: root/libdiskfs
diff options
context:
space:
mode:
authorMichael I. Bushnell <mib@gnu.org>1996-07-16 02:33:37 +0000
committerMichael I. Bushnell <mib@gnu.org>1996-07-16 02:33:37 +0000
commit1cef10dc44565a8ce40f5f0424e9fcc3f237fdbc (patch)
treeb9c572cc5e7cff629c09b904cb2288b1791fed14 /libdiskfs
parent35f1a0a133dc131cd889a3f8a3dd812d762d32f9 (diff)
(diskfs_lookup): If we get an error from diskfs_checkdirmod,
diskfs_nput the node we picked up; the caller won't want it.
Diffstat (limited to 'libdiskfs')
-rw-r--r--libdiskfs/lookup.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/libdiskfs/lookup.c b/libdiskfs/lookup.c
index 6baa78bb..d5fc0a4e 100644
--- a/libdiskfs/lookup.c
+++ b/libdiskfs/lookup.c
@@ -128,7 +128,11 @@ diskfs_lookup (struct node *dp, char *name, enum lookup_type type,
{
error_t err2 = diskfs_checkdirmod (dp, (err || !np) ? 0 : *np, cred);
if (err2)
- return err2;
+ {
+ if (np)
+ diskfs_nput (np);
+ return err2;
+ }
}
if ((type == LOOKUP || type == CREATE) && !err && np)