|
From: Tom H. <to...@co...> - 2006-06-19 16:39:10
|
In message <200...@co...>
Verdi March <ver...@co...> wrote:
> valgrind reported the following as "definite lost". I thought this is
> the case of "still reachable", because I still hold a pointer to the
> allocated memory? At least this is what I understand from the user
> manual.
>
> I'm using suse 10.1 (32-bit version): valgrind-3.2.0-11.1,
> kernel-smp-2.6.16.13-4, glibc-2.4-31, and gcc-4.1.0-25.
>
>
> /***********************************/
> #include <stdio.h>
> #include <stdlib.h>
>
> int main() {
> int *ip;
> ip =(int *) malloc(sizeof(int));
> return 0;
> }
> /***********************************/
The only pointer to that memory is "ip" and once you return from
main that variables goes out of scope and you no longer have any
valid pointers to the memory.
Tom
--
Tom Hughes (to...@co...)
http://www.compton.nu/
|