dmitry Thu Aug 25 09:53:39 2005 EDT Modified files: /php-src/ext/libxml libxml.c Log: Fixed memory leaks http://cvs.php.net/diff.php/php-src/ext/libxml/libxml.c?r1=1.33&r2=1.34&ty=u Index: php-src/ext/libxml/libxml.c diff -u php-src/ext/libxml/libxml.c:1.33 php-src/ext/libxml/libxml.c:1.34 --- php-src/ext/libxml/libxml.c:1.33 Thu Aug 18 03:16:52 2005 +++ php-src/ext/libxml/libxml.c Thu Aug 25 09:53:38 2005 @@ -17,7 +17,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: libxml.c,v 1.33 2005/08/18 07:16:52 dmitry Exp $ */ +/* $Id: libxml.c,v 1.34 2005/08/25 13:53:38 dmitry Exp $ */ #define IS_EXT_MODULE @@ -798,11 +798,14 @@ export_hnd.export_func = export_function; if (zend_hash_add(&php_libxml_exports, ce->name, ce->name_length + 1, &export_hnd, sizeof(export_hnd), NULL) == SUCCESS) { + int ret; UChar *uname; uname = malloc(UBYTES(ce->name_length+1)); u_charsToUChars(ce->name, uname, ce->name_length+1); - return zend_u_hash_add(&php_libxml_exports, IS_UNICODE, uname, ce->name_length + 1, &export_hnd, sizeof(export_hnd), NULL); + ret = zend_u_hash_add(&php_libxml_exports, IS_UNICODE, uname, ce->name_length + 1, &export_hnd, sizeof(export_hnd), NULL); + free(uname); + return ret; } return FAILURE; }
-- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php