mirror of git://gcc.gnu.org/git/gcc.git
Delete temporary string within demangler even in failure cases.
A call to demangle_template might allocate storage within a temporary string even if the call to demangle_template eventually returns failure. This will never cause the demangler to crash, but does leak memory, as a result I've not added any tests for this. Calling string_delete is safe, even if nothing is allocated into the string, the string is initialised with string_init, so we know the internal pointers are NULL. libiberty/ChangeLog * cplus-dem.c (do_type): Call string_delete even if the call to demangle_template fails. From-SVN: r211449
This commit is contained in:
parent
b785e0b875
commit
ac8345a525
|
@ -1,3 +1,8 @@
|
||||||
|
2014-06-11 Andrew Burgess <aburgess@broadcom.com>
|
||||||
|
|
||||||
|
* cplus-dem.c (do_type): Call string_delete even if the call to
|
||||||
|
demangle_template fails.
|
||||||
|
|
||||||
2014-06-01 Ray Donnelly <mingw.android@gmail.com>
|
2014-06-01 Ray Donnelly <mingw.android@gmail.com>
|
||||||
|
|
||||||
* pex-win32.c (argv_to_cmdline): Don't quote
|
* pex-win32.c (argv_to_cmdline): Don't quote
|
||||||
|
|
|
@ -3663,8 +3663,11 @@ do_type (struct work_stuff *work, const char **mangled, string *result)
|
||||||
string_delete (&temp);
|
string_delete (&temp);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
{
|
||||||
|
string_delete (&temp);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
else if (**mangled == 'Q')
|
else if (**mangled == 'Q')
|
||||||
{
|
{
|
||||||
success = demangle_qualified (work, mangled, &decl,
|
success = demangle_qualified (work, mangled, &decl,
|
||||||
|
|
Loading…
Reference in New Issue