---
name: "zip_discard"
section: "3"
platform: "linux"
package: "libzip"
version: "1.11.4-1"
release: "Arch Linux 2026-11-01"
platforms: ["linux"]
url: "https://new.carta.tech/zip_discard"
---

# zip\_discard(3)

close zip archive and discard changes

## NAME

**zip\_discard** – close zip archive and discard changes

## LIBRARY

libzip (-lzip)

## SYNOPSIS

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

*void*\

**zip\_discard**(*zip\_t \*archive*);

## DESCRIPTION

The **zip\_discard**() function closes *archive* and frees the memory allocated for it. Any changes to the archive are not written to disk and discarded.

## SEE ALSO

[libzip(3)](/libzip/3.md), [zip\_close(3)](/zip_close/3.md)

## HISTORY

**zip\_discard**() was added in libzip 0.11.

## AUTHORS

Dieter Baron ⟨*dillo@nih.at*⟩ and Thomas Klausner ⟨*wiz@gatalith.at*⟩
