iliaa Fri Oct 11 23:11:29 2002 EDT
Modified files:
/php4/ext/standard info.c
Log:
Fixed memory leaks.
Index: php4/ext/standard/info.c
diff -u php4/ext/standard/info.c:1.216 php4/ext/standard/info.c:1.217
--- php4/ext/standard/info.c:1.216 Thu Oct 10 00:28:15 2002
+++ php4/ext/standard/info.c Fri Oct 11 23:11:28 2002
@@ -18,7 +18,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: info.c,v 1.216 2002/10/10 04:28:15 sniper Exp $ */
+/* $Id: info.c,v 1.217 2002/10/12 03:11:28 iliaa Exp $ */
#include "php.h"
#include "php_ini.h"
@@ -99,6 +99,7 @@
char *string_key;
uint string_len;
ulong num_key;
+ char *elem_esc = NULL;
if (zend_hash_find(&EG(symbol_table), name, name_length+1, (void **)
&data)!=FAILURE
&& (Z_TYPE_PP(data)==IS_ARRAY)) {
@@ -116,7 +117,9 @@
switch (zend_hash_get_current_key_ex(Z_ARRVAL_PP(data),
&string_key, &string_len, &num_key, 0, NULL)) {
case HASH_KEY_IS_STRING:
if (PG(html_errors)) {
- PUTS(php_info_html_esc(string_key
TSRMLS_CC));
+ elem_esc =
+php_info_html_esc(string_key TSRMLS_CC);
+ PUTS(elem_esc);
+ efree(elem_esc);
} else {
PUTS(string_key);
}
@@ -147,7 +150,9 @@
if (Z_STRLEN(tmp2) == 0) {
PUTS("<i>no value</i>");
} else {
- PUTS(php_info_html_esc(Z_STRVAL(tmp2)
TSRMLS_CC));
+ elem_esc =
+php_info_html_esc(Z_STRVAL(tmp2) TSRMLS_CC);
+ PUTS(elem_esc);
+ efree(elem_esc);
}
} else {
PUTS(Z_STRVAL(tmp2));
@@ -158,7 +163,9 @@
if (Z_STRLEN_PP(tmp) == 0) {
PUTS("<i>no value</i>");
} else {
-
PUTS(php_info_html_esc(Z_STRVAL_PP(tmp) TSRMLS_CC));
+ elem_esc =
+php_info_html_esc(Z_STRVAL_PP(tmp) TSRMLS_CC);
+ PUTS(elem_esc);
+ efree(elem_esc);
}
} else {
PUTS(Z_STRVAL_PP(tmp));
@@ -713,8 +720,8 @@
int i;
va_list row_elements;
char *row_element;
+ char *elem_esc = NULL;
/*
- char *elem_esc;
int elem_esc_len;
*/
@@ -739,7 +746,9 @@
}
} else {
if (PG(html_errors)) {
- PUTS(php_info_html_esc(row_element TSRMLS_CC));
+ elem_esc = php_info_html_esc(row_element TSRMLS_CC);
+ PUTS(elem_esc);
+ efree(elem_esc);
} else {
PUTS(row_element);
if (i < num_cols-1) {
--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php