Print this page
Address Robert's feedback

Split Close
Expand all
Collapse all
          --- old/usr/src/cmd/dis/dis_util.c
          +++ new/usr/src/cmd/dis/dis_util.c
↓ open down ↓ 93 lines elided ↑ open up ↑
  94   94  
  95   95  /*
  96   96   * Since -C flag explicitly says C++, for now at least, force language to
  97   97   * C++
  98   98   */
  99   99  const char *
 100  100  dis_demangle(const char *name)
 101  101  {
 102  102          static char *demangled_name = NULL;
 103  103  
      104 +        /*
      105 +         * Since demangled_name is static, it may be preserved across
      106 +         * invocations.  As such, make sure any memory that might be present
      107 +         * from previous invocations is freed.
      108 +         */
 104  109          free(demangled_name);
 105  110          demangled_name = sysdemangle(name, SYSDEM_LANG_CPP, NULL);
 106  111          return ((demangled_name != NULL) ? demangled_name : name);
 107  112  }
    
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX