mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-24 17:30:12 +01:00
s_symbol: Close memory leak of symbol name.
Easily done now that s_expression is allocated with talloc. Simply switch from new to talloc_strdup and the job is done. This closes the great majority (11263) of the remaining leaks in the glsl-orangebook-ch06-bump.frag test: total heap usage: 55,623 allocs, 55,546 frees (was 44,283 frees) This test is now 99.86% leak-free.
This commit is contained in:
parent
e01193af32
commit
007efe50fd
1 changed files with 2 additions and 2 deletions
|
|
@ -30,8 +30,8 @@
|
|||
|
||||
s_symbol::s_symbol(const char *tmp)
|
||||
{
|
||||
this->str = new char [strlen(tmp) + 1];
|
||||
strcpy(this->str, tmp);
|
||||
this->str = talloc_strdup (this, tmp);
|
||||
assert(this->str != NULL);
|
||||
}
|
||||
|
||||
s_list::s_list()
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue