On 10/19/11 09:01, Dave Airlie wrote:
From: Dave Airlie<[email protected]>

Initialise the pAttr->values to NULL so if the values allocation
fails it just ends up as free(NULL).

Pointed out by coverity.

Signed-off-by: Dave Airlie<[email protected]>
---
  Xext/saver.c |    1 +
  1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/Xext/saver.c b/Xext/saver.c
index 142758c..c6bcafa 100644
--- a/Xext/saver.c
+++ b/Xext/saver.c
@@ -925,6 +925,7 @@ ScreenSaverSetAttributes (ClientPtr client)
        goto bail;
      }
      /* over allocate for override redirect */
+    pAttr->values = NULL;
      values = malloc((len + 1) * sizeof (unsigned long));
      if (!values)
      {

Could also just be done by:

    pAttr->values = values = malloc((len + 1) * sizeof (unsigned long));

and then not needing the later pAttr->values = values, but either way,
seems like a needed fix, so:

Reviewed-by: Alan Coopersmith <[email protected]>

--
        -Alan Coopersmith-        [email protected]
         Oracle Solaris Platform Engineering: X Window System

_______________________________________________
[email protected]: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: http://lists.x.org/mailman/listinfo/xorg-devel

Reply via email to