This is the mail archive of the gdb-patches@sources.redhat.com mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

PATCH: Plug a small memleak in valops.c


Why file a PR tomorrow for what you can fix today?  Committed as obvious,
before I forget about it.

-- 
Daniel Jacobowitz                           Carnegie Mellon University
MontaVista Software                         Debian GNU/Linux Developer

2002-07-10  Daniel Jacobowitz  <drow@mvista.com>

	* valops.c (find_overload_match): Free oload_syms.

Index: valops.c
===================================================================
RCS file: /cvs/src/src/gdb/valops.c,v
retrieving revision 1.63
diff -u -p -r1.63 valops.c
--- valops.c	3 Jul 2002 20:36:54 -0000	1.63
+++ valops.c	10 Jul 2002 17:12:25 -0000
@@ -2707,6 +2707,7 @@ find_overload_match (struct type **arg_t
   register int jj;
   register int ix;
   int static_offset;
+  struct cleanup *cleanups = NULL;
 
   char *obj_type_name = NULL;
   char *func_name = NULL;
@@ -2748,6 +2749,7 @@ find_overload_match (struct type **arg_t
         }
 
       oload_syms = make_symbol_overload_list (fsym);
+      cleanups = make_cleanup (xfree, oload_syms);
       while (oload_syms[++i])
 	num_fns++;
       if (!num_fns)
@@ -2904,6 +2906,9 @@ find_overload_match (struct type **arg_t
 	}
       *objp = temp;
     }
+  if (cleanups != NULL)
+    do_cleanups (cleanups);
+
   return oload_incompatible ? 100 : (oload_non_standard ? 10 : 0);
 }
 


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]