diff --git a/src/driver/mdso_unit_ctx.c b/src/driver/mdso_unit_ctx.c index 14fbe27..ae90394 100644 --- a/src/driver/mdso_unit_ctx.c +++ b/src/driver/mdso_unit_ctx.c @@ -49,7 +49,10 @@ static FILE * mdso_stdin_to_tmp(const struct mdso_driver_ctx * dctx) if ((fdtmp = dup(ictx->fdtmpin)) < 0) return 0; - return fdopen(fdtmp,"r"); + if (!(ftmp = fdopen(fdtmp,"r"))) + close(fdtmp); + + return ftmp; } if (!(ftmp = tmpfile()))