Your message dated Sun, 16 Aug 2009 16:47:07 +0000
with message-id <[email protected]>
and subject line Bug#539626: fixed in cppcheck 1.35-1
has caused the Debian Bug report #539626,
regarding false memleak positive with realloc()
to be marked as done.
This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.
(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact [email protected]
immediately.)
--
539626: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=539626
Debian Bug Tracking System
Contact [email protected] with problems
--- Begin Message ---
Package: cppcheck
Version: 1.34-1
cppcheck erroneously reports e memory leak when used by realloc in the code
snippet shown below.
cppcheck -a test.c
Checking test.c...
[test.c:27]: (all) Memory leak: buf
test.c
~~~~
#include <stdio.h>
#include <stdlib.h>
void func()
{
char * buf, * new_buf;
buf = calloc( 10000, sizeof(char) );
if ( ! ( new_buf = realloc ( (char*)buf, 20000) ) )
free(buf); // ENOMEM
else
free(new_buf); // OK
}
int main()
{
while(1)
func();
return 0;
}
If the area pointed to by ptr was moved by realloc(), or in other words the
the reallocation succeeds, a free(ptr) is called internally, hence there is no
a memory leak with `buf', and we should free(new_buf).
If the reallocation fails the original block is left untouched, i.e. not freed
or moved, hence we should free(buf), and should *not* call free(new_buf);
thanks
--
pub 4096R/0E4BD0AB 2003-03-18 <people.fccf.net/danchev/key pgp.mit.edu>
--- End Message ---
--- Begin Message ---
Source: cppcheck
Source-Version: 1.35-1
We believe that the bug you reported is fixed in the latest version of
cppcheck, which is due to be installed in the Debian FTP archive:
cppcheck_1.35-1.diff.gz
to pool/main/c/cppcheck/cppcheck_1.35-1.diff.gz
cppcheck_1.35-1.dsc
to pool/main/c/cppcheck/cppcheck_1.35-1.dsc
cppcheck_1.35-1_i386.deb
to pool/main/c/cppcheck/cppcheck_1.35-1_i386.deb
cppcheck_1.35.orig.tar.gz
to pool/main/c/cppcheck/cppcheck_1.35.orig.tar.gz
A summary of the changes between this version and the previous one is
attached.
Thank you for reporting the bug, which will now be closed. If you
have further comments please address them to [email protected],
and the maintainer will reopen the bug report if appropriate.
Debian distribution maintenance software
pp.
Reijo Tomperi <[email protected]> (supplier of updated cppcheck
package)
(This message was generated automatically at their request; if you
believe that there is a problem with it please contact the archive
administrators by mailing [email protected])
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Format: 1.8
Date: Sun, 16 Aug 2009 18:37:26 +0300
Source: cppcheck
Binary: cppcheck
Architecture: source i386
Version: 1.35-1
Distribution: unstable
Urgency: low
Maintainer: Reijo Tomperi <[email protected]>
Changed-By: Reijo Tomperi <[email protected]>
Description:
cppcheck - Tool for static C/C++ code analysis
Closes: 532820 537362 539626
Changes:
cppcheck (1.35-1) unstable; urgency=low
.
* New upstream release
* False positive fixed. Closes: #539626
* Infinite loop fixed. Closes: #537362
* Several "invalid number of character" fixes. Closes: #532820
Checksums-Sha1:
aad2c1f6dd4c19104536e66224feaec3b98f7d7a 1676 cppcheck_1.35-1.dsc
acb22761997bc7d8a9bf2648b9aaa42ba2bcfe08 413997 cppcheck_1.35.orig.tar.gz
3a3e5c931a7cd798681ee7f24b93a4056401ddd8 3706 cppcheck_1.35-1.diff.gz
cdff09f27f3f60a6b6137233871697e16958e921 262540 cppcheck_1.35-1_i386.deb
Checksums-Sha256:
cf0b9f1ae7a86a96940d226375c41727540add1f90849490cb20b453ff8beefc 1676
cppcheck_1.35-1.dsc
535b9090c9238d3ca3d39e195be8e13eb25cd2403b8047e745555704a8780724 413997
cppcheck_1.35.orig.tar.gz
eab090cdc75874d76a577be6bfa87d40d312906ba0e06e06d5355c5d7d8cf369 3706
cppcheck_1.35-1.diff.gz
66d73a9ae76d02cace610bab2f8348ea24306c9dbd324b0bbc77cf090b342e04 262540
cppcheck_1.35-1_i386.deb
Files:
ab2a867ca5c5d7d545bda421ff58dd7e 1676 devel optional cppcheck_1.35-1.dsc
c59487ba0d1719fe62464262577952dd 413997 devel optional
cppcheck_1.35.orig.tar.gz
178bbd4038d5dc4960263b4003bf5043 3706 devel optional cppcheck_1.35-1.diff.gz
08945f297bee1c800f3322e35068c32e 262540 devel optional cppcheck_1.35-1_i386.deb
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)
iQIcBAEBAgAGBQJKiDWjAAoJEBxXDIkOS9CreqoQAIhUSbYCagkq1RRgrOTYJpDR
HP9R9du+3n0LJGeklNTnBwjmyK08vrvIobZUdFa0b/sAFMLKIP6pQImTidL2LDn2
BiuvPJGplIqZzdjGjOD2f3M4fwesaRFPdrRWiRvzWGoNFHGh8ASrTurTWhAZhuR6
0pRsuKhZyID5RQWcwFjwOP8TZ8Ybb5mobdb4cb2rRI5aOeKNAAxx/ylRymSzVN7H
GZ8CFkYTA7errj+Hh1Ry9uLQb6KEz5Oxi5oyn7sIV6vee274vpCTqODvFgNk45Nd
nrY+hqk6elzt9xIZjnGhRnnaqq9jzSBuxmZEOJB3bCDM8CJEYk7eO9B+Qzd4GU9Q
pSeZiEnRa+3RvajYUu6ColGSh3m01GOE5MPdFPX8HR6tTNWX28e/O9y7EPHv+h3m
5FrbXQJ8MyqZvJhEl/Z25N3/LPB2hZnzzGJvyRw9wve0nY5uoRMfMG42beYVSy2h
CSTJOI/6xhkVzycMe6GpjHmqwCGMHsAkQUfJXZJoFqwPvi7vdgnz8iEicptml5On
ZMVK1AQyhF1nnhMZp6F9mW80f8v5Fi34aHGTK4JjmjXaAC09aELL/p23wz5Gv2aP
TNGLYuPUd9yZk4uzppOBWRaqGICzyhNpUjwUXZXbzkK8lQiVwnOT5J0QaO3C3Wxe
fU3TgyHapxvXu3RfYPkx
=rlM+
-----END PGP SIGNATURE-----
--- End Message ---