---
name: "freelocale"
section: "3"
platform: "macos"
package: "Libc"
version: "1752.120.2"
release: "macOS 26.5"
platforms: ["linux", "freebsd", "macos"]
url: "https://new.carta.tech/freelocale"
---

# freelocale(3)

Frees an allocated locale

## NAME

**freelocale** – Frees an allocated locale

## SYNOPSIS

**#include \<xlocale.h\>**

*int*\

**freelocale**(*locale\_t loc*);

## DESCRIPTION

Frees the storage associated with *loc*. Sub-structures have their reference counts reduced, and are freed if the reference count becomes zero.

## RETURN VALUES

Returns zero on success, -1 on error. An error will occur if *loc* is not a *locale\_t*, or is NULL or LC\_GLOBAL\_LOCALE.

## SEE ALSO

[duplocale(3)](/duplocale/3.md), [newlocale(3)](/newlocale/3.md), [querylocale(3)](/querylocale/3.md), [uselocale(3)](/uselocale/3.md), [xlocale(3)](/xlocale/3.md)
