Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit fe916e17 authored by Krishnankutty Kolathappilly's avatar Krishnankutty Kolathappilly Committed by Gerrit - the friendly Code Review server
Browse files

hal: Fix memory leak in listen module

String returned from str_parms_to_str for set/get parameter
key-value pair for listen module is not de-allocated. Fix is
to make sure the memory allocated for key value pair
is de-allocated.

CRs-Fixed: 610083
Change-Id: I290e61168b8fd1569a7b89e13257e142aa5aa1ac
parent 6528137d
Loading
Loading
Loading
Loading
+5 −2
Original line number Diff line number Diff line
@@ -119,10 +119,13 @@ void audio_extn_listen_update_status(snd_device_t snd_device,
void audio_extn_listen_set_parameters(struct audio_device *adev,
                               struct str_parms *parms)
{
    ALOGV("%s: enter: %s", __func__, str_parms_to_str(parms));

    ALOGV("%s: enter", __func__);
    if (listen_dev) {
        listen_dev->listen_set_parameters(&adev->device, str_parms_to_str(parms));
         char *kv_pairs = str_parms_to_str(parms);
         ALOGV_IF(kv_pairs != NULL, "%s: %s", __func__, kv_pairs);
         listen_dev->listen_set_parameters(&adev->device, kv_pairs);
         free(kv_pairs);
    }

    return;