### Function

# GLib ByteArray free

#### Declaration [src]

    guint8*
    g_byte_array_free (
      GByteArray* array,
      gboolean free_segment
    )

#### Description [src]

Frees the memory allocated by the `GByteArray`. If `free_segment` is true it frees the actual byte data. If the reference count of `array` is greater than one, the `GByteArray` wrapper is preserved but the size of `array` will be set to zero.

#### Parameters

`array`

  Type: An array of `guint8`

  A byte array.

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

`free_segment`

  Type: `gboolean`

  If true, the actual byte data is freed as well.

#### Return value

Type: An array of `guint8`

The allocated element data if `free_segment` is false, otherwise `NULL`.

The caller of the function takes ownership of the data, and is responsible for freeing it.
The return value can be `NULL`.