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:
parent
8b5326aa98
commit
28211c443c
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user