diff options
author | Alexey Yakovenko <wakeroid@gmail.com> | 2010-10-04 21:45:09 +0200 |
---|---|---|
committer | Alexey Yakovenko <wakeroid@gmail.com> | 2010-10-04 21:45:09 +0200 |
commit | 5b7315ebdcf024000a29244d75ab8bef697c2b07 (patch) | |
tree | 1039491418fd7a6accde8d313c00fc7fd03fb2f6 /plugins/ao/eng_qsf | |
parent | d8769e348e4c5031c3abea93a19e38cdb152dba1 (diff) |
fixed ao qsf memleaks
Diffstat (limited to 'plugins/ao/eng_qsf')
-rw-r--r-- | plugins/ao/eng_qsf/eng_qsf.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/plugins/ao/eng_qsf/eng_qsf.c b/plugins/ao/eng_qsf/eng_qsf.c index 32c6c13d..f5bc5c3c 100644 --- a/plugins/ao/eng_qsf/eng_qsf.c +++ b/plugins/ao/eng_qsf/eng_qsf.c @@ -180,7 +180,7 @@ void *qsf_start(const char *path, uint8 *buffer, uint32 length) qsf_synth_t *s = malloc (sizeof (qsf_synth_t)); memset (s, 0, sizeof (qsf_synth_t)); - uint8 *file, *lib_decoded, *lib_raw_file; + uint8 *file = NULL, *lib_decoded = NULL, *lib_raw_file = NULL; uint64 file_len, lib_len, lib_raw_length; corlett_t *lib; @@ -226,6 +226,7 @@ void *qsf_start(const char *path, uint8 *buffer, uint32 length) #endif if (ao_get_lib(libpath, &lib_raw_file, &tmp_length) != AO_SUCCESS) { + free (file); qsf_stop (s); return NULL; } @@ -234,6 +235,7 @@ void *qsf_start(const char *path, uint8 *buffer, uint32 length) if (corlett_decode(lib_raw_file, lib_raw_length, &lib_decoded, &lib_len, &lib) != AO_SUCCESS) { free(lib_raw_file); + free (file); qsf_stop (s); return NULL; } @@ -371,6 +373,9 @@ int32 qsf_stop(void *handle) if (s->qs) { qsound_sh_stop (s->qs); } + if (s->c) { + free (s->c); + } free(s); return AO_SUCCESS; |