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

Commit 29b8fc7b authored by Narsinga Rao Chella's avatar Narsinga Rao Chella
Browse files

hal: fix a memeory leak caused by using str_parms_to_str()

str_parms_to_str() requires the caller to free() the
returned string. Free the memory pointed to by "str"
before overwriting the "str" with the new pointer which
is returned by strdup() function.

Change-Id: I602ae37cce684e0c62b0ec310080bb0cd675e35a
CRs-fixed: 608384
parent 2d477702
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -1512,6 +1512,7 @@ static char* out_get_parameters(const struct audio_stream *stream, const char *k
        voice_extn_out_get_parameters(out, query, reply);
        str = str_parms_to_str(reply);
        if (!strncmp(str, "", sizeof(""))) {
            free(str);
            str = strdup(keys);
        }
    }