From 0686eb6c883b17aeb5408dddc2391cdf7ec11770 Mon Sep 17 00:00:00 2001 From: Roland Baer Date: Mon, 6 Aug 2007 11:52:37 +0300 Subject: [PATCH] randr forgotten xfree()'s --- randr/rrmode.c | 5 ++++- randr/rrproperty.c | 10 ++++++++-- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/randr/rrmode.c b/randr/rrmode.c index 1117581..4d778ce 100644 --- a/randr/rrmode.c +++ b/randr/rrmode.c @@ -80,8 +80,11 @@ RRModeCreate (xRRModeInfo *modeInfo, } mode->mode.id = FakeClientID(0); - if (!AddResource (mode->mode.id, RRModeType, (pointer) mode)) + if (!AddResource (mode->mode.id, RRModeType, (pointer) mode)) { + xfree (newModes); + xfree (mode); return NULL; + } modes = newModes; modes[num_modes++] = mode; diff --git a/randr/rrproperty.c b/randr/rrproperty.c index 5ac073f..11b83ea 100644 --- a/randr/rrproperty.c +++ b/randr/rrproperty.c @@ -209,6 +209,8 @@ RRChangeOutputProperty (RROutputPtr output, Atom property, Atom type, { if (new_value.data) xfree (new_value.data); + xfree(prop); + xfree(prop_value); return (BadValue); } if (prop_value->data) @@ -330,12 +332,16 @@ RRConfigureOutputProperty (RROutputPtr output, Atom property, /* * ranges must have even number of values */ - if (range && (num_values & 1)) + if (range && (num_values & 1)) { + xfree(prop); return BadMatch; + } new_values = xalloc (num_values * sizeof (INT32)); - if (!new_values && num_values) + if (!new_values && num_values) { + xfree(prop); return BadAlloc; + } if (num_values) memcpy (new_values, values, num_values * sizeof (INT32)); -- 1.5.2.3