gnugo-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [gnugo-devel] bugs report


From: Paul Pogonyshev
Subject: Re: [gnugo-devel] bugs report
Date: Sat, 12 Jul 2003 00:50:25 +0000
User-agent: KMail/1.5.9

Dan wrote:
> But what about dragon2? Pcibus wrote:
> > 1.8 engine\dragon.c 746 line. leak 504 bytes. (run more times)
> > dragon2 = malloc(number_of_dragons * sizeof(*dragon2));
> > This bug unknown reason, free() can`t free memory.
> > memory leak increase. 168,504,840 ...
> > 168 = sizeof(*dragon2). 168*3 = 504. 168*5=840.
> > number_of_dragons = 3 or number_of_dragons = 5.
>
> The code in question looks like this:
>
>   if (dragon2 != NULL)
>     free(dragon2);
>
>   dragon2 = malloc(number_of_dragons * sizeof(*dragon2));
>
> If indeed as Pcibus claims there is some reason dragon2 can't
> be deallocated, I guess this is a real example of a memory
> leak. Unlike the hash table and owl stack, malloc is called
> every move on this one.

it works just as written: it reallocates dragon2[].  it never
frees the array.

Paul




reply via email to

[Prev in Thread] Current Thread [Next in Thread]