Fix crasher bug #82003. Mozilla would crash when viewing some multipart pages. Make sure that we call free on the right variable. r=gagan, rs=darin

This commit is contained in:
blizzard%redhat.com 2001-05-22 14:44:28 +00:00
Родитель 9be067b01f
Коммит 3073323fa4
1 изменённых файлов: 2 добавлений и 2 удалений

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

@ -127,13 +127,13 @@ nsMultiMixedConv::OnDataAvailable(nsIRequest *request, nsISupports *context,
bufLen = read + mTokenLen + 1;
char *tmp = (char*)nsMemory::Alloc(bufLen);
if (!tmp) {
nsMemory::Free(cursor);
nsMemory::Free(buffer);
return NS_ERROR_OUT_OF_MEMORY;
}
nsCRT::memcpy(tmp, token, mTokenLen);
nsCRT::memcpy(tmp+mTokenLen, "\n", 1);
nsCRT::memcpy(tmp+mTokenLen+1, cursor, read);
nsMemory::Free(cursor);
nsMemory::Free(buffer);
buffer = tmp;
}
}