diff options
author | Keith Packard <keithp@keithp.com> | 2012-08-06 16:40:54 -0700 |
---|---|---|
committer | Keith Packard <keithp@keithp.com> | 2012-08-06 16:40:54 -0700 |
commit | 2100e72388a3dc174093d80c9723f021b4614d17 (patch) | |
tree | 940221b9426580993453c7a704f640699084374c /randr/rrproperty.c | |
parent | 4a6f42dda00ba3b5616f8a86f0d4c9a652c7d9d4 (diff) | |
parent | c37c65052f674cd58894ad0b9ec22928a62c624e (diff) |
Merge remote-tracking branch 'alanc/master'
Diffstat (limited to 'randr/rrproperty.c')
-rw-r--r-- | randr/rrproperty.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/randr/rrproperty.c b/randr/rrproperty.c index 7f0909287..67b546728 100644 --- a/randr/rrproperty.c +++ b/randr/rrproperty.c @@ -217,6 +217,8 @@ RRChangeOutputProperty(RROutputPtr output, Atom property, Atom type, !pScrPriv->rrOutputSetProperty(output->pScreen, output, prop->propertyName, &new_value)) { free(new_value.data); + if (add) + RRDestroyOutputProperty(prop); return BadValue; } free(prop_value->data); @@ -342,12 +344,18 @@ RRConfigureOutputProperty(RROutputPtr output, Atom property, /* * ranges must have even number of values */ - if (range && (num_values & 1)) + if (range && (num_values & 1)) { + if (add) + RRDestroyOutputProperty(prop); return BadMatch; + } new_values = malloc(num_values * sizeof(INT32)); - if (!new_values && num_values) + if (!new_values && num_values) { + if (add) + RRDestroyOutputProperty(prop); return BadAlloc; + } if (num_values) memcpy(new_values, values, num_values * sizeof(INT32)); |