aboutsummaryrefslogtreecommitdiff
path: root/xorg-server/randr/rrproviderproperty.c
diff options
context:
space:
mode:
Diffstat (limited to 'xorg-server/randr/rrproviderproperty.c')
-rw-r--r--xorg-server/randr/rrproviderproperty.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/xorg-server/randr/rrproviderproperty.c b/xorg-server/randr/rrproviderproperty.c
index a24d9d784..be54f259e 100644
--- a/xorg-server/randr/rrproviderproperty.c
+++ b/xorg-server/randr/rrproviderproperty.c
@@ -216,6 +216,8 @@ RRChangeProviderProperty(RRProviderPtr provider, Atom property, Atom type,
if (pending && pScrPriv->rrProviderSetProperty &&
!pScrPriv->rrProviderSetProperty(provider->pScreen, provider,
prop->propertyName, &new_value)) {
+ if (add)
+ RRDestroyProviderProperty(prop);
free(new_value.data);
return BadValue;
}
@@ -342,12 +344,18 @@ RRConfigureProviderProperty(RRProviderPtr provider, Atom property,
/*
* ranges must have even number of values
*/
- if (range && (num_values & 1))
+ if (range && (num_values & 1)) {
+ if (add)
+ RRDestroyProviderProperty(prop);
return BadMatch;
+ }
new_values = malloc(num_values * sizeof(INT32));
- if (!new_values && num_values)
+ if (!new_values && num_values) {
+ if (add)
+ RRDestroyProviderProperty(prop);
return BadAlloc;
+ }
if (num_values)
memcpy(new_values, values, num_values * sizeof(INT32));