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:10:30 +0000 (10:10 +0100)
commitc97df8e004de63e50384706d00adb590adcef054
tree79c59ea00f32bb21aeae390d697eb875d5a59a0b
parent864a5fb1c6066ade93a640a279bcd191952e4181
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