* partial-stab.h (case N_FUN: case 'f':, case N_FUN: case 'F':)
authorJim Blandy <jimb@codesourcery.com>
Fri, 1 Jun 2001 21:17:50 +0000 (21:17 +0000)
committerJim Blandy <jimb@codesourcery.com>
Fri, 1 Jun 2001 21:17:50 +0000 (21:17 +0000)
Fix memory leak.

gdb/ChangeLog
gdb/partial-stab.h

index f5a7ac4..f3a4026 100644 (file)
@@ -1,5 +1,8 @@
 2001-06-01  Jim Blandy  <jimb@redhat.com>
 
+       * partial-stab.h (case N_FUN: case 'f':, case N_FUN: case 'F':)
+       Fix memory leak.
+
        * partial-stab.h: New complaint: function_outside_compilation_unit.
        (case N_FUN: case 'f':, case N_FUN: case 'F':): If pst is zero,
        complain, and don't try to set pst's start address.
index d6c6fd5..ebedef7 100644 (file)
@@ -586,6 +586,7 @@ switch (CUR_SYMBOL_TYPE)
             memcpy (name, namestring, name_len);
             name[name_len] = '\0';
             complain (&function_outside_compilation_unit, name);
+            xfree (name);
           }
        CUR_SYMBOL_VALUE += ANOFFSET (objfile->section_offsets, SECT_OFF_TEXT (objfile));
 #ifdef DBXREAD_ONLY
@@ -640,6 +641,7 @@ switch (CUR_SYMBOL_TYPE)
             memcpy (name, namestring, name_len);
             name[name_len] = '\0';
             complain (&function_outside_compilation_unit, name);
+            xfree (name);
           }
        CUR_SYMBOL_VALUE += ANOFFSET (objfile->section_offsets, SECT_OFF_TEXT (objfile));
 #ifdef DBXREAD_ONLY