com php-src: Fixed leak in RuleBasedBreakIterator constructor: ext/intl/breakiterator/rulebasedbreakiterator_methods.cpp

From: Date: Mon, 23 Jul 2012 14:51:28 +0000
Subject: com php-src: Fixed leak in RuleBasedBreakIterator constructor: ext/intl/breakiterator/rulebasedbreakiterator_methods.cpp
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-69663@lists.php.net to get a copy of this message
Commit: 01004c6abb53ee235f7d76295c48c3082c998a5b Author: Gustavo Lopes <glopes@safelinq.com> Mon, 23 Jul 2012 16:51:28 +0200 Parents: d8d5f9a9f50a98e3a44218f8672a6516a9e8dfe7 Branches: master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=01004c6abb53ee235f7d76295c48c3082c998a5b Log: Fixed leak in RuleBasedBreakIterator constructor The leak occurred in case of error. Changed paths: M ext/intl/breakiterator/rulebasedbreakiterator_methods.cpp Diff: diff --git a/ext/intl/breakiterator/rulebasedbreakiterator_methods.cpp b/ext/intl/breakiterator/rulebasedbreakiterator_methods.cpp index 61fb574..454e524 100644 --- a/ext/intl/breakiterator/rulebasedbreakiterator_methods.cpp +++ b/ext/intl/breakiterator/rulebasedbreakiterator_methods.cpp @@ -70,6 +70,7 @@ static void _php_intlrbbi_constructor_body(INTERNAL_FUNCTION_PARAMETERS) smart_str_free(&parse_error_str); intl_error_set_custom_msg(NULL, msg, 1 TSRMLS_CC); efree(msg); + delete rbbi; RETURN_NULL(); } } else { // compiled @@ -78,6 +79,7 @@ static void _php_intlrbbi_constructor_body(INTERNAL_FUNCTION_PARAMETERS) if (U_FAILURE(status)) { intl_error_set(NULL, status, "rbbi_create_instance: unable to " "create instance from compiled rules", 0 TSRMLS_CC); + delete rbbi; RETURN_NULL(); } #else

« previous php.cvs (#69663) next »