rrichards Thu, 24 Sep 2009 12:40:59 +0000
Revision: http://svn.php.net/viewvc?view=revision&revision=288652
Log:
fix memleak
Changed paths:
U php/php-src/branches/PHP_5_2/ext/dom/documenttype.c
U php/php-src/branches/PHP_5_3/ext/dom/documenttype.c
U php/php-src/trunk/ext/dom/documenttype.c
Modified: php/php-src/branches/PHP_5_2/ext/dom/documenttype.c
===================================================================
--- php/php-src/branches/PHP_5_2/ext/dom/documenttype.c 2009-09-24 11:04:52 UTC
(rev 288651)
+++ php/php-src/branches/PHP_5_2/ext/dom/documenttype.c 2009-09-24 12:40:59 UTC
(rev 288652)
@@ -200,7 +200,6 @@
xmlDtdPtr dtdptr;
xmlDtd *intsubset;
xmlOutputBuffer *buff = NULL;
- xmlChar *strintsubset;
dtdptr = (xmlDtdPtr) dom_object_get_node(obj);
@@ -216,9 +215,8 @@
if (buff != NULL) {
xmlNodeDumpOutput (buff, NULL, (xmlNodePtr) intsubset,
0, 0, NULL);
xmlOutputBufferFlush(buff);
- strintsubset = xmlStrndup(buff->buffer->content,
buff->buffer->use);
+ ZVAL_STRINGL(*retval, buff->buffer->content,
buff->buffer->use, 1);
(void)xmlOutputBufferClose(buff);
- ZVAL_STRING(*retval, (char *) strintsubset, 1);
return SUCCESS;
}
}
Modified: php/php-src/branches/PHP_5_3/ext/dom/documenttype.c
===================================================================
--- php/php-src/branches/PHP_5_3/ext/dom/documenttype.c 2009-09-24 11:04:52 UTC
(rev 288651)
+++ php/php-src/branches/PHP_5_3/ext/dom/documenttype.c 2009-09-24 12:40:59 UTC
(rev 288652)
@@ -190,7 +190,6 @@
xmlDtdPtr dtdptr;
xmlDtd *intsubset;
xmlOutputBuffer *buff = NULL;
- xmlChar *strintsubset;
dtdptr = (xmlDtdPtr) dom_object_get_node(obj);
@@ -206,9 +205,8 @@
if (buff != NULL) {
xmlNodeDumpOutput (buff, NULL, (xmlNodePtr) intsubset,
0, 0, NULL);
xmlOutputBufferFlush(buff);
- strintsubset = xmlStrndup(buff->buffer->content,
buff->buffer->use);
+ ZVAL_STRINGL(*retval, buff->buffer->content,
buff->buffer->use, 1);
(void)xmlOutputBufferClose(buff);
- ZVAL_STRING(*retval, (char *) strintsubset, 1);
return SUCCESS;
}
}
Modified: php/php-src/trunk/ext/dom/documenttype.c
===================================================================
--- php/php-src/trunk/ext/dom/documenttype.c 2009-09-24 11:04:52 UTC (rev
288651)
+++ php/php-src/trunk/ext/dom/documenttype.c 2009-09-24 12:40:59 UTC (rev
288652)
@@ -190,7 +190,6 @@
xmlDtdPtr dtdptr;
xmlDtd *intsubset;
xmlOutputBuffer *buff = NULL;
- xmlChar *strintsubset;
dtdptr = (xmlDtdPtr) dom_object_get_node(obj);
@@ -206,9 +205,8 @@
if (buff != NULL) {
xmlNodeDumpOutput (buff, NULL, (xmlNodePtr) intsubset,
0, 0, NULL);
xmlOutputBufferFlush(buff);
- strintsubset = xmlStrndup(buff->buffer->content,
buff->buffer->use);
+ ZVAL_STRINGL(*retval, buff->buffer->content,
buff->buffer->use, 1);
(void)xmlOutputBufferClose(buff);
- ZVAL_STRING(*retval, (char *) strintsubset, 1);
return SUCCESS;
}
}
--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php