Message-ID: <34BBF982.4525B8F9@eik.bme.hu>
Date: Wed, 14 Jan 1998 00:32:18 +0100
From: "Dr. Andr�s S�lyom" <solyom AT eik DOT bme DOT hu>
MIME-Version: 1.0
To: djgpp AT delorie DOT com
Subject: Q: How to check validity of a pointer?
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Precedence: bulk

One of my programs keep crashing on realloc() and I cannot find the
reason. I am allocating and reallocating some million times and somehow
some pointers in the program which were valid becomes invalid, usually
having a value of 0x09000000). I have tried many things (like using one
of DJ's malloc()'s, or compiling under linux with ElectricFence) to
catch the error but without success. So for debugging I can try to catch
the invalid pointers.
Is there any way to check a pointer for validity before dereferencing
it?

                                                    Andras