From: vsv3 at alu dot ua dot es
Operating system: Linux 2.4.22 Debian Woody
PHP version: 4.3.2
PHP Bug Type: mcrypt related
Bug description: Memory usage

Description:
------------
When I use the functions for encrypt some data, the memory that PHP uses,
doesn't get free. It gets more and more memory.

Reproduce code:
---------------
<?php
$key = '123456789012345678901234567890';
$iv = '12345678';

$nVeces = 100000;
$n = 0;
$td = mcrypt_module_open( MCRYPT_FISH, '', MCRYPT_MODE_CBC, '' );
while( $n < $nVeces ) {
$fichero = file_get_contents( "/tmp/hola" );

mcrypt_generic_init( $td, $key, $iv );
$fichero_enc = addslashes( mcrypt_generic($td, $textoPlano) );
unset( $fichero_enc );

if( isset($fichero_enc) ) echo "<b><h1>No pudimos destruir la
variable</h1></b><br />";
$n = $n + 1;
}
mcrypt_module_close( $td );
?>

Expected result:
----------------
A script that execute with a consume of less than 1MB of memory (with a
file '/tmp/hola' of 1kB).

Actual result:
--------------
An script that consumes more than 100MB, or more. A similar script with
other data, have been consumed more than 2000MB.

--
Edit bug report at [url]http://bugs.php.net/?id=26042&edit=1[/url]
--
Try a CVS snapshot (php4): [url]http://bugs.php.net/fix.php?id=26042&r=trysnapshot4[/url]
Try a CVS snapshot (php5): [url]http://bugs.php.net/fix.php?id=26042&r=trysnapshot5[/url]
Fixed in CVS: [url]http://bugs.php.net/fix.php?id=26042&r=fixedcvs[/url]
Fixed in release: [url]http://bugs.php.net/fix.php?id=26042&r=alreadyfixed[/url]
Need backtrace: [url]http://bugs.php.net/fix.php?id=26042&r=needtrace[/url]
Try newer version: [url]http://bugs.php.net/fix.php?id=26042&r=oldversion[/url]
Not developer issue: [url]http://bugs.php.net/fix.php?id=26042&r=support[/url]
Expected behavior: [url]http://bugs.php.net/fix.php?id=26042&r=notwrong[/url]
Not enough info: [url]http://bugs.php.net/fix.php?id=26042&r=notenoughinfo[/url]
Submitted twice: [url]http://bugs.php.net/fix.php?id=26042&r=submittedtwice[/url]
register_globals: [url]http://bugs.php.net/fix.php?id=26042&r=globals[/url]
PHP 3 support discontinued: [url]http://bugs.php.net/fix.php?id=26042&r=php3[/url]
Daylight Savings: [url]http://bugs.php.net/fix.php?id=26042&r=dst[/url]
IIS Stability: [url]http://bugs.php.net/fix.php?id=26042&r=isapi[/url]
Install GNU Sed: [url]http://bugs.php.net/fix.php?id=26042&r=gnused[/url]
Floating point limitations: [url]http://bugs.php.net/fix.php?id=26042&r=float[/url]