diff --git a/mozilla/string/obsolete/nsXPIDLString.cpp b/mozilla/string/obsolete/nsXPIDLString.cpp index c18024ae2cc..05a6c3ef8e3 100644 --- a/mozilla/string/obsolete/nsXPIDLString.cpp +++ b/mozilla/string/obsolete/nsXPIDLString.cpp @@ -128,9 +128,14 @@ nsXPIDLCString& nsXPIDLCString::operator =(const char* aCString) if (mBufOwner && mBuf) XPIDL_FREE(mBuf); - if (aCString) + if (aCString) { mBuf = Copy(aCString); - mBufOwner = PR_TRUE; + mBufOwner = PR_TRUE; + } + else { + mBuf = 0; + mBufOwner = PR_FALSE; + } return *this; } diff --git a/mozilla/xpcom/ds/nsXPIDLString.cpp b/mozilla/xpcom/ds/nsXPIDLString.cpp index c18024ae2cc..05a6c3ef8e3 100644 --- a/mozilla/xpcom/ds/nsXPIDLString.cpp +++ b/mozilla/xpcom/ds/nsXPIDLString.cpp @@ -128,9 +128,14 @@ nsXPIDLCString& nsXPIDLCString::operator =(const char* aCString) if (mBufOwner && mBuf) XPIDL_FREE(mBuf); - if (aCString) + if (aCString) { mBuf = Copy(aCString); - mBufOwner = PR_TRUE; + mBufOwner = PR_TRUE; + } + else { + mBuf = 0; + mBufOwner = PR_FALSE; + } return *this; } diff --git a/mozilla/xpcom/string/obsolete/nsXPIDLString.cpp b/mozilla/xpcom/string/obsolete/nsXPIDLString.cpp index c18024ae2cc..05a6c3ef8e3 100644 --- a/mozilla/xpcom/string/obsolete/nsXPIDLString.cpp +++ b/mozilla/xpcom/string/obsolete/nsXPIDLString.cpp @@ -128,9 +128,14 @@ nsXPIDLCString& nsXPIDLCString::operator =(const char* aCString) if (mBufOwner && mBuf) XPIDL_FREE(mBuf); - if (aCString) + if (aCString) { mBuf = Copy(aCString); - mBufOwner = PR_TRUE; + mBufOwner = PR_TRUE; + } + else { + mBuf = 0; + mBufOwner = PR_FALSE; + } return *this; }