www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1998/01/13/18:36:00

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?

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

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019