fixing likely crasher in previous checkin, thanks to bz for noticing it

This commit is contained in:
cbiesinger%web.de 2003-11-14 21:27:41 +00:00
Родитель 2861ddd730
Коммит d099f19623
1 изменённых файлов: 3 добавлений и 2 удалений

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

@ -185,8 +185,8 @@ static BYTE * GetValueBytes( HKEY hKey, const char *pValueName, DWORD *pLen)
if (err == ERROR_SUCCESS) {
pBytes = new BYTE[bufSz];
err = ::RegQueryValueEx( hKey, pValueName, NULL, NULL, pBytes, &bufSz);
delete [] pBytes;
if (err != ERROR_SUCCESS) {
delete [] pBytes;
pBytes = NULL;
} else {
// Return length if caller wanted it.
@ -220,11 +220,12 @@ PRBool nsOSHelperAppService::GetValueString(HKEY hKey, PRUnichar* pValueName, ns
return PR_FALSE;
err = ::RegQueryValueExW( hKey, pValueName, NULL, NULL, (BYTE*)pBytes, &bufSz);
delete [] pBytes;
if (err != ERROR_SUCCESS) {
delete [] pBytes;
return PR_FALSE;
} else {
result.Assign(pBytes);
delete [] pBytes;
return PR_TRUE;
}
}