btrfs-progs: fix double free during scanning
authorDavid Sterba <dsterba@suse.com>
Fri, 2 Oct 2015 15:21:12 +0000 (17:21 +0200)
committerDavid Sterba <dsterba@suse.com>
Fri, 2 Oct 2015 15:56:40 +0000 (17:56 +0200)
commit1491d246c427f4fe13521b13fab64c91459ffd9e
tree52624e4e4b41f0f657dab21222f1a9185e71d0ce
parentafe33bc29b0fb4e38cd1f18fbc48b537bf5eddc5
btrfs-progs: fix double free during scanning

If there are different devices mounted to the same directory we can run
into double free issue in the scanning code and this can lead to a
crash. The dev_info_arg buffer allocation get_fs_info might be skipped,
eg. if the FS_INFO ioctl fails due to EPERM in older kernels. Reset the
pointer before each loop starts.

Signed-off-by: David Sterba <dsterba@suse.com>
cmds-filesystem.c