bug-tar
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Bug-tar] memleak in paxutils


From: Eric Blake
Subject: [Bug-tar] memleak in paxutils
Date: Fri, 20 Jul 2007 22:08:42 -0600
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.5) Gecko/20070716 Thunderbird/2.0.0.5 Mnenhy/0.7.5.666

-----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  <address@hidden>

        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             address@hidden
-----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

[Prev in Thread] Current Thread [Next in Thread]