commit b0db8ff0ab6e89cbe4c25873c6b2a2e02201893f
parent baf96fdc4b7f02c0d34c03e463297008d8491198
Author: Vincent Forest <vincent.forest@meso-star.com>
Date: Wed, 26 Sep 2018 18:42:22 +0200
Fix a possible segmentation fault
Diffstat:
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/les2htcp.c b/src/les2htcp.c
@@ -872,7 +872,7 @@ main(int argc, char** argv)
exit:
grid_release(&grid);
THT_to_T_context_release(&THT_to_T_ctx);
- if(stream != stdout) CHK(fclose(stream) == 0);
+ if(stream && stream != stdout) CHK(fclose(stream) == 0);
if(nc != INVALID_ID) NC(close(nc));
if(mem_allocated_size() != 0) {
fprintf(stderr, "Memory leaks: %lu Bytes\n",