From e6f51b5ef046f8149b9cdc5bdab65bf96b05b491 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20=C3=96man?= Date: Thu, 16 Jul 2009 20:21:49 +0000 Subject: [PATCH] If we convert a scalar type to a string, we must set HMF_ALLOCED or we will leak memory. --- src/htsmsg.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/htsmsg.c b/src/htsmsg.c index 1976dda0..c74a3afc 100644 --- a/src/htsmsg.c +++ b/src/htsmsg.c @@ -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;