/* Returns: (transfer full): A newly allocated #GBytes containing contents of @string; @string itself is freed Since: 2.34  */
GBytes* g_string_free_to_bytes(GString *string)
/* Returns: (transfer full): A newly allocated #GBytes containing contents of @string; @string itself is freed Since: 2.34  */
GBytes* g_string_free_to_bytes(GString *string)
{
  gsize len;
  gchar *buf;
  g_return_val_if_fail (string != NULL, NULL);
  len = string->len;
  buf = g_string_free (string, FALSE);
  return g_bytes_new_take (buf, len);
}