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]

[OBVIOUS] ARI fix: Use xstrdup instead of strdup


A recent patch to remote.c
reintroduced a ARI rule critical warning.

http://sourceware.org/ml/gdb-cvs/2010-01/msg00106.html

strdup should not be used directly,
use xstrdup instead.

Checked in as obvious.

Pierre Muller
acting as ARI maintainer.

I was rethinking about this idea of sending new regressions
to gdb-patches list.
http://sourceware.org/ml/gdb-patches/2009-10/msg00164.html
Joel agreed in a reply to it that we could give it a try...
Should I set it up to direct new entries to the mailing list?



2010-03-31  Pierre Muller  <muller@ics.u-strasbg.fr>

	* src/gdb/remote.c (end_thread): Use xstrdup instead of strdup.

Index: src/gdb/remote.c
===================================================================
RCS file: /cvs/src/src/gdb/remote.c,v
retrieving revision 1.396
diff -u -p -r1.396 remote.c
--- src/gdb/remote.c	30 Mar 2010 15:45:13 -0000	1.396
+++ src/gdb/remote.c	31 Mar 2010 14:22:50 -0000
@@ -2450,7 +2450,7 @@ end_thread (struct gdb_xml_parser *parse
   struct threads_parsing_context *data = user_data;
 
   if (body_text && *body_text)
-    VEC_last (thread_item_t, data->items)->extra = strdup (body_text);
+    VEC_last (thread_item_t, data->items)->extra = xstrdup (body_text);
 }
 
 const struct gdb_xml_attribute thread_attributes[] = {


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