aboutsummaryrefslogtreecommitdiffstats
path: root/Alc
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2012-03-02 02:14:04 -0800
committerChris Robinson <[email protected]>2012-03-02 02:14:04 -0800
commitb571926a6d00fa9e4adeead59fa1d97b22184818 (patch)
tree07cb8ac329a1981166c468f424627f8a762d4e21 /Alc
parentf784aa704dfb3fdd2bfe4ee155ce165cd603186a (diff)
Avoid a leak if PortAudio fails to give a usable channel count
Diffstat (limited to 'Alc')
-rw-r--r--Alc/backends/portaudio.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/Alc/backends/portaudio.c b/Alc/backends/portaudio.c
index 81622494..154b6349 100644
--- a/Alc/backends/portaudio.c
+++ b/Alc/backends/portaudio.c
@@ -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;
}