### Method

# GLib PathBuf free_to_path

since: 2.76

#### Declaration [src]

    char*
    g_path_buf_free_to_path (
      GPathBuf* buf
    )

#### Description [src]

Frees a `GPathBuf` allocated by g_path_buf_new(), and returns the path inside the buffer.

This function returns `NULL` if the `GPathBuf` is empty.

See also: g_path_buf_to_path().

Available since: 2.76

#### Parameters

`buf`

  Type: `GPathBuf`

  A path buffer.

  The instance takes ownership of the data, and is responsible for freeing it.

#### Return value

Type: `char*`

The path.

The caller of the method takes ownership of the returned data, and is responsible for freeing it.
The return value can be `NULL`.
The value is a platform-native string, using the preferred OS encoding on Unix and UTF-8 on Windows.