summaryrefslogtreecommitdiff
path: root/randr/rrmode.c
diff options
context:
space:
mode:
authorJernej Azarija <azi.stdout@gmail.com>2007-11-18 11:44:36 -0500
committerAdam Jackson <ajax@aspartame.nwnk.net>2007-11-18 11:45:13 -0500
commita46c30c3be33ffb304a885503c8aaa78396ed3d9 (patch)
tree8590abd2feec2e46273d6a89a740f608494a686d /randr/rrmode.c
parentfac7e7e4e1809e865b9b3cf5b7eb69ba9d3a3759 (diff)
Bug #12531: RRModesForScreen can fail to allocate.
Diffstat (limited to 'randr/rrmode.c')
-rw-r--r--randr/rrmode.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/randr/rrmode.c b/randr/rrmode.c
index 11175810c..f060d2294 100644
--- a/randr/rrmode.c
+++ b/randr/rrmode.c
@@ -165,6 +165,8 @@ RRModesForScreen (ScreenPtr pScreen, int *num_ret)
int num_screen_modes = 0;
screen_modes = xalloc ((num_modes ? num_modes : 1) * sizeof (RRModePtr));
+ if (!screen_modes)
+ return NULL;
/*
* Add modes from all outputs