From 75626a596f1c76725b512d780cea2961c0068725 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=9E=97=20Yang=20Lin?= Date: Wed, 2 Dec 2026 21:43:27 +0800 Subject: [PATCH] fix memory leaks on error path previous code would early return When `mux_error != WebPMuxError::WEBP_MUX_OK` but forgot to release `mux` and `webp_data` --- src/animation_encoder.rs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/animation_encoder.rs b/src/animation_encoder.rs index 0df8afe..4d03884 100644 --- a/src/animation_encoder.rs +++ b/src/animation_encoder.rs @@ -190,12 +190,16 @@ unsafe fn anim_encode(all_frame: &AnimEncoder) -> Result::uninit(); WebPMuxAssemble(mux, webp_data.as_mut_ptr()); WebPMuxDelete(mux);