"...0d0cea2424ae97b27447dc64a7dbfae83c036c45b403392f0e8ba.png" did not exist on "d2802d0739dcc61af5e5ea00773ce7ddead4e9c2"
btrfs: fix leak in qgroup_subtree_accounting() error path
Coverity pointed this out; in the newly added qgroup_subtree_accounting(), if btrfs_find_all_roots() returns an error, we leak at least the parents pointer, and possibly the roots pointer, depending on what failure occurs. If btrfs_find_all_roots() returns an error, we need to free up all allocations before we return. "roots" is initialized to NULL, so it should be safe to free it unconditionally (ulist_free() handles that case). Cc: Mark Fasheh <mfasheh@suse.de> Signed-off-by:Eric Sandeen <sandeen@redhat.com> Reviewed-by:
Mark Fasheh <mfasheh@suse.de> Signed-off-by:
Chris Mason <clm@fb.com>
Loading
Please register or sign in to comment