This is the mail archive of the gdb-patches@sourceware.org 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]

[commit] target-descriptions.c, tdesc_gdb_type, no need to call xstrdup.


The callee saves its own copy. This is just a memory leak.

Checked in.

2011-03-02  Michael Snyder  <msnyder@vmware.com>

	* target-descriptions.c (tdesc_gdb_type): No need to call
	xstrdup, callee saves a copy.

Index: target-descriptions.c
===================================================================
RCS file: /cvs/src/src/gdb/target-descriptions.c,v
retrieving revision 1.38
diff -u -p -u -p -r1.38 target-descriptions.c
--- target-descriptions.c	11 Jan 2011 21:53:25 -0000	1.38
+++ target-descriptions.c	2 Mar 2011 23:12:53 -0000
@@ -706,7 +706,7 @@ tdesc_gdb_type (struct gdbarch *gdbarch,
 	struct tdesc_type_flag *f;
 	int ix;
 
-	type = arch_flags_type (gdbarch, xstrdup (tdesc_type->name),
+	type = arch_flags_type (gdbarch, tdesc_type->name,
 				tdesc_type->u.f.size);
 	for (ix = 0;
 	     VEC_iterate (tdesc_type_flag, tdesc_type->u.f.flags, ix, f);

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