mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-25 22:01:30 +00:00
fixing likely crasher in previous checkin, thanks to bz for noticing it
This commit is contained in:
parent
2861ddd730
commit
d099f19623
@ -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;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user