rrichards Tue Feb 24 07:03:33 2004 EDT
Modified files:
/php-src/ext/xml compat.c
Log:
fix win32 compile with libxml 2.6
fix mem leaks
http://cvs.php.net/diff.php/php-src/ext/xml/compat.c?r1=1.30&r2=1.31&ty=u
Index: php-src/ext/xml/compat.c
diff -u php-src/ext/xml/compat.c:1.30 php-src/ext/xml/compat.c:1.31
--- php-src/ext/xml/compat.c:1.30 Mon Feb 23 10:54:45 2004
+++ php-src/ext/xml/compat.c Tue Feb 24 07:03:32 2004
@@ -82,9 +82,9 @@
_qualify_namespace(parser, name, URI, &qualified_name);
if (attributes != NULL) {
- attrs = safe_emalloc((nb_attributes * 2) + 1, sizeof(int *), 0);
xmlChar *qualified_name_attr = NULL;
-
+ attrs = safe_emalloc((nb_attributes * 2) + 1, sizeof(int *), 0);
+
for (i = 0; i < nb_attributes; i += 1) {
if (attributes[y+1] != NULL) {
@@ -102,6 +102,9 @@
}
parser->h_start_element(parser->user, (const XML_Char *) qualified_name,
(const XML_Char **) attrs);
if (attrs) {
+ for (i = 0; i < z; i++) {
+ xmlFree(attrs[i]);
+ }
efree(attrs);
}
xmlFree(qualified_name);
--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php