Browse Source

make sure a pointer is deleted
[SAB]


git-svn-id: svn://svn.code.sf.net/p/ditto-cp/code/trunk@154 595ec19a-5cb4-439b-94a8-42fb3063c22c

sabrogden 21 years ago
parent
commit
2e004d091f
1 changed files with 3 additions and 10 deletions
  1. 3 10
      Misc.cpp

+ 3 - 10
Misc.cpp

@@ -1208,11 +1208,7 @@ void CGetSetOptions::SetNetworkPassword(CString csPassword)
 		SetProfileData("NetworkPassword", NULL, 0);
 	}
 
-	if(pData)
-	{
-		delete pData;
-		pData = NULL;
-	}
+	DELETE_PTR(pData);
 }
 
 CString CGetSetOptions::GetNetworkPassword()
@@ -1228,11 +1224,8 @@ CString CGetSetOptions::GetNetworkPassword()
 		if(DecryptString((UCHAR *)lpVoid, dwLength, pData, nLength))
 			cs = pData;
 
-		if(pData)
-		{
-			delete pData;
-			pData = NULL;
-		}
+		DELETE_PTR(pData);
+		DELETE_PTR(lpVoid);
 	}
 
 	if(cs == "")