From: Carl Worth Date: Thu, 24 Jun 2010 01:30:55 +0000 (-0700) Subject: s_symbol: Close memory leak of symbol name. X-Git-Tag: 062012170305~10660^2~625^2~4^2~5 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=007efe50fdd87c8ceb2a700b6105ce6f00ba56e8;p=profile%2Fivi%2Fmesa.git 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. --- diff --git a/s_expression.cpp b/s_expression.cpp index 875d739..26be23e 100644 --- a/s_expression.cpp +++ b/s_expression.cpp @@ -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()