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] Fix some ARI issues


Thanks to Andrew for pointing these out.

Checked in (mainline only).

Mark


Index: ChangeLog
from  Mark Kettenis  <kettenis@gnu.org>

	* fbsd-proc.c (child_pid_to_exec_file, fbsd_find_memory_regions):
	s/asprintf/xasprintf/.
	(fbsd_make_corefile_notes): s/strdup/xstrdup/.

Index: fbsd-proc.c
===================================================================
RCS file: /cvs/src/src/gdb/fbsd-proc.c,v
retrieving revision 1.1
diff -u -p -r1.1 fbsd-proc.c
--- fbsd-proc.c 31 Mar 2002 17:47:16 -0000 1.1
+++ fbsd-proc.c 8 Apr 2002 21:50:15 -0000
@@ -35,7 +35,7 @@ child_pid_to_exec_file (int pid)
   char *path;
   char *buf;
 
-  asprintf (&path, "/proc/%d/file", pid);
+  xasprintf (&path, "/proc/%d/file", pid);
   buf = xcalloc (MAXPATHLEN, sizeof (char));
   make_cleanup (xfree, path);
   make_cleanup (xfree, buf);
@@ -84,7 +84,7 @@ fbsd_find_memory_regions (int (*func) (C
   char protection[4];
   int read, write, exec;
 
-  asprintf (&mapfilename, "/proc/%ld/map", (long) pid);
+  xasprintf (&mapfilename, "/proc/%ld/map", (long) pid);
   mapfile = fopen (mapfilename, "r");
   if (mapfile == NULL)
     error ("Couldn't open %s\n", mapfilename);
@@ -145,7 +145,7 @@ fbsd_make_corefile_notes (bfd *obfd, int
   if (get_exec_file (0))
     {
       char *fname = strrchr (get_exec_file (0), '/') + 1;
-      char *psargs = strdup (fname);
+      char *psargs = xstrdup (fname);
 
       if (get_inferior_args ())
 	psargs = reconcat (psargs, psargs, " ", get_inferior_args (), NULL);


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