Mercurial > hg > dmlib
changeset 286:a17e54015bd9
Fix a small memory leak, the special "empty" pattern was not being freed.
author | Matti Hamalainen <ccr@tnsp.org> |
---|---|
date | Thu, 11 Oct 2012 10:24:00 +0300 |
parents | 245b15cd1919 |
children | 1e89cd081956 |
files | jssmod.c |
diffstat | 1 files changed, 9 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/jssmod.c Thu Oct 11 10:07:59 2012 +0300 +++ b/jssmod.c Thu Oct 11 10:24:00 2012 +0300 @@ -313,6 +313,15 @@ } } + // Free the "empty" pattern + JSSPattern *pat = module->patterns[jsetMaxPatterns]; + if (pat != NULL) + { + dmFree(pat->data); + dmFree(pat); + module->patterns[i] = NULL; + } + // Free instruments for (i = 0; i < module->ninstruments; i++) {