diff --git a/vl.c b/vl.c index 773649f023..236f95efd7 100644 --- a/vl.c +++ b/vl.c @@ -3890,7 +3890,9 @@ int main(int argc, char **argv, char **envp) } } qemu_config_write(fp); - fclose(fp); + if (fp != stdout) { + fclose(fp); + } break; } case QEMU_OPTION_qtest: