read_dentry_tree(): Do not leak duplicate dentries
authorEric Biggers <ebiggers3@gmail.com>
Wed, 22 May 2013 04:47:18 +0000 (23:47 -0500)
committerEric Biggers <ebiggers3@gmail.com>
Wed, 22 May 2013 04:47:18 +0000 (23:47 -0500)
src/dentry.c

index 5031719..86a82eb 100644 (file)
@@ -1970,6 +1970,7 @@ read_dentry_tree(const u8 metadata_resource[], u64 metadata_resource_len,
                                "at that path with the exact same name)",
                                child_type, dentry_full_path(duplicate),
                                duplicate_type);
                                "at that path with the exact same name)",
                                child_type, dentry_full_path(duplicate),
                                duplicate_type);
+                       free_dentry(child);
                } else {
                        inode_add_dentry(child, child->d_inode);
                        /* If there are children of this child, call this
                } else {
                        inode_add_dentry(child, child->d_inode);
                        /* If there are children of this child, call this