* [PATCH] Fix xasprintf() usage in solib-aix5.c
@ 2001-03-26 22:29 Kevin Buettner
2001-03-27 1:46 ` Mark Kettenis
0 siblings, 1 reply; 3+ messages in thread
From: Kevin Buettner @ 2001-03-26 22:29 UTC (permalink / raw)
To: gdb-patches
I've just committed the change below.
* solib-aix5.c (build_so_lib_from_mapfile): Fix xasprintf() usage.
Index: solib-aix5.c
===================================================================
RCS file: /cvs/src/src/gdb/solib-aix5.c,v
retrieving revision 1.7
diff -u -p -r1.7 solib-aix5.c
--- solib-aix5.c 2001/03/16 18:06:44 1.7
+++ solib-aix5.c 2001/03/27 06:18:58
@@ -193,13 +193,14 @@ build_so_list_from_mapfile (int pid, lon
{
int mapbuf_allocation_size = 8192;
- char map_pathname[64];
+ char *map_pathname;
int map_fd;
/* Open the map file */
- xasprintf (map_pathname, "/proc/%d/map", pid);
+ xasprintf (&map_pathname, "/proc/%d/map", pid);
map_fd = open (map_pathname, O_RDONLY);
+ free (map_pathname);
if (map_fd < 0)
return 0;
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] Fix xasprintf() usage in solib-aix5.c
2001-03-26 22:29 [PATCH] Fix xasprintf() usage in solib-aix5.c Kevin Buettner
@ 2001-03-27 1:46 ` Mark Kettenis
2001-03-27 1:57 ` Kevin Buettner
0 siblings, 1 reply; 3+ messages in thread
From: Mark Kettenis @ 2001-03-27 1:46 UTC (permalink / raw)
To: Kevin Buettner; +Cc: gdb-patches
Kevin Buettner <kevinb@cygnus.com> writes:
> I've just committed the change below.
>
> * solib-aix5.c (build_so_lib_from_mapfile): Fix xasprintf() usage.
>
> Index: solib-aix5.c
> ===================================================================
> RCS file: /cvs/src/src/gdb/solib-aix5.c,v
> retrieving revision 1.7
> diff -u -p -r1.7 solib-aix5.c
> --- solib-aix5.c 2001/03/16 18:06:44 1.7
> +++ solib-aix5.c 2001/03/27 06:18:58
> @@ -193,13 +193,14 @@ build_so_list_from_mapfile (int pid, lon
>
> {
> int mapbuf_allocation_size = 8192;
> - char map_pathname[64];
> + char *map_pathname;
> int map_fd;
>
> /* Open the map file */
>
> - xasprintf (map_pathname, "/proc/%d/map", pid);
> + xasprintf (&map_pathname, "/proc/%d/map", pid);
> map_fd = open (map_pathname, O_RDONLY);
> + free (map_pathname);
Shouldn't that be xfree()?
> if (map_fd < 0)
> return 0;
>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] Fix xasprintf() usage in solib-aix5.c
2001-03-27 1:46 ` Mark Kettenis
@ 2001-03-27 1:57 ` Kevin Buettner
0 siblings, 0 replies; 3+ messages in thread
From: Kevin Buettner @ 2001-03-27 1:57 UTC (permalink / raw)
To: Mark Kettenis; +Cc: gdb-patches
On Mar 27, 11:46am, Mark Kettenis wrote:
> > + free (map_pathname);
>
> Shouldn't that be xfree()?
Indeed it should.
Thanks for catching this.
Kevin
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2001-03-27 1:57 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-03-26 22:29 [PATCH] Fix xasprintf() usage in solib-aix5.c Kevin Buettner
2001-03-27 1:46 ` Mark Kettenis
2001-03-27 1:57 ` Kevin Buettner
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox