Re: More memory bugs

Subject: Re: More memory bugs
From: Mike Nordell (
Date: Tue Mar 20 2001 - 01:00:58 CST

Hubert Figuiere wrote:
> According to Dom Lachowicz <>:
> >
> > free() isn't guaranteed to work with NULL, and I'd rather not try to
> > (or delete[]) anything that is null. If you'd like to give this a try,
> delete works with NULL pointers and does nothing. But it is best to check
> the case in case of a broken library that may generate hard to trackdown
> bugs.

To be really correct, it's not a runtime library issue but a compiler issue.
When "delete"-ing a pointer, the compiler has to do something like the

  if (p) {
    operator delete(p);

The runtime library might however be involved in this logic when calling
delete[] on objects with non-trivial destructors.


This archive was generated by hypermail 2b25 : Tue Mar 20 2001 - 01:02:28 CST