From 1cef10dc44565a8ce40f5f0424e9fcc3f237fdbc Mon Sep 17 00:00:00 2001 From: "Michael I. Bushnell" Date: Tue, 16 Jul 1996 02:33:37 +0000 Subject: (diskfs_lookup): If we get an error from diskfs_checkdirmod, diskfs_nput the node we picked up; the caller won't want it. --- libdiskfs/lookup.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'libdiskfs') 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) -- cgit v1.2.3