For Programmers: Free Programming Magazines  


Home > Archive > PHP Zend Engine > August 2005 > cvs: ZendEngine2 / zend.c









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author cvs: ZendEngine2 / zend.c
Dmitry Stogov

2005-08-25, 6:55 pm

dmitry Thu Aug 25 09:53:21 2005 EDT

Modified files:
/ZendEngine2 zend.c
Log:
Fixed memory leaks


http://cvs.php.net/diff.php/ZendEng...7&r2=1.318&ty=u
Index: ZendEngine2/zend.c
diff -u ZendEngine2/zend.c:1.317 ZendEngine2/zend.c:1.318
--- ZendEngine2/zend.c:1.317 Thu Aug 25 03:56:15 2005
+++ ZendEngine2/zend.c Thu Aug 25 09:53:17 2005
@@ -17,7 +17,7 @@
+----------------------------------------------------------------------+
*/

-/* $Id: zend.c,v 1.317 2005/08/25 07:56:15 dmitry Exp $ */
+/* $Id: zend.c,v 1.318 2005/08/25 13:53:17 dmitry Exp $ */

#include "zend.h"
#include "zend_extensions.h"
@@ -727,8 +727,24 @@
TSRMLS_FETCH();

destroy_zend_function(function TSRMLS_CC);
- if (function->type == ZEND_INTERNAL_FUNCTION && function->common.function_name) {
- free(function->common.function_name);
+ if (function->type == ZEND_INTERNAL_FUNCTION) {
+ if (function->common.function_name) {
+ free(function->common.function_name);
+ }
+ if (function->common.arg_info) {
+ int n = function->common.num_args;
+
+ while (n > 0) {
+ --n;
+ if (function->common.arg_info[n].name) {
+ free(function->common.arg_info[n].name);
+ }
+ if (function->common.arg_info[n].class_name) {
+ free(function->common.arg_info[n].class_name);
+ }
+ }
+ free(function->common.arg_info);
+ }
}
}

Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com