diff options
Diffstat (limited to 'common/glib-helper.c')
-rw-r--r-- | common/glib-helper.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/common/glib-helper.c b/common/glib-helper.c index bed506c3..cb8f35c4 100644 --- a/common/glib-helper.c +++ b/common/glib-helper.c @@ -261,7 +261,7 @@ char *bt_uuid2string(uuid_t *uuid) gchar *bt_list2string(GSList *list) { GSList *l; - gchar *str = NULL; + gchar *str, *tmp; if (!list) return NULL; @@ -269,8 +269,11 @@ gchar *bt_list2string(GSList *list) str = g_strdup((const gchar *) list->data); /* FIXME: eglib doesn't support g_strconcat */ - for (l = list->next; l; l = l->next) - str = g_strconcat(str, " " , (const gchar *) l->data, NULL); + for (l = list->next; l; l = l->next) { + tmp = g_strconcat(str, " " , (const gchar *) l->data, NULL); + g_free(str); + str = tmp; + } return str; } |