From: Michael Tremer Date: Fri, 31 Jan 2025 09:44:15 +0000 (+0000) Subject: compress: Free the cookie if level parsing fails X-Git-Tag: 0.9.30~226 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5304a47d6896644ea5990d9222daa0644bd3d868;p=pakfire.git compress: Free the cookie if level parsing fails Signed-off-by: Michael Tremer --- diff --git a/src/pakfire/compress.c b/src/pakfire/compress.c index 021f8377..9dba2a0c 100644 --- a/src/pakfire/compress.c +++ b/src/pakfire/compress.c @@ -392,7 +392,7 @@ FILE* pakfire_xzfopen(FILE* f, const char* mode) { // Try parsing the level r = parse_level(&level, mode); if (r < 0) - return NULL; + goto ERROR; ret = lzma_easy_encoder(&cookie->stream, level, LZMA_CHECK_SHA256); break; @@ -632,7 +632,7 @@ FILE* pakfire_zstdfopen(FILE* f, const char* mode) { // Try parsing the level r = parse_level(&level, mode); if (r < 0) - return NULL; + goto ERROR; // Allocate stream cookie->cstream = ZSTD_createCStream();