mirror of
https://github.com/X11Libre/xserver.git
synced 2026-03-24 10:14:52 +00:00
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>
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user