From: Alan Hourihane Date: Wed, 16 Jun 2010 17:10:34 +0000 (+0100) Subject: util: add alloc check X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=867478b6f6fe3ad76c3d1d75b2b907f59b9a649c;p=mesa.git util: add alloc check --- diff --git a/src/gallium/auxiliary/util/u_upload_mgr.c b/src/gallium/auxiliary/util/u_upload_mgr.c index 75d44432d9e..af229e61a00 100644 --- a/src/gallium/auxiliary/util/u_upload_mgr.c +++ b/src/gallium/auxiliary/util/u_upload_mgr.c @@ -59,6 +59,8 @@ struct u_upload_mgr *u_upload_create( struct pipe_context *pipe, unsigned usage ) { struct u_upload_mgr *upload = CALLOC_STRUCT( u_upload_mgr ); + if (!upload) + return NULL; upload->pipe = pipe; upload->default_size = default_size;