summaryrefslogtreecommitdiff
path: root/randr
diff options
context:
space:
mode:
authorEric Anholt <eric@anholt.net>2006-11-03 16:36:34 -0800
committerEric Anholt <eric@anholt.net>2006-11-03 16:36:34 -0800
commitcde8806c2930788ba8076e94651d391e45f3ccdb (patch)
treecf1441dd1d05c35f81254c4992638698a2cfc2e0 /randr
parent4056e6e79a4e37101d298ae29139c83d3816368b (diff)
Don't bump the refcnt if the new mode is NULL.
Diffstat (limited to 'randr')
-rw-r--r--randr/rrcrtc.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/randr/rrcrtc.c b/randr/rrcrtc.c
index c40dac129..76d0b6bf5 100644
--- a/randr/rrcrtc.c
+++ b/randr/rrcrtc.c
@@ -174,7 +174,8 @@ RRCrtcNotify (RRCrtcPtr crtc,
if (crtc->mode)
RRModeDestroy (crtc->mode);
crtc->mode = mode;
- mode->refcnt++;
+ if (mode != NULL)
+ mode->refcnt++;
RRCrtcChanged (crtc, TRUE);
}
if (x != crtc->x)