mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-22 22:10:10 +01:00
glcpp: Fix use-after-free error from #undef directive.
By taking advantage of the recently-added hash_table_remove function. With this change, all existing tests are now valgrind-clean.
This commit is contained in:
parent
d4f239de6e
commit
61ebc01dfe
1 changed files with 1 additions and 4 deletions
|
|
@ -202,10 +202,7 @@ control_line:
|
||||||
| HASH_UNDEF IDENTIFIER NEWLINE {
|
| HASH_UNDEF IDENTIFIER NEWLINE {
|
||||||
macro_t *macro = hash_table_find (parser->defines, $2);
|
macro_t *macro = hash_table_find (parser->defines, $2);
|
||||||
if (macro) {
|
if (macro) {
|
||||||
/* XXX: Need hash table to support a real way
|
hash_table_remove (parser->defines, $2);
|
||||||
* to remove an element rather than prefixing
|
|
||||||
* a new node with data of NULL like this. */
|
|
||||||
hash_table_insert (parser->defines, NULL, $2);
|
|
||||||
talloc_free (macro);
|
talloc_free (macro);
|
||||||
}
|
}
|
||||||
talloc_free ($2);
|
talloc_free ($2);
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue