Approved by chofmann. This fixes a large leak over time. This allocation is not necessary (nor are many others in this file), as the code being called to fill the value is also allocating the memory, so the memory is/was getting allocated twice. This fixes bug #6926.

This commit is contained in:
bruce%cybersight.com 1999-05-22 19:50:26 +00:00
Родитель dc78c888ac
Коммит 6924cccf87
1 изменённых файлов: 2 добавлений и 1 удалений

Просмотреть файл

@ -497,7 +497,7 @@ NS_IMETHODIMP nsProfile::GetCurrentProfile(char **profileName)
if (NS_SUCCEEDED(rv))
{
*profileName = (char*) PR_Malloc(sizeof(char)*_MAX_LENGTH);
// *profileName = (char*) PR_Malloc(sizeof(char)*_MAX_LENGTH);
rv = m_reg->GetString( key, "CurrentProfile", profileName );
@ -930,6 +930,7 @@ nsresult nsProfile::CopyRegKey(const char *oldProfile, const char *newProfile)
char *entryName;
char *entryValue;
// XXX: These allocations shouldn't be necessary.
entryName = (char*) PR_Malloc(sizeof(char)*_MAX_LENGTH);
entryValue = (char*) PR_Malloc(sizeof(char)*_MAX_LENGTH);