Commit d7311be3453 for php
commit d7311be3453b498d3b13ba1f369fe169d7818cf2
Author: Akira <matyapiro31@gmail.com>
Date: Tue Nov 10 19:12:21 2026 +0000
Fix error buffer cleanup in phar_open_parsed_phar() (#25376)
The error output parameter is a char **. Free the allocated message through
*error and reset it to NULL after freeing it.
Closes #25376
diff --git a/ext/phar/phar.c b/ext/phar/phar.c
index fc21692db2c..d15ca0b4e85 100644
--- a/ext/phar/phar.c
+++ b/ext/phar/phar.c
@@ -558,7 +558,8 @@ static zend_result phar_open_parsed_phar(char *fname, size_t fname_len, char *al
}
if (phar && error && !(options & REPORT_ERRORS)) {
- efree(error);
+ efree(*error);
+ *error = NULL;
}
return FAILURE;