Package: nsxiv Version: 29-3 Severity: normal Tags: patch this fixes the leak, is just commit b0b16f1 of nsxiv, one of the commits reverted in the previous patch but rebased on the current codebase, i made sure it applies and performs as expected on v29 and v30 along the pre imlib2 1.7.5 webp multi frame loader (previous patch).
as a note, due to unexpected events development of nsxiv moved to https://codeberg.org/nsxiv/nsxiv tags will still be pushed to the github repo but is now a read only mirror. as always the inlined patch >From 810e7efc126f120d577a7d6c797b466b2ca434c0 Mon Sep 17 00:00:00 2001 From: NRK <[email protected]> Date: Thu, 16 Jun 2022 23:32:23 -0600 Subject: [PATCH] img_load_webp: close the file handler and use errno --- image.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/image.c b/image.c index ade5d1b..d0729da 100644 --- a/image.c +++ b/image.c @@ -358,9 +358,9 @@ static bool img_load_webp(const fileinfo_t *file, Imlib_Image *fframe, img_t *im if ((err = fframe == NULL && img == NULL)) goto fail; - if ((err = (webp_file = fopen(file->path, "rb")) == NULL)) { - error(0, 0, "%s: Error opening webp image", file->name); - goto fail; + if ((webp_file = fopen(file->path, "rb")) == NULL) { + error(0, errno, "%s: Error opening webp image", file->name); + return false; } fseek(webp_file, 0L, SEEK_END); data.size = ftell(webp_file); @@ -445,6 +445,7 @@ fail: if (dec != NULL) WebPAnimDecoderDelete(dec); free((unsigned char *)data.bytes); + fclose(webp_file); return !err; } #endif /* HAVE_LIBWEBP */ -- -- System Information: Debian Release: bookworm/sid Architecture: amd64 (x86_64) Foreign Architectures: i386 Kernel: Linux 5.16.0-6-amd64 (SMP w/8 CPU threads; PREEMPT) Kernel taint flags: TAINT_WARN Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8), LANGUAGE=en_US:en Shell: /bin/sh linked to /bin/dash Init: sysvinit (via /sbin/init) LSM: AppArmor: enabled Versions of packages nsxiv depends on: ii libc6 2.33-7 ii libexif12 0.6.24-1 ii libfontconfig1 2.13.1-4.4 ii libgif7 5.2.1-2.4 ii libimlib2 1.7.4-2 ii libwebp7 1.2.2-2+b1 ii libwebpdemux2 1.2.2-2+b1 ii libx11-6 2:1.7.5-1 ii libxft2 2.3.4-1 nsxiv recommends no packages. Versions of packages nsxiv suggests: ii imagemagick 8:6.9.11.60+dfsg-1.3+b2 ii imagemagick-6.q16 [imagemagick] 8:6.9.11.60+dfsg-1.3+b2 pn libjpeg-progs <none> pn rawtherapee <none> ii xclip 0.13-2 -- no debconf information

