Check for NULL pointer
authorAlan Hourihane <alanh@tungstengraphics.com>
Mon, 9 Jun 2008 15:24:15 +0000 (16:24 +0100)
committerAlan Hourihane <alanh@tungstengraphics.com>
Mon, 9 Jun 2008 15:25:01 +0000 (16:25 +0100)
src/mesa/drivers/dri/common/dri_util.c

index 6efdf4312a5952c0a4b6253b284a56fa0550772d..e2beae380ed2656b5d4901f11f2cd009c18ab097 100644 (file)
@@ -602,6 +602,8 @@ dri2CreateNewDrawable(__DRIscreen *screen, const __DRIconfig *config,
     __DRIdrawable *pdraw;
 
     pdraw = driCreateNewDrawable(screen, config, 0, 0, NULL, data);
+    if (!pdraw)
+       return NULL;
 
     pdraw->dri2.drawable_id = drawable_id;
     pdraw->dri2.tail = head;