From f22dd99176c2e0760ade98abd504085a104d4905 Mon Sep 17 00:00:00 2001 From: Mikhail Galanin Date: Thu, 16 Mar 2023 14:58:09 +0000 Subject: [PATCH 1/2] Clean memory in ImagickKernel::fromMatrix --- imagickkernel_class.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/imagickkernel_class.c b/imagickkernel_class.c index 662f2d84..a6e58888 100644 --- a/imagickkernel_class.c +++ b/imagickkernel_class.c @@ -397,8 +397,6 @@ PHP_METHOD(ImagickKernel, fromMatrix) kernel_info = imagick_createKernel(values, num_columns, num_rows, origin_x, origin_y); createKernelZval(return_value, kernel_info TSRMLS_CC); - return; - cleanup: if (values != NULL) { RelinquishAlignedMemory(values); From 9076cc80446be82d8503ad635cac3c286edb4a64 Mon Sep 17 00:00:00 2001 From: Mikhail Galanin Date: Thu, 16 Mar 2023 16:31:00 +0000 Subject: [PATCH 2/2] Clean memory in ImagickKernel::separate() as well --- imagickkernel_class.c | 1 + 1 file changed, 1 insertion(+) diff --git a/imagickkernel_class.c b/imagickkernel_class.c index a6e58888..bb088054 100644 --- a/imagickkernel_class.c +++ b/imagickkernel_class.c @@ -762,6 +762,7 @@ PHP_METHOD(ImagickKernel, separate) kernel_info->x, kernel_info->y ); + RelinquishAlignedMemory(values_copy); #if PHP_VERSION_ID >= 70000 createKernelZval(&separate_object, kernel_info_copy TSRMLS_CC);