Re: Memory Leak Problem



Richard Maine wrote:
(snip)

I did notice one "obvious" error in the code, but it is probably of
little consequence. The very first executable statement in the code is
an allocate of rout to size n. Unfortunately, n hasn't yet been defined.
Thus this allocate is illegal. I also note that you never deallocate
that first allocation, and for that matter, you never do anything
constructive with it at all. You set rout to 0, but then never use rout
until after you allocate it to some presumably more sensible size.

That doesn't sound like "little consequence" to me.

If n is negative or very large I might expect unusual effects.

-- glen

.



Relevant Pages