From b571926a6d00fa9e4adeead59fa1d97b22184818 Mon Sep 17 00:00:00 2001 From: Chris Robinson Date: Fri, 2 Mar 2012 02:14:04 -0800 Subject: Avoid a leak if PortAudio fails to give a usable channel count --- Alc/backends/portaudio.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'Alc/backends/portaudio.c') 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; } -- cgit v1.2.3