Hi all,
I wonder if this is a memory leak at the following code embedded with
description.

file: bfd/dwarf2.c

static bfd_boolean
scan_unit_for_symbols(struct comp_unit *unit) {
 ...
 //line 2149
 for (i = 0; i < abbrev->num_attrs; ++i) {
   info_ptr = read_attribute (&attr, &abbrev->attrs[i], unit, info_ptr);
 if (info_ptr == NULL)
   goto fail;

 if (func)
   {
     switch (attr.name) {
       case DW_AT_call_file:
         //Should we free func->caller_file before this assignment,
         //Since attr.name may be "DW_AT_call_file" twice?
         //The fix may be:
         // if (func->caller_file) free(func->caller_file);
         func->caller_file = concat_filename (unit->line_table,
                                              attr.u.val);
         break;
         ...
       }
 }
}

-- 
Zhenbo Xu
_______________________________________________
bug-binutils mailing list
bug-binutils@gnu.org
https://lists.gnu.org/mailman/listinfo/bug-binutils

Reply via email to