If we convert a scalar type to a string, we must set HMF_ALLOCED or we will leak memory.

This commit is contained in:
Andreas Öman 2009-07-16 20:21:49 +00:00
parent 18b3a7b564
commit e6f51b5ef0

View file

@ -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;