Index: TortoiseProc/CommitDlg.cpp
===================================================================
--- TortoiseProc/CommitDlg.cpp	(revision 18287)
+++ TortoiseProc/CommitDlg.cpp	(working copy)
@@ -174,16 +174,16 @@
 		if (SUCCEEDED(hr))
 		{
 			m_BugTraqProvider = pProvider;
-			BSTR temp = NULL;
-			hr = pProvider->GetLinkText(GetSafeHwnd(), m_bugtraq_association.GetParameters().AllocSysString(), &temp);
+			ATL::CComBSTR temp;
+			ATL::CComBSTR parameters;
+			parameters.Attach(m_bugtraq_association.GetParameters().AllocSysString());
+			hr = pProvider->GetLinkText(GetSafeHwnd(), parameters, &temp);
 			if (SUCCEEDED(hr))
 			{
 				SetDlgItemText(IDC_BUGTRAQBUTTON, temp == 0 ? _T("") : temp);
 				GetDlgItem(IDC_BUGTRAQBUTTON)->EnableWindow(TRUE);
 				GetDlgItem(IDC_BUGTRAQBUTTON)->ShowWindow(SW_SHOW);
 			}
-
-			SysFreeString(temp);
 		}
 
 		GetDlgItem(IDC_LOGMESSAGE)->SetFocus();
@@ -606,16 +606,23 @@
 		HRESULT hr = m_BugTraqProvider.QueryInterface(&pProvider2);
 		if (SUCCEEDED(hr))
 		{
-			BSTR temp = NULL;
+			ATL::CComBSTR temp;
 			CString common = m_ListCtrl.GetCommonURL(true).GetSVNPathString();
-			BSTR repositoryRoot = common.AllocSysString();
-			BSTR parameters = m_bugtraq_association.GetParameters().AllocSysString();
-			BSTR commonRoot = SysAllocString(m_pathList.GetCommonRoot().GetDirectory().GetWinPath());
-			BSTR commitMessage = m_sLogMessage.AllocSysString();
+			ATL::CComBSTR repositoryRoot;
+			repositoryRoot.Attach(common.AllocSysString());
+			ATL::CComBSTR parameters;
+			parameters.Attach(m_bugtraq_association.GetParameters().AllocSysString());
+			ATL::CComBSTR commonRoot(m_pathList.GetCommonRoot().GetDirectory().GetWinPath());
+			ATL::CComBSTR commitMessage;
+			commitMessage.Attach(m_sLogMessage.AllocSysString());
 			SAFEARRAY *pathList = SafeArrayCreateVector(VT_BSTR, 0, m_selectedPathList.GetCount());
 
 			for (LONG index = 0; index < m_selectedPathList.GetCount(); ++index)
-				SafeArrayPutElement(pathList, &index, m_selectedPathList[index].GetSVNPathString().AllocSysString());
+			{
+				ATL::CComBSTR path;
+				path.Attach(m_selectedPathList[index].GetSVNPathString().AllocSysString());
+				SafeArrayPutElement(pathList, &index, path);
+			}
 			
 			hr = pProvider2->CheckCommit(GetSafeHwnd(), parameters, repositoryRoot, commonRoot, pathList, commitMessage, &temp);
 			if (FAILED(hr))
@@ -633,7 +640,6 @@
 					CMessageBox::Show(m_hWnd, sError, _T("TortoiseSVN"), MB_ICONERROR);
 					return;
 				}
-				SysFreeString(temp);
 			}
 		}
 	}
@@ -1347,15 +1353,21 @@
 	if (m_BugTraqProvider == NULL)
 		return;
 
-	BSTR parameters = m_bugtraq_association.GetParameters().AllocSysString();
-	BSTR commonRoot = SysAllocString(m_pathList.GetCommonRoot().GetDirectory().GetWinPath());
+	ATL::CComBSTR parameters;
+	parameters.Attach(m_bugtraq_association.GetParameters().AllocSysString());
+	ATL::CComBSTR commonRoot(m_pathList.GetCommonRoot().GetDirectory().GetWinPath());
 	SAFEARRAY *pathList = SafeArrayCreateVector(VT_BSTR, 0, m_pathList.GetCount());
 
 	for (LONG index = 0; index < m_pathList.GetCount(); ++index)
-		SafeArrayPutElement(pathList, &index, m_pathList[index].GetSVNPathString().AllocSysString());
+	{
+		ATL::CComBSTR path;
+		path.Attach(m_pathList[index].GetSVNPathString().AllocSysString());
+		SafeArrayPutElement(pathList, &index, path);
+	}
 
-	BSTR originalMessage = sMsg.AllocSysString();
-	BSTR temp = NULL;
+	ATL::CComBSTR originalMessage;
+	originalMessage.Attach(sMsg.AllocSysString());
+	ATL::CComBSTR temp;
 	m_revProps.clear();
 
 	// first try the IBugTraqProvider2 interface
@@ -1364,10 +1376,12 @@
 	if (SUCCEEDED(hr))
 	{
 		CString common = m_ListCtrl.GetCommonURL(false).GetSVNPathString();
-		BSTR repositoryRoot = common.AllocSysString();
-		BSTR bugIDOut = NULL;
+		ATL::CComBSTR repositoryRoot;
+		repositoryRoot.Attach(common.AllocSysString());
+		ATL::CComBSTR bugIDOut;
 		GetDlgItemText(IDC_BUGID, m_sBugID);
-		BSTR bugID = m_sBugID.AllocSysString();
+		ATL::CComBSTR bugID;
+		bugID.Attach(m_sBugID.AllocSysString());
 		SAFEARRAY * revPropNames = NULL;
 		SAFEARRAY * revPropValues = NULL;
 		if (FAILED(hr = pProvider2->GetCommitMessage2(GetSafeHwnd(), parameters, repositoryRoot, commonRoot, pathList, originalMessage, bugID, &bugIDOut, &revPropNames, &revPropValues, &temp)))
@@ -1382,11 +1396,11 @@
 			if (bugIDOut)
 			{
 				m_sBugID = bugIDOut;
-				SysFreeString(bugIDOut);
+				bugIDOut = 0;
 				SetDlgItemText(IDC_BUGID, m_sBugID);
 			}
-			SysFreeString(bugID);
-			SysFreeString(repositoryRoot);
+			bugID = 0;
+			repositoryRoot = 0;
 			m_cLogMessage.SetText(temp);
 			BSTR HUGEP *pbRevNames;
 			BSTR HUGEP *pbRevValues;
@@ -1450,11 +1464,7 @@
 
 	m_cLogMessage.SetFocus();
 
-	SysFreeString(parameters);
-	SysFreeString(commonRoot);
 	SafeArrayDestroy(pathList);
-	SysFreeString(originalMessage);
-	SysFreeString(temp);
 }
 
 LRESULT CCommitDlg::OnSVNStatusListCtrlCheckChanged(WPARAM, LPARAM)
Index: TortoiseProc/Settings/SetBugTraqAdv.cpp
===================================================================
--- TortoiseProc/Settings/SetBugTraqAdv.cpp	(revision 18287)
+++ TortoiseProc/Settings/SetBugTraqAdv.cpp	(working copy)
@@ -235,14 +235,15 @@
 
 	if (SUCCEEDED(hr))
 	{
-		BSTR temp = NULL;
+		ATL::CComBSTR temp;
 		CString p;
 		GetDlgItemText(IDC_BUGTRAQPARAMETERS, p);
-		BSTR params = p.AllocSysString();
+		ATL::CComBSTR params;
+		params.Attach(p.AllocSysString());
 		hr = pProvider->ShowOptionsDialog(GetSafeHwnd(), params, &temp);
 		if (SUCCEEDED(hr))
 		{
-			SetDlgItemText(IDC_BUGTRAQPARAMETERS, temp);
+			SetDlgItemText(IDC_BUGTRAQPARAMETERS, temp == 0 ? "" : temp);
 		}
 		else
 		{
@@ -251,6 +252,5 @@
 			sErr.FormatMessage(IDS_ERR_FAILEDISSUETRACKERCOM, ce.GetSource().c_str(), ce.GetMessageAndDescription().c_str());
 			CMessageBox::Show(m_hWnd, sErr, _T("TortoiseSVN"), MB_ICONERROR);
 		}
-		SysFreeString(temp);
 	}
 }
Index: TortoiseProc/SVNProgressDlg.cpp
===================================================================
--- TortoiseProc/SVNProgressDlg.cpp	(revision 18287)
+++ TortoiseProc/SVNProgressDlg.cpp	(working copy)
@@ -2181,15 +2181,20 @@
 			HRESULT hr = m_BugTraqProvider.QueryInterface(&pProvider);
 			if (SUCCEEDED(hr))
 			{
-				BSTR commonRoot = SysAllocString(m_selectedPaths.GetCommonRoot().GetDirectory().GetWinPath());
+				ATL::CComBSTR commonRoot(m_selectedPaths.GetCommonRoot().GetDirectory().GetWinPath());
 				SAFEARRAY *pathList = SafeArrayCreateVector(VT_BSTR, 0, m_selectedPaths.GetCount());
 
 				for (LONG index = 0; index < m_selectedPaths.GetCount(); ++index)
-					SafeArrayPutElement(pathList, &index, m_selectedPaths[index].GetSVNPathString().AllocSysString());
+				{
+					ATL::CComBSTR path;
+					path.Attach(m_selectedPaths[index].GetSVNPathString().AllocSysString());
+					SafeArrayPutElement(pathList, &index, path);
+				}
 
-				BSTR logMessage = m_sMessage.AllocSysString();
+				ATL::CComBSTR logMessage;
+				logMessage.Attach(m_sMessage.AllocSysString());
 
-				BSTR temp = NULL;
+				ATL::CComBSTR temp;
 				if (FAILED(hr = pProvider->OnCommitFinished(GetSafeHwnd(), 
 					commonRoot,
 					pathList,
@@ -2207,8 +2212,6 @@
 						ReportError(sErr);
 					}
 				}
-
-				SysFreeString(temp);
 			}
 		}
 	}
