r211449 - in /trunk/libiberty: ChangeLog cplus-...

palves@gcc.gnu.org palves@gcc.gnu.org
Wed Jun 11 10:57:00 GMT 2014


Author: palves
Date: Wed Jun 11 10:57:27 2014
New Revision: 211449

URL: http://gcc.gnu.org/viewcvs?rev=211449&root=gcc&view=rev
Log:
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.

Modified:
    trunk/libiberty/ChangeLog
    trunk/libiberty/cplus-dem.c



More information about the Gcc-cvs mailing list