summaryrefslogtreecommitdiffstats
path: root/lib/4a-hal-utilities/4a-hal-utilities-data.c
diff options
context:
space:
mode:
authorJonathan Aillet <jonathan.aillet@iot.bzh>2019-06-19 14:26:58 +0200
committerJonathan Aillet <jonathan.aillet@iot.bzh>2019-06-25 11:18:00 +0200
commit675c85ec8246780cd18a68151bcdb3e596794ee7 (patch)
tree1ecf1be685655ace80a5e4c5bc48592049c83f1a /lib/4a-hal-utilities/4a-hal-utilities-data.c
parentf29775f7da003bbadb44dd82d8b3974aa1e59274 (diff)
Use a dynamic allocation for halmap data storage
Use a dynamically allocated structure to store properties about ALSA controls (halmap). BUG-AGL: SPEC-2329 Change-Id: I691648452d6c950d201bc25977a493608fede197 Signed-off-by: Jonathan Aillet <jonathan.aillet@iot.bzh>
Diffstat (limited to 'lib/4a-hal-utilities/4a-hal-utilities-data.c')
-rw-r--r--lib/4a-hal-utilities/4a-hal-utilities-data.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/lib/4a-hal-utilities/4a-hal-utilities-data.c b/lib/4a-hal-utilities/4a-hal-utilities-data.c
index d7ae1f6..cebc223 100644
--- a/lib/4a-hal-utilities/4a-hal-utilities-data.c
+++ b/lib/4a-hal-utilities/4a-hal-utilities-data.c
@@ -878,6 +878,17 @@ void HalUtlFreeSelectedHalMapDataAllocation(struct InternalHalAlsaMap *halMapDat
free(halMapDataToFree->ctl.name);
+ if(halMapDataToFree->ctl.alsaCtlCreation) {
+ free(halMapDataToFree->ctl.alsaCtlCreation->enums);
+ free(halMapDataToFree->ctl.alsaCtlCreation->dbscale);
+ free(halMapDataToFree->ctl.alsaCtlCreation);
+ }
+ else if(halMapDataToFree->ctl.alsaCtlProperties) {
+ free(halMapDataToFree->ctl.alsaCtlProperties->enums);
+ free(halMapDataToFree->ctl.alsaCtlProperties->dbscale);
+ free(halMapDataToFree->ctl.alsaCtlProperties);
+ }
+
free(halMapDataToFree);
}