From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jim Blandy To: Daniel Berlin Cc: Charlie Mills , gdb-patches@sourceware.cygnus.com Subject: Re: Simple but crucial bug fix to gdb Date: Fri, 01 Jun 2001 14:17:00 -0000 Message-id: References: <3.0.5.32.20010530142745.01470ec0@pophost.pdxuxbre.lmc.com> <87hexzaozu.fsf@dynamic-addr-83-177.resnet.rochester.edu> X-SW-Source: 2001-06/msg00013.html Daniel Berlin writes: > Err, isn't this a memory leak? > > You never free the name after complaining. > > Same below 2001-06-01 Jim Blandy * partial-stab.h (case N_FUN: case 'f':, case N_FUN: case 'F':) Fix memory leak. Index: partial-stab.h =================================================================== RCS file: /cvs/src/src/gdb/partial-stab.h,v retrieving revision 1.10 diff -c -r1.10 partial-stab.h *** partial-stab.h 2001/06/01 20:37:11 1.10 --- partial-stab.h 2001/06/01 21:16:36 *************** *** 586,591 **** --- 586,592 ---- 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,645 **** --- 641,647 ---- 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