diff options
Diffstat (limited to 'libdiskfs')
-rw-r--r-- | libdiskfs/lookup.c | 6 |
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) |