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
This commit is contained in:
parent
2d477702a8
commit
29b8fc7b8d
|
@ -1512,7 +1512,8 @@ 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(""))) {
|
||||
str = strdup(keys);
|
||||
free(str);
|
||||
str = strdup(keys);
|
||||
}
|
||||
}
|
||||
str_parms_destroy(query);
|
||||
|
|
Loading…
Reference in New Issue