Commit 8873e65e by Serge Hallyn Committed by Stéphane Graber

coverity: malloc the right size for btrs_node tree

We were allocating sizeof(tree) instead of sizeof(*tree). Signed-off-by: 's avatarSerge Hallyn <serge.hallyn@ubuntu.com> Acked-by: 's avatarStéphane Graber <stgraber@ubuntu.com>
parent 05d53f4c
......@@ -1587,7 +1587,7 @@ static struct my_btrfs_tree *create_my_btrfs_tree(u64 id, const char *path, int
{
struct my_btrfs_tree *tree;
tree = malloc(sizeof(tree));
tree = malloc(sizeof(struct my_btrfs_tree));
if (!tree)
return NULL;
tree->nodes = malloc(sizeof(struct mytree_node));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment