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
1 file changed