php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login

Patch 0001-Fix-77359-spl_autoload-causes-segfault.txt for SPL related Bug #77359

Patch version 2018-12-27 14:03 UTC

Return to Bug #77359 | Download this patch
Patch Revisions:

Developer: lauri.kentta@gmail.com

From b65105c1b1a73d37a70a24e02a1395e627c841ee Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Lauri=20Kentt=C3=A4?= <lauri.kentta@gmail.com>
Date: Thu, 27 Dec 2018 15:47:33 +0200
Subject: [PATCH] Fix #77359: spl_autoload causes segfault

Use the correct function to free the string.
---
 ext/spl/php_spl.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/ext/spl/php_spl.c b/ext/spl/php_spl.c
index 0263a132b1..b5379baae0 100644
--- a/ext/spl/php_spl.c
+++ b/ext/spl/php_spl.c
@@ -335,7 +335,7 @@ PHP_FUNCTION(spl_autoload)
 		pos = pos1 ? pos1 + 1 : NULL;
 		pos_len = pos1? pos_len - pos1_len - 1 : 0;
 	}
-	zend_string_free(lc_name);
+	zend_string_release(lc_name);
 } /* }}} */
 
 /* {{{ proto string spl_autoload_extensions([string file_extensions])
-- 
2.20.1

 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Dec 27 00:01:30 2024 UTC