kdrive: make sure allocation worked before accessing
This commit is contained in:
parent
d6e151ce4d
commit
18692160c9
|
@ -21,7 +21,7 @@
|
||||||
* TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
* TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
||||||
* PERFORMANCE OF THIS SOFTWARE.
|
* PERFORMANCE OF THIS SOFTWARE.
|
||||||
*/
|
*/
|
||||||
/* $XFree86: xc/programs/Xserver/hw/kdrive/kdrive.c,v 1.6 2000/08/26 00:24:37 keithp Exp $ */
|
/* $XFree86: xc/programs/Xserver/hw/kdrive/kdrive.c,v 1.7 2000/09/15 15:18:59 keithp Exp $ */
|
||||||
|
|
||||||
#include "kdrive.h"
|
#include "kdrive.h"
|
||||||
#ifdef PSEUDO8
|
#ifdef PSEUDO8
|
||||||
|
@ -465,9 +465,9 @@ KdAllocatePrivates (ScreenPtr pScreen)
|
||||||
kdGeneration = serverGeneration;
|
kdGeneration = serverGeneration;
|
||||||
}
|
}
|
||||||
pScreenPriv = (KdPrivScreenPtr) xalloc(sizeof (*pScreenPriv));
|
pScreenPriv = (KdPrivScreenPtr) xalloc(sizeof (*pScreenPriv));
|
||||||
memset (pScreenPriv, '\0', sizeof (KdPrivScreenRec));
|
|
||||||
if (!pScreenPriv)
|
if (!pScreenPriv)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
memset (pScreenPriv, '\0', sizeof (KdPrivScreenRec));
|
||||||
KdSetScreenPriv (pScreen, pScreenPriv);
|
KdSetScreenPriv (pScreen, pScreenPriv);
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue