Print this page
Address Robert's feedback

@@ -99,9 +99,14 @@
 const char *
 dis_demangle(const char *name)
 {
         static char *demangled_name = NULL;
 
+        /*
+         * Since demangled_name is static, it may be preserved across
+         * invocations.  As such, make sure any memory that might be present
+         * from previous invocations is freed.
+         */
         free(demangled_name);
         demangled_name = sysdemangle(name, SYSDEM_LANG_CPP, NULL);
         return ((demangled_name != NULL) ? demangled_name : name);
 }