diff options
Diffstat (limited to 'randr')
-rw-r--r-- | randr/rrproviderproperty.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/randr/rrproviderproperty.c b/randr/rrproviderproperty.c index e0a814ff8..ab601da9a 100644 --- a/randr/rrproviderproperty.c +++ b/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)); |