summaryrefslogtreecommitdiff
path: root/randr/rrmode.c
diff options
context:
space:
mode:
Diffstat (limited to 'randr/rrmode.c')
-rw-r--r--randr/rrmode.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/randr/rrmode.c b/randr/rrmode.c
index 56e5977b5..f5d3f9e54 100644
--- a/randr/rrmode.c
+++ b/randr/rrmode.c
@@ -89,8 +89,10 @@ RRModeCreate(xRRModeInfo * modeInfo, const char *name, ScreenPtr userScreen)
}
mode->mode.id = FakeClientID(0);
- if (!AddResource(mode->mode.id, RRModeType, (pointer) mode))
+ if (!AddResource(mode->mode.id, RRModeType, (pointer) mode)) {
+ free(newModes);
return NULL;
+ }
modes = newModes;
modes[num_modes++] = mode;