diff options
Diffstat (limited to 'src/driver/pe_driver_ctx.c')
-rw-r--r-- | src/driver/pe_driver_ctx.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/driver/pe_driver_ctx.c b/src/driver/pe_driver_ctx.c index 1054ac7..af1c0e3 100644 --- a/src/driver/pe_driver_ctx.c +++ b/src/driver/pe_driver_ctx.c @@ -148,7 +148,10 @@ int pe_get_driver_ctx( S_IRUSR|S_IWUSR|S_IRGRP|S_IROTH)) < 0)) return pe_get_driver_ctx_fail(meta); - if (!(ctx = pe_driver_ctx_alloc(meta,nunits))) + if (!(ctx = pe_driver_ctx_alloc(meta,nunits)) && output) + close(fdout); + + if (!ctx) return pe_get_driver_ctx_fail(meta); ctx->program = program; |