summaryrefslogtreecommitdiff
path: root/dix/atom.c
diff options
context:
space:
mode:
authorMikhail Gusarov <dottedmag@dottedmag.net>2010-05-13 03:43:04 +0700
committerMikhail Gusarov <dottedmag@dottedmag.net>2010-05-13 06:16:31 +0700
commit28211c443c693a1ca3db5740d0128274a3eef723 (patch)
tree69788ff0740c0ba3145587965faf05d96923297a /dix/atom.c
parent8b5326aa98eba201dd78aea3dd7114e1a084489b (diff)
Fix warning: it's safe to pass atom strings > XA_LAST_PREDEFINED to free(3)
Signed-off-by: Mikhail Gusarov <dottedmag@dottedmag.net> Reviewed-by: Keith Packard <keithp@keithp.com>
Diffstat (limited to 'dix/atom.c')
-rw-r--r--dix/atom.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/dix/atom.c b/dix/atom.c
index ecfe4b0c7..6910dd5d1 100644
--- a/dix/atom.c
+++ b/dix/atom.c
@@ -180,8 +180,13 @@ FreeAtom(NodePtr patom)
FreeAtom(patom->left);
if(patom->right)
FreeAtom(patom->right);
- if (patom->a > XA_LAST_PREDEFINED)
- free(patom->string);
+ if (patom->a > XA_LAST_PREDEFINED) {
+ /*
+ * All strings above XA_LAST_PREDEFINED are strdup'ed, so it's safe to
+ * cast here
+ */
+ free((char *)patom->string);
+ }
free(patom);
}