On Wed, 25 Mar 2009, Martin Ettl wrote:
Hello,
i discovered an other issue using the static code analysis tool
cppcheck:
../cppcheck -q -f -a -j2 ncurses-5.7/
[ncurses-5.7/c++/cursesw.cc:301]: (all) Memory leak: W
the code, the tool complains about:
yes, I saw that too (experimented some with the tool, to see if it could
find other problems) it's not as obvious.
For the realloc's I'll have to work through the code and address the
issue.
(thanks)
int _nc_xx_ripoff_init(WINDOW *w, int ncols)
{
int res = ERR;
RIPOFFINIT init = *prip++;
if (init) {
NCursesWindow* W = new NCursesWindow(w,ncols);
res = init(*W);
}
return res;
}
Best regards
Ettl Martin
-------- Original-Nachricht --------
Datum: Sun, 22 Mar 2009 18:20:21 -0400 (EDT)
Von: Thomas Dickey <address@hidden>
An: Martin Ettl <address@hidden>
CC: address@hidden
Betreff: Re: found memory leak in ncurses-5.7
On Sun, 22 Mar 2009, Martin Ettl wrote:
Hi friends,
i detected a memory leak in ncurses version 5.7. In file
ncurses-5.7/ncurses/base/safe_sprintf.c at line 115, the function will
return -1 without
freeing the memory, allocated to variabel 'format'.
The memory leak was detected by using the static code analysis tool
cppcheck. I used the following command:
cppcheck -q ncurses-5.7/
[ncurses-5.7/ncurses/base/safe_sprintf.c:115]: (error) Memory leak:
format
thanks (I added this to my to-do list last week)
--
Thomas E. Dickey
http://invisible-island.net
ftp://invisible-island.net
--
Psssst! Schon vom neuen GMX MultiMessenger gehört? Der kann`s mit
allen: http://www.gmx.net/de/go/multimessenger01
--
Thomas E. Dickey
http://invisible-island.net
ftp://invisible-island.net