Ensure that mBuf <-- 0 before assignment begins. Otherwise we run the rise of a failed assignment causing a duplicate free.

git-svn-id: svn://10.0.0.236/trunk@35014 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
waterson%netscape.com
1999-06-12 16:39:11 +00:00
parent b077529bb9
commit 67cbb9dcf8
3 changed files with 12 additions and 0 deletions

View File

@@ -84,6 +84,7 @@ nsXPIDLString::StartAssignmentByValue()
if (mBufOwner && mBuf)
XPIDL_FREE(mBuf);
mBuf = 0;
mBufOwner = PR_TRUE;
return &mBuf;
}
@@ -95,6 +96,7 @@ nsXPIDLString::StartAssignmentByReference()
if (mBufOwner && mBuf)
XPIDL_FREE(mBuf);
mBuf = 0;
mBufOwner = PR_FALSE;
return (const PRUnichar**) &mBuf;
}
@@ -145,6 +147,7 @@ nsXPIDLCString::StartAssignmentByValue()
if (mBufOwner && mBuf)
XPIDL_FREE(mBuf);
mBuf = 0;
mBufOwner = PR_TRUE;
return &mBuf;
}
@@ -156,6 +159,7 @@ nsXPIDLCString::StartAssignmentByReference()
if (mBufOwner && mBuf)
XPIDL_FREE(mBuf);
mBuf = 0;
mBufOwner = PR_FALSE;
return (const char**) &mBuf;
}