summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKeith Packard <keithp@keithp.com>2000-09-19 23:49:17 +0000
committerKeith Packard <keithp@keithp.com>2000-09-19 23:49:17 +0000
commit18692160c964c80ba83b63bc207660b6254e11cb (patch)
tree4be817867d7c710c9ab0b548b5e76788161d70f0
parentd6e151ce4deaff506c580da7e3baf055db1c3ae3 (diff)
kdrive: make sure allocation worked before accessing
-rw-r--r--hw/kdrive/src/kdrive.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/hw/kdrive/src/kdrive.c b/hw/kdrive/src/kdrive.c
index 3b69e4704..b4ce55353 100644
--- a/hw/kdrive/src/kdrive.c
+++ b/hw/kdrive/src/kdrive.c
@@ -21,7 +21,7 @@
* TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
* 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"
#ifdef PSEUDO8
@@ -465,9 +465,9 @@ KdAllocatePrivates (ScreenPtr pScreen)
kdGeneration = serverGeneration;
}
pScreenPriv = (KdPrivScreenPtr) xalloc(sizeof (*pScreenPriv));
- memset (pScreenPriv, '\0', sizeof (KdPrivScreenRec));
if (!pScreenPriv)
return FALSE;
+ memset (pScreenPriv, '\0', sizeof (KdPrivScreenRec));
KdSetScreenPriv (pScreen, pScreenPriv);
return TRUE;
}