Fix memory leak am: 2815be21f2 am: 95677dbdd2 am: 5ddcff473d am: 0336b0c250 am: a8215db0da am: 219c995c4a am: ac53fdd598 am: eec49892fb am: d35cf52767 am: c2e1d3fb67
am: bcd788729b
Change-Id: I3f80f551e4414f244c8e8cc221ba77fcf8418959
diff --git a/arm-wt-22k/lib_src/eas_mdls.c b/arm-wt-22k/lib_src/eas_mdls.c
index 5b736c6..0c1c9f6 100644
--- a/arm-wt-22k/lib_src/eas_mdls.c
+++ b/arm-wt-22k/lib_src/eas_mdls.c
@@ -604,6 +604,7 @@
if ((dls.regionCount == 0) || (dls.regionCount > DLS_MAX_REGION_COUNT))
{
{ /* dpp: EAS_ReportEx(_EAS_SEVERITY_ERROR, "DLS file contains invalid #regions [%u]\n", dls.regionCount); */ }
+ EAS_HWFree(dls.hwInstData, dls.wsmpData);
return EAS_ERROR_FILE_FORMAT;
}
@@ -611,6 +612,7 @@
if ((dls.artCount == 0) || (dls.artCount > DLS_MAX_ART_COUNT))
{
{ /* dpp: EAS_ReportEx(_EAS_SEVERITY_ERROR, "DLS file contains invalid #articulations [%u]\n", dls.regionCount); */ }
+ EAS_HWFree(dls.hwInstData, dls.wsmpData);
return EAS_ERROR_FILE_FORMAT;
}
@@ -618,6 +620,7 @@
if ((dls.instCount == 0) || (dls.instCount > DLS_MAX_INST_COUNT))
{
{ /* dpp: EAS_ReportEx(_EAS_SEVERITY_ERROR, "DLS file contains invalid #instruments [%u]\n", dls.instCount); */ }
+ EAS_HWFree(dls.hwInstData, dls.wsmpData);
return EAS_ERROR_FILE_FORMAT;
}
@@ -638,6 +641,7 @@
/* calculate final memory size */
size = (EAS_I32) sizeof(S_EAS) + instSize + rgnPoolSize + artPoolSize + (2 * waveLenSize) + (EAS_I32) dls.wavePoolSize;
if (size <= 0) {
+ EAS_HWFree(dls.hwInstData, dls.wsmpData);
return EAS_ERROR_FILE_FORMAT;
}
@@ -646,6 +650,7 @@
if (dls.pDLS == NULL)
{
{ /* dpp: EAS_ReportEx(_EAS_SEVERITY_ERROR, "EAS_HWMalloc failed for DLS memory allocation size %ld\n", size); */ }
+ EAS_HWFree(dls.hwInstData, dls.wsmpData);
return EAS_ERROR_MALLOC_FAILED;
}
EAS_HWMemSet(dls.pDLS, 0, size);