com php-src: Fix leak in gmp_pow(): ext/gmp/gmp.c
| From: | Nikita Popov | Date: | Thu, 16 Apr 2015 14:04:19 +0000 |
| Subject: | com php-src: Fix leak in gmp_pow(): ext/gmp/gmp.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-86335@lists.php.net to get a copy of this message | ||
Commit: 8e167a2a00175753a26bd812fb4d2c881e68e3db
Author: Nikita Popov <nikic@php.net> Thu, 16 Apr 2015 16:00:31 +0200
Parents: 60830f49c03b01dae20c99f233356be9dce0da17
Branches: PHP-5.6 master
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=8e167a2a00175753a26bd812fb4d2c881e68e3db
Log:
Fix leak in gmp_pow()
Changed paths:
M ext/gmp/gmp.c
Diff:
diff --git a/ext/gmp/gmp.c b/ext/gmp/gmp.c
index ba59acb..12b88c6 100644
--- a/ext/gmp/gmp.c
+++ b/ext/gmp/gmp.c
@@ -1428,11 +1428,12 @@ ZEND_FUNCTION(gmp_pow)
RETURN_FALSE;
}
- INIT_GMP_RETVAL(gmpnum_result);
if (Z_TYPE_P(base_arg) == IS_LONG && Z_LVAL_P(base_arg) >= 0) {
+ INIT_GMP_RETVAL(gmpnum_result);
mpz_ui_pow_ui(gmpnum_result, Z_LVAL_P(base_arg), exp);
} else {
FETCH_GMP_ZVAL(gmpnum_base, base_arg, temp_base);
+ INIT_GMP_RETVAL(gmpnum_result);
mpz_pow_ui(gmpnum_result, gmpnum_base, exp);
FREE_GMP_TEMP(temp_base);
}