From bc7f0ba1fcbf28b6d564c097553b169b348e03cd Mon Sep 17 00:00:00 2001 From: "waterson%netscape.com" Date: Thu, 24 Feb 2000 06:42:36 +0000 Subject: [PATCH] My bad; I reviewed this code and I suck. This is the right fix. git-svn-id: svn://10.0.0.236/trunk@61595 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/string/obsolete/nsXPIDLString.cpp | 9 +++++++-- mozilla/xpcom/ds/nsXPIDLString.cpp | 9 +++++++-- mozilla/xpcom/string/obsolete/nsXPIDLString.cpp | 9 +++++++-- 3 files changed, 21 insertions(+), 6 deletions(-) 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; }