### Function

# Gcr secure_memory_try_realloc

since: 4

#### Declaration [src]

    gpointer
    gcr_secure_memory_try_realloc (
      gpointer memory,
      gsize size
    )

#### Description [src]

Reallocate a block of non-pageable memory.

Glib memory is also reallocated correctly when passed to this function. If called with a null pointer, then a new block of memory is allocated. If called with a zero size, then the block of memory is freed.

If memory cannot be allocated, `NULL` is returned and the original block of memory remains intact.

Available since: 4

This function is not directly available to language bindings.

#### Parameters

`memory`

  Type: `gpointer`

  Pointer to reallocate or `NULL` to allocate a new block.

  The argument can be `NULL`.
  The data is owned by the caller of the function.

`size`

  Type: `gsize`

  New desired size of the memory block.

#### Return value

Type: `gpointer`

The new block, or `NULL` if memory cannot be allocated; the memory block should be freed with `gcr_secure_memory_free()`

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