From 9e8c29a5c81996b6013e2385523aa792c5163264 Mon Sep 17 00:00:00 2001 From: Kleis Auke Wolthuizen Date: Mon, 26 Aug 2024 13:10:33 +0200 Subject: [PATCH] Fix a small memleak in `write_to_buffer()` --- pyvips/vimage.py | 1 + 1 file changed, 1 insertion(+) diff --git a/pyvips/vimage.py b/pyvips/vimage.py index 4bef17f..df6a178 100644 --- a/pyvips/vimage.py +++ b/pyvips/vimage.py @@ -849,6 +849,7 @@ def write_to_buffer(self, format_string, **kwargs): format_string = _to_bytes(format_string) filename = vips_lib.vips_filename_get_filename(format_string) + filename = ffi.gc(filename, glib_lib.g_free) pointer = vips_lib.vips_filename_get_options(format_string) options = _to_string_copy(pointer)