Re: C++ std::string tries to free() a not allocated pointer ?
Re: C++ std::string tries to free() a not allocated pointer ?
- Subject: Re: C++ std::string tries to free() a not allocated pointer ?
- From: Clark Cox <email@hidden>
- Date: Wed, 18 Nov 2009 11:19:32 -0800
On Wed, Nov 18, 2009 at 10:45 AM, David Hayes <email@hidden> wrote:
> When you say the string length is zero does that mean that you are creating a std::string but not initializing it to any
> value?
>
> I would be surprised if it is using the stack. If you are creating a string and not initializing it with any value I would
> guess that std::string is initializing the pointer to NULL and the destructor is not checking for a valid pointer before
> calling free or delete.
That can't be it; there is absolutely nothing wrong with calling
free() or delete on a NULL pointer.
--
Clark S. Cox III
email@hidden
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden