Issues

ZF-2262: xml_parser_free() called after exception is thrown

Issue Type: Improvement Created: 2007-12-03T19:02:23.000+0000 Last Updated: 2008-03-21T16:25:25.000+0000 Status: Resolved Fix version(s): - 1.5.0 (17/Mar/08)

Reporter: Lars Strojny (lars) Assignee: Thomas Weidner (thomas) Tags: - Zend_Translate

Related issues: Attachments: - translate-exception.diff

Description

Line 95, Zend/Translate/Adapter/Tbx.php

<pre class="highlight">
if (!xml_parse($this->_file, file_get_contents($filename))) {
            throw new Zend_Translate_Exception(sprintf('XML error: %s at line %d',
                      xml_error_string(xml_get_error_code($this->_file)),
                      xml_get_current_line_number($this->_file)));
            xml_parser_free($this->_file);
        }

I would suggest the following:

<pre class="highlight">
        if (!xml_parse($this->_file, file_get_contents($filename))) {
            $exception = new Zend_Translate_Exception(sprintf('XML error: %s at line %d',
                      xml_error_string(xml_get_error_code($this->_file)),
                      xml_get_current_line_number($this->_file)));
            xml_parser_free($this->_file);
            throw $exception;
        }

Comments

Posted by Lars Strojny (lars) on 2007-12-03T19:08:56.000+0000

Same for Zend_Translate_Adapter_Xliff, Zend_Translate_Adapter_XmlTm, Zend_Translate_Adapter_Tmx and Zend_Translate_Adapter_Qt

Posted by Lars Strojny (lars) on 2007-12-03T19:12:32.000+0000

Fixes the described problems

Posted by Thomas Weidner (thomas) on 2007-12-04T02:53:07.000+0000

Thanks for your suggestion...

I will look over it and see what we will do. You will get an answer in some days.

Posted by Thomas Weidner (thomas) on 2007-12-06T04:30:02.000+0000

Thanks for your interest and investigation related to this issue.

It is fixed with SVN-7049 within the trunk.

Have you found an issue?

See the Overview section for more details.

Copyright

© 2006-2016 by Zend, a Rogue Wave Company. Made with by awesome contributors.

This website is built using zend-expressive and it runs on PHP 7.

Contacts