From 53eb0f11aac7ff18d24da8eedebfc9a055add822 Mon Sep 17 00:00:00 2001 From: Jeffrey Walton Date: Sat, 25 Jul 2015 02:02:41 -0400 Subject: [PATCH] Added check to guard against self-assignment --- queue.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/queue.cpp b/queue.cpp index d6993fef..752945f6 100644 --- a/queue.cpp +++ b/queue.cpp @@ -427,6 +427,8 @@ byte * ByteQueue::CreatePutSpace(size_t &size) ByteQueue & ByteQueue::operator=(const ByteQueue &rhs) { + if(this == &rhs) return *this; + Destroy(); CopyFrom(rhs); return *this;