mirror of
https://github.com/znc/znc.git
synced 2026-07-31 22:13:20 +02:00
Don't try to copy from a null source
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@716 726aef4b-f618-498e-8847-2d620e286838
This commit is contained in:
@@ -502,6 +502,11 @@ public:
|
||||
CSmartPtr<T>& operator =(const CSmartPtr<T>& CopyFrom) {
|
||||
if (&CopyFrom != this) { // Check for assignment to self
|
||||
Release(); // Release the current pointer
|
||||
|
||||
if (CopyFrom.IsNull()) { // If the source raw pointer is null
|
||||
return *this; // Then just bail out
|
||||
}
|
||||
|
||||
m_pType = &(*CopyFrom); // Make our pointers reference the same raw pointer and counter
|
||||
m_puCount = CopyFrom.GetCount();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user