|
From: Nandini C. (nandchan) <nan...@ci...> - 2009-02-16 07:07:24
|
It sure is and I expect Valgrind 3.4 to report it.But it doesn't report
memory leaks and heap block overrun when run with my test
program.However,Valgrind 3.2.3 reports the same errors when run with the
test program just like one'd expect it to.
-----Original Message-----
From: shuLhan [mailto:m.s...@gm...]
Sent: Monday, February 16, 2009 12:53 AM
To: val...@li...
Cc: Nandini Chandra (nandchan)
Subject: Re: [Valgrind-users] Unitialised value in ld.so, lib.so with
valgrind 3.4
On Monday 16 February 2009 12:08:05 Nandini Chandra (nandchan) wrote:
> Sample program:
> ---------------------------------------
> #include <stdlib.h>
>
> void foo(void)
> {
> int* x = malloc(10 * sizeof(int));
>
> x[10] = 0; // problem 1: heap block overrun
> } // problem 2: memory leak -- x not freed
>
This is a very basic C language error. 'x' only have index 0..9, not 10.
--
~ shuLhan ~
|