summaryrefslogtreecommitdiffstats
path: root/Alc/ALc.c
diff options
context:
space:
mode:
Diffstat (limited to 'Alc/ALc.c')
-rw-r--r--Alc/ALc.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/Alc/ALc.c b/Alc/ALc.c
index 588ba903..f3ff1d85 100644
--- a/Alc/ALc.c
+++ b/Alc/ALc.c
@@ -586,6 +586,8 @@ ALCAPI ALCdevice* ALCAPIENTRY alcCaptureOpenDevice(const ALCchar *deviceName, AL
pDevice->Connected = ALC_TRUE;
pDevice->IsCaptureDevice = AL_TRUE;
+ pDevice->szDeviceName = NULL;
+
pDevice->Frequency = frequency;
pDevice->Format = format;
pDevice->BufferSize = SampleSize;
@@ -637,6 +639,8 @@ ALCAPI ALCboolean ALCAPIENTRY alcCaptureCloseDevice(ALCdevice *pDevice)
ProcessContext(NULL);
+ free(pDevice->szDeviceName);
+
ALCdevice_CloseCapture(pDevice);
free(pDevice);
@@ -1378,6 +1382,8 @@ ALCAPI ALCdevice* ALCAPIENTRY alcOpenDevice(const ALCchar *deviceName)
device->Connected = ALC_TRUE;
device->IsCaptureDevice = AL_FALSE;
+ device->szDeviceName = NULL;
+
//Set output format
device->Frequency = GetConfigValueInt(NULL, "frequency", SWMIXER_OUTPUT_RATE);
if(device->Frequency == 0)
@@ -1498,6 +1504,8 @@ ALCAPI ALCboolean ALCAPIENTRY alcCloseDevice(ALCdevice *pDevice)
ReleaseALDatabuffers(pDevice);
}
+ free(pDevice->szDeviceName);
+
//Release device structure
memset(pDevice, 0, sizeof(ALCdevice));
free(pDevice);