diff options
Diffstat (limited to 'libdiskfs/lookup.c')
-rw-r--r-- | libdiskfs/lookup.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/libdiskfs/lookup.c b/libdiskfs/lookup.c index 2dd75a92..3ec9dd87 100644 --- a/libdiskfs/lookup.c +++ b/libdiskfs/lookup.c @@ -183,7 +183,13 @@ diskfs_lookup (struct node *dp, const char *name, enum lookup_type type, if (err2) { if (np && !err) - diskfs_nput (*np); + { + if (*np == dp) + diskfs_nrele (*np); + else + diskfs_nput (*np); + *np = 0; + } return err2; } } |