OpenSound: Fix PVS 2232, 2233
Use new(std::nothrow) so that NULL check for allocated memory makes sense. Change-Id: I690a796ac5a9a7a61440ccccf19f93fc6bf2d328 Reviewed-on: https://review.haiku-os.org/689 Reviewed-by: Adrien Destugues <[email protected]>
This commit is contained in:
committed by
waddlesplash
parent
05f730b0f8
commit
99b0a7e0ed
@@ -389,7 +389,8 @@ OpenSoundDevice::AddEngine(oss_audioinfo *info)
|
|||||||
if (info->caps & PCM_CAP_HIDDEN)
|
if (info->caps & PCM_CAP_HIDDEN)
|
||||||
return B_OK;
|
return B_OK;
|
||||||
*/
|
*/
|
||||||
OpenSoundDeviceEngine *engine = new OpenSoundDeviceEngine(info);
|
OpenSoundDeviceEngine *engine =
|
||||||
|
new(std::nothrow) OpenSoundDeviceEngine(info);
|
||||||
if (!engine)
|
if (!engine)
|
||||||
return ENOMEM;
|
return ENOMEM;
|
||||||
err = engine->InitCheck();
|
err = engine->InitCheck();
|
||||||
@@ -407,7 +408,8 @@ OpenSoundDevice::AddMixer(oss_mixerinfo *info)
|
|||||||
{
|
{
|
||||||
status_t err;
|
status_t err;
|
||||||
CALLED();
|
CALLED();
|
||||||
OpenSoundDeviceMixer *mixer = new OpenSoundDeviceMixer(info);
|
OpenSoundDeviceMixer *mixer =
|
||||||
|
new(std::nothrow) OpenSoundDeviceMixer(info);
|
||||||
if (!mixer)
|
if (!mixer)
|
||||||
return ENOMEM;
|
return ENOMEM;
|
||||||
err = mixer->InitCheck();
|
err = mixer->InitCheck();
|
||||||
|
|||||||
Reference in New Issue
Block a user