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:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user