decl.c (cp_make_fname_decl): Free return value from fname_as_string.
authorAldy Hernandez <aldyh@redhat.com>
Fri, 28 May 2004 21:58:15 +0000 (21:58 +0000)
committerAldy Hernandez <aldyh@gcc.gnu.org>
Fri, 28 May 2004 21:58:15 +0000 (21:58 +0000)
* decl.c (cp_make_fname_decl): Free return value from
fname_as_string.

From-SVN: r82382

gcc/cp/ChangeLog
gcc/cp/decl.c

index 5ba480020551ea284cf971083fcce73cc57b6218..c436ce7559103d63c31ea62ccea1b484f403a5c4 100644 (file)
@@ -1,3 +1,8 @@
+2004-05-28  Aldy Hernandez  <aldyh@redhat.com>
+
+       * decl.c (cp_make_fname_decl): Free return value from
+       fname_as_string.
+
 2004-05-28  Mark Mitchell  <mark@codesourcery.com>
 
        PR c++/14668
index 8a464beba6870492a41c8f0003e06f277134f481..92f6d140b4b12843d299a64f1ae474a0e8cf395d 100644 (file)
@@ -3087,6 +3087,9 @@ cp_make_fname_decl (tree id, int type_dep)
   tree init = cp_fname_init (name, &type);
   tree decl = build_decl (VAR_DECL, id, type);
 
+  if (name)
+    free ((char *) name);
+
   /* As we're using pushdecl_with_scope, we must set the context.  */
   DECL_CONTEXT (decl) = current_function_decl;
   DECL_PRETTY_FUNCTION_P (decl) = type_dep;