Avoid a leak if PortAudio fails to give a usable channel count
This commit is contained in:
@@ -222,8 +222,6 @@ retry_open:
|
||||
return ALC_INVALID_VALUE;
|
||||
}
|
||||
|
||||
device->szDeviceName = strdup(deviceName);
|
||||
|
||||
if((ALuint)outParams.channelCount != ChannelsFromDevFmt(device->FmtChans))
|
||||
{
|
||||
if(outParams.channelCount != 1 && outParams.channelCount != 2)
|
||||
@@ -241,6 +239,8 @@ retry_open:
|
||||
}
|
||||
SetDefaultChannelOrder(device);
|
||||
|
||||
device->szDeviceName = strdup(deviceName);
|
||||
|
||||
return ALC_NO_ERROR;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user