client: close dup'ed descriptor if fdopen() fails
authorJens Axboe <axboe@kernel.dk>
Fri, 15 Jun 2018 15:18:04 +0000 (09:18 -0600)
committerJens Axboe <axboe@kernel.dk>
Fri, 15 Jun 2018 15:18:04 +0000 (09:18 -0600)
commitaf84cd66149507424814cf9c0b4950f4cf66e3b7
tree6d842de47c75214143c226a134b373c37f935042
parentec9e13345f3f433f3693891864cf794206cdd057
client: close dup'ed descriptor if fdopen() fails

The saga continues... Ensure that we close the dup'ed descriptor,
if we give up due to fdopen() failure.

Reported-by: Bart Van Assche <bart.vanassche@wdc.com>
Fixes: ec9e13345f3f ("client: check return of dup(2)")
Signed-off-by: Jens Axboe <axboe@kernel.dk>
client.c