-
Notifications
You must be signed in to change notification settings - Fork 337
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix double free call, which caused memory-corruption
- Loading branch information
1 parent
87b079a
commit 2c0a231
Showing
2 changed files
with
10 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,7 +4,7 @@ | |
* Implementation file for the ClassImpl class | ||
* | ||
* @author Emiel Bruijntjes <[email protected]> | ||
* @copyright 2014 - 2019 Copernica BV | ||
* @copyright 2014 - 2024 Copernica BV | ||
*/ | ||
#include "includes.h" | ||
#include <cstring> | ||
|
@@ -207,7 +207,10 @@ zend_function *ClassImpl::getMethod(zend_object **object, zend_string *method, c | |
// had an implementation here that used a static variable, and that worked too, | ||
// but we'll follow thread safe implementation of the Zend engine here, although | ||
// it is strange to allocate and free memory in one and the same method call (free() | ||
// call happens in call_method()) | ||
// call happens in call_method()) (2024-10-13 extra info: the method_exists() | ||
// function and our own Value::isCallable() method expect this to be emalloc()- | ||
// allocated buffer, because they both call zend_free_trampoline() (which is | ||
// effectively an efree() call) on the returned function-structure) | ||
auto *data = (CallData *)emalloc(sizeof(CallData)); | ||
auto *function = &data->func; | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters