-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Ever since gnulib changed the dirname module in late 2005, paxutils has
had a memleak (base_name was changed to malloc memory, and last_component
was added as the non-allocating variant).  Here's the patch:

2007-07-20  Eric Blake  <[EMAIL PROTECTED]>

        Avoid memory leak from gnulib dirname module.
        * lib/rtapelib.c (rmt_open__): Use last_component, not base_name.
        * paxlib/rtape.c (rmt_open): Likewise.

- --
Don't work too hard, make some time for fun as well!

Eric Blake             [EMAIL PROTECTED]
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.5 (Cygwin)
Comment: Public key at home.comcast.net/~ericblake/eblake.gpg
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFGoYbK84KuGfSFAYARAjByAJ9HwmQKr0mHKkfo125ytvddWGwv8gCeMQZh
cCv2xaUvvnb/D1dFfNVTbSg=
=+5W9
-----END PGP SIGNATURE-----
Index: lib/rtapelib.c
===================================================================
RCS file: /sources/paxutils/paxutils/lib/rtapelib.c,v
retrieving revision 1.6
diff -u -p -r1.6 rtapelib.c
--- lib/rtapelib.c      27 Jun 2007 13:49:33 -0000      1.6
+++ lib/rtapelib.c      21 Jul 2007 04:06:18 -0000
@@ -461,7 +461,7 @@ rmt_open__ (const char *file_name, int o
        return -1;
 #endif
       }
-    remote_shell_basename = base_name (remote_shell);
+    remote_shell_basename = last_component (remote_shell);
 
     /* Set up the pipes for the `rsh' command, and fork.  */
 
Index: paxlib/rtape.c
===================================================================
RCS file: /sources/paxutils/paxutils/paxlib/rtape.c,v
retrieving revision 1.5
diff -u -p -r1.5 rtape.c
--- paxlib/rtape.c      27 Jun 2007 13:49:34 -0000      1.5
+++ paxlib/rtape.c      21 Jul 2007 04:06:18 -0000
@@ -467,7 +467,7 @@ rmt_open (const char *file_name, int ope
        return -1;
 #endif
       }
-    remote_shell_basename = base_name (remote_shell);
+    remote_shell_basename = last_component (remote_shell);
 
     /* Set up the pipes for the `rsh' command, and fork.  */
 

Reply via email to