diff options
author | Chris Robinson <[email protected]> | 2012-03-01 09:56:25 -0800 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2012-03-01 09:56:25 -0800 |
commit | 06debb153d0195d89a85b0fbe6c77aed4bf9e6f7 (patch) | |
tree | 795adfcd35c5373c84c064393c684d08c8169bab /Alc/backends/alsa.c | |
parent | 51e6786f31e669325f4fe5b63fdb9fed6d4b7f06 (diff) |
Fix a memory leak
Diffstat (limited to 'Alc/backends/alsa.c')
-rw-r--r-- | Alc/backends/alsa.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/Alc/backends/alsa.c b/Alc/backends/alsa.c index 7ea3478b..4892c8d4 100644 --- a/Alc/backends/alsa.c +++ b/Alc/backends/alsa.c @@ -1209,13 +1209,19 @@ void alc_alsa_deinit(void) ALuint i; for(i = 0;i < numDevNames;++i) + { + free(allDevNameMap[i].name); free(allDevNameMap[i].device); + } free(allDevNameMap); allDevNameMap = NULL; numDevNames = 0; for(i = 0;i < numCaptureDevNames;++i) + { + free(allCaptureDevNameMap[i].name); free(allCaptureDevNameMap[i].device); + } free(allCaptureDevNameMap); allCaptureDevNameMap = NULL; numCaptureDevNames = 0; @@ -1235,7 +1241,10 @@ void alc_alsa_probe(enum DevProbe type) { case ALL_DEVICE_PROBE: for(i = 0;i < numDevNames;++i) + { + free(allDevNameMap[i].name); free(allDevNameMap[i].device); + } free(allDevNameMap); allDevNameMap = probe_devices(SND_PCM_STREAM_PLAYBACK, &numDevNames); @@ -1246,7 +1255,10 @@ void alc_alsa_probe(enum DevProbe type) case CAPTURE_DEVICE_PROBE: for(i = 0;i < numCaptureDevNames;++i) + { + free(allCaptureDevNameMap[i].name); free(allCaptureDevNameMap[i].device); + } free(allCaptureDevNameMap); allCaptureDevNameMap = probe_devices(SND_PCM_STREAM_CAPTURE, &numCaptureDevNames); |