Btrfs-progs: chunk_recovery: fix mem leak and pthread_cancel call
authorRakesh Pandit <rakesh@tuxera.com>
Wed, 26 Mar 2014 19:34:30 +0000 (21:34 +0200)
committerDavid Sterba <dsterba@suse.cz>
Tue, 22 Apr 2014 12:33:44 +0000 (14:33 +0200)
commit30156b749bd7ceeec3f75f676c07aedafd26799c
tree80749e1b893c850364cad0de01604f41f86e606b
parent5d889503552d9cccc8a7df8fac8804a1b0d773a4
Btrfs-progs: chunk_recovery: fix mem leak and pthread_cancel call

Free memory if open call fails. Prevent pthread_cancel on threads
which have already finished successfully. If all calls to
pthread_create and pthread_join are successful, we mistakenly call
pthread_cancel because cancel_from and cancel_to are both zero.

Make POSIX.1-2001 happy by supplying a non-NULL second argument to
pthread_setcanceltype.

Signed-off-by: Rakesh Pandit <rakesh@tuxera.com>
Signed-off-by: David Sterba <dsterba@suse.cz>
chunk-recover.c