diff --git a/src/kits/network/libnetapi/NetBuffer.cpp b/src/kits/network/libnetapi/NetBuffer.cpp index bc157f6877..ce036db3ca 100644 --- a/src/kits/network/libnetapi/NetBuffer.cpp +++ b/src/kits/network/libnetapi/NetBuffer.cpp @@ -66,12 +66,13 @@ BNetBuffer::BNetBuffer(BMessage* archive) : BNetBuffer& BNetBuffer::operator=(const BNetBuffer& buffer) { - delete fImpl; - - fImpl = new (std::nothrow) DynamicBuffer(*buffer.GetImpl()); - if (fImpl != NULL) - fInit = fImpl->InitCheck(); + if (&buffer != this) { + delete fImpl; + fImpl = new (std::nothrow) DynamicBuffer(*buffer.GetImpl()); + if (fImpl != NULL) + fInit = fImpl->InitCheck(); + } return *this; }