__cxa_demangle memory ownership issue

Howard Hinnant hinnant at twcny.rr.com
Wed Jan 19 18:50:15 UTC 2011


Given:

char* __cxa_demangle (const char* mangled_name,
				   char* buf,
				   size_t* n,
				   int* status);

If buf and n are non-null and if __cxa_demangle returns NULL (e.g. because of an invalid mangled_name), does __cxa_demangle  free(buf) or not?  The spec seems ambiguous on this point.

Thanks,
Howard




More information about the cxx-abi-dev mailing list