summaryrefslogtreecommitdiff
path: root/ext/mcrypt
diff options
context:
space:
mode:
authorIlia Alshanetsky <iliaa@php.net>2003-10-31 04:33:51 +0000
committerIlia Alshanetsky <iliaa@php.net>2003-10-31 04:33:51 +0000
commit00635d08074cff28af53f654dfcf45a14263c5f0 (patch)
tree22a04a50da8eb619fda42a68a78bcf54162ab6d9 /ext/mcrypt
parent4adbd1dbf67ff35ae6258618e216146f30dac221 (diff)
downloadphp-git-00635d08074cff28af53f654dfcf45a14263c5f0.tar.gz
Fixed bug #26042 (memory leak if mcrypt_generic_deinit() is not called
after every mcrypt_generic_init() call). # This will be MFHed into 4.3.X tree after release.
Diffstat (limited to 'ext/mcrypt')
-rw-r--r--ext/mcrypt/mcrypt.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/ext/mcrypt/mcrypt.c b/ext/mcrypt/mcrypt.c
index acd3a2e865..fecedf3bb1 100644
--- a/ext/mcrypt/mcrypt.c
+++ b/ext/mcrypt/mcrypt.c
@@ -223,6 +223,7 @@ PHP_INI_END()
static void php_mcrypt_module_dtor(zend_rsrc_list_entry *rsrc TSRMLS_DC)
{
MCRYPT td = (MCRYPT) rsrc->ptr;
+ mcrypt_generic_deinit(td);
mcrypt_module_close (td);
}
@@ -426,6 +427,7 @@ PHP_FUNCTION(mcrypt_generic_init)
}
memcpy(iv_s, Z_STRVAL_PP(iv), iv_size);
+ mcrypt_generic_deinit(td);
result = mcrypt_generic_init(td, key_s, key_size, iv_s);
/* If this function fails, close the mcrypt module to prevent crashes