If we convert a scalar type to a string, we must set HMF_ALLOCED or we will leak memory.
This commit is contained in:
parent
18b3a7b564
commit
e6f51b5ef0
1 changed files with 1 additions and 0 deletions
|
@ -393,6 +393,7 @@ htsmsg_field_get_string(htsmsg_field_t *f)
|
|||
snprintf(buf, sizeof(buf), "%"PRId64, f->hmf_s64);
|
||||
f->hmf_str = strdup(buf);
|
||||
f->hmf_type = HMF_STR;
|
||||
f->hmf_flags |= HMF_ALLOCED;
|
||||
break;
|
||||
}
|
||||
return f->hmf_str;
|
||||
|
|
Loading…
Add table
Reference in a new issue