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>
return errno;
fp = fdopen(dupfd, "r");
return errno;
fp = fdopen(dupfd, "r");
- if (!fp)
- return errno;
+ if (!fp) {
+ ret = errno;
+ close(dupfd);
+ goto out;
+ }