dri: Fix problems with unitialized values in dri screen object.
authorPauli Nieminen <suokkos@gmail.com>
Fri, 7 Aug 2009 17:02:22 +0000 (10:02 -0700)
committerBrian Paul <brianp@vmware.com>
Fri, 7 Aug 2009 19:48:26 +0000 (13:48 -0600)
This fixes crash in r200 KMS driver when pSAREA was set to 1 randomly because of memory wasn't cleared.

Signed-off-by: Pauli Nieminen <suokkos@gmail.com>
src/mesa/drivers/dri/common/dri_util.c

index 1d940603fa876b7d8d3bee63e7503ee95681065f..e48e10d7c061f6e73ea70cbf4bcbe689e92e2ef9 100644 (file)
@@ -778,7 +778,7 @@ dri2CreateNewScreen(int scrn, int fd,
     if (driDriverAPI.InitScreen2 == NULL)
         return NULL;
 
-    psp = _mesa_malloc(sizeof(*psp));
+    psp = _mesa_calloc(sizeof(*psp));
     if (!psp)
        return NULL;