diff options
Diffstat (limited to 'src/gallium/winsys/sw/wrapper/wrapper_sw_winsys.c')
-rw-r--r-- | src/gallium/winsys/sw/wrapper/wrapper_sw_winsys.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/gallium/winsys/sw/wrapper/wrapper_sw_winsys.c b/src/gallium/winsys/sw/wrapper/wrapper_sw_winsys.c index 9a68d9faff6..d4d4270eb86 100644 --- a/src/gallium/winsys/sw/wrapper/wrapper_sw_winsys.c +++ b/src/gallium/winsys/sw/wrapper/wrapper_sw_winsys.c @@ -262,6 +262,9 @@ wrapper_sw_winsys_warp_pipe_screen(struct pipe_screen *screen) { struct wrapper_sw_winsys *wsw = CALLOC_STRUCT(wrapper_sw_winsys); + if (!wsw) + goto err; + wsw->base.displaytarget_create = wsw_dt_create; wsw->base.displaytarget_from_handle = wsw_dt_from_handle; wsw->base.displaytarget_map = wsw_dt_map; @@ -272,11 +275,12 @@ wrapper_sw_winsys_warp_pipe_screen(struct pipe_screen *screen) wsw->screen = screen; wsw->pipe = screen->context_create(screen, NULL); if (!wsw->pipe) - goto err; + goto err_free; return &wsw->base; -err: +err_free: FREE(wsw); +err: return NULL; } |