From bede7814d02a21d0956e15d0c5ff6658243439e3 Mon Sep 17 00:00:00 2001 From: Danack Date: Mon, 1 Jul 2024 20:01:08 +0100 Subject: [PATCH] Revert freeing memory until the lifecycle of that memory is better understood. --- imagickkernel_class.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/imagickkernel_class.c b/imagickkernel_class.c index ba462358..eee111ac 100644 --- a/imagickkernel_class.c +++ b/imagickkernel_class.c @@ -395,6 +395,9 @@ PHP_METHOD(ImagickKernel, fromMatrix) kernel_info = imagick_createKernel(values, num_columns, num_rows, origin_x, origin_y); createKernelZval(return_value, kernel_info TSRMLS_CC); +// The values are still used here, as free'ing them causes problems + return; + cleanup: if (values != NULL) { RelinquishAlignedMemory(values); @@ -758,7 +761,9 @@ PHP_METHOD(ImagickKernel, separate) kernel_info->x, kernel_info->y ); - RelinquishAlignedMemory(values_copy); + +// The values are still used here, as free'ing them causes problems +// RelinquishAlignedMemory(values_copy); #if PHP_VERSION_ID >= 70000 createKernelZval(&separate_object, kernel_info_copy TSRMLS_CC);