util: add alloc check
authorAlan Hourihane <alanh@vmware.com>
Wed, 16 Jun 2010 17:10:34 +0000 (18:10 +0100)
committerAlan Hourihane <alanh@vmware.com>
Wed, 16 Jun 2010 17:10:34 +0000 (18:10 +0100)
src/gallium/auxiliary/util/u_upload_mgr.c

index 75d44432d9e7e9c1f23075df90bccf3e18ddac65..af229e61a00a8cb2cc000b402d37166ed1858332 100644 (file)
@@ -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;