IMO, this is not an acceptable solution.

th_get_pathname() is part of the public API, and must not change behaviour
unless the major version of libtar is changed. This severely breaks 
compatibility
with existing programs, and affects portability a lot.

If a program uses libtar 1.2.11 on Solaris, th_get_pathname() returns a
strdup():ed pointer which must be free:d by the caller. If the same program
is compiled (also using libtar 1.2.11!) on Debian or Ubuntu, it must not free
the returned pointer. There is no way to know from the code if it must be
free:d or not.

If the original memory leak only happens for internal usage of th_get_pathname,
then another internal function should be added, and th_get_pathname can
use that function, but strdup() the return value.

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is a direct subscriber.
https://bugs.launchpad.net/bugs/41804

Title:
  Major memory leak

-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to