diff --git a/vl.c b/vl.c index 63d954bbcf78e3a66f96d7ba18f658c0b62c1b13..b246e47a58215f6c1ea320194b93e0b4b6f41fd6 100644 --- a/vl.c +++ b/vl.c @@ -2778,6 +2778,11 @@ DisplayState *get_displaystate(void) static void dumb_display_init(void) { DisplayState *ds = qemu_mallocz(sizeof(DisplayState)); + if (ds == NULL) { + fprintf(stderr, "dumb_display_init: DisplayState allocation failed\n"); + exit(1); + } + ds->surface = qemu_create_displaysurface(640, 480, 32, 640 * 4); register_displaystate(ds); }