mirror of
https://github.com/phpseclib/phpseclib.git
synced 2024-12-25 19:21:09 +00:00
Call xml_parser_free and unset to avoid memory leaks
This commit is contained in:
parent
fce6063de6
commit
a276c2b073
@ -1415,9 +1415,14 @@ class Crypt_RSA
|
||||
xml_set_character_data_handler($xml, '_data_handler');
|
||||
// add <xml></xml> to account for "dangling" tags like <BitStrength>...</BitStrength> that are sometimes added
|
||||
if (!xml_parse($xml, '<xml>' . $key . '</xml>')) {
|
||||
xml_parser_free($xml);
|
||||
unset($xml);
|
||||
return false;
|
||||
}
|
||||
|
||||
xml_parser_free($xml);
|
||||
unset($xml);
|
||||
|
||||
return isset($this->components['modulus']) && isset($this->components['publicExponent']) ? $this->components : false;
|
||||
// from PuTTY's SSHPUBK.C
|
||||
case CRYPT_RSA_PRIVATE_FORMAT_PUTTY:
|
||||
|
Loading…
Reference in New Issue
Block a user