[PATCH] Missing free() after tempnam() call (java.util.zip)
(I hope this is the right mailing list for this, if it isn't, please tell me where to post this :) ) I was looking at one warning coming from ld about the use of tmpname() function rather than something like mkstemp, and while looking at that, I found that the string returned by tempnam() was not being freed after use. I admit I don't have a Solaris box at hand to check if it's true there too, but at least Linux's and FreeBSD's versions of tempnam() allocates with malloc() the returned string. (My lack of a Solaris box at the moment is what stops me from trying to use mkstemp() already; I'll try to prepare a virtual machine with that as soon as I can). The attached very very trivial patch fixes the leak by freeing the string after use; it's a very small leak, but if I understand the code well (but I won't bet I do) if a software uses that code repeatedly, it might be significant. Anyway, I hope this can be of help. -- Diego "Flameeyes" Pettenò http://farragut.flameeyes.is-a-geek.org/
On Thu, 10 May 2007 03:28:45 +0200 Diego 'Flameeyes' Pettenò <flameeyes@gmail.com> wrote:
Anyway, I hope this can be of help.
Always double check that what you're attaching is what you had applied locally. This time is the right one. -- Diego "Flameeyes" Pettenò http://farragut.flameeyes.is-a-geek.org/
participants (1)
-
Diego 'Flameeyes' Pettenò