Fixed realloc return check.

This commit is contained in:
Armin Novak 2014-11-16 15:28:01 +01:00
parent 58d1853de7
commit ca7052fa84

View File

@ -203,8 +203,19 @@ void wl_end_paint(rdpContext* context)
display = context_w->display;
window = context_w->window;
realloc(window->data, gdi->width * gdi->height * 4);
memcpy(window->data, (void*) gdi->primary_buffer, gdi->width * gdi->height * 4);
data = realloc(window->data, gdi->width * gdi->height * 4));
if (!data)
{
if (window->data)
free(window->data);
window->data = NULL;
}
else
{
window->data = data;
memcpy(window->data, (void*) gdi->primary_buffer, gdi->width * gdi->height * 4);
}
wl_display_dispatch(display->display);
}