btrfs: tests: Fix a memory leak in error handling path in 'run_test()'
authorChristophe JAILLET <christophe.jaillet@wanadoo.fr>
Sun, 10 Sep 2017 11:19:38 +0000 (13:19 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 20 Dec 2017 09:07:31 +0000 (10:07 +0100)
commit7fab68e1f7308b2b7e3ebdd2483eb7a9572ccec5
treee3093fa70f234844d69cffaa22fc09c5b19b125f
parentb7ada2c0ea291e7bf22b51745afd9f1ccfc91292
btrfs: tests: Fix a memory leak in error handling path in 'run_test()'

[ Upstream commit 9ca2e97fa3c3216200afe35a3b111ec51cc796d2 ]

If 'btrfs_alloc_path()' fails, we must free the resources already
allocated, as done in the other error handling paths in this function.

Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Reviewed-by: Qu Wenruo <quwenruo.btrfs@gmx.com>
Signed-off-by: David Sterba <dsterba@suse.com>
Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fs/btrfs/tests/free-space-tree-tests.c