Projet

Général

Profil

Bug #55510 » leak.pl

A Perl code that leaks. Comment the "dump" call to stop it from leaking - Maxime Besson, 10 juillet 2021 13:12

 
1
use strict;
2
use warnings;
3
use Lasso;
4

    
5

    
6
my $dump = "<Identity xmlns=\"http://www.entrouvert.org/namespaces/lasso/0.0\" Version=\"2\"><lasso:Federation xmlns:lasso=\"http://www.entrouvert.org/namespaces/lasso/0.0\" xmlns:saml=\"urn:oasis:names:tc:SAML:2.0:assertion\" RemoteProviderID=\"testsp.lxd\" FederationDumpVersion=\"2\"><lasso:LocalNameIdentifier><saml:NameID Format=\"urn:oasis:names:tc:SAML:2.0:nameid-format:persistent\" NameQualifier=\"https://auth.lemontest.lxd/saml/metadata\" SPNameQualifier=\"testsp.lxd\">_0CF12279B248F613593FF094D96508C0</saml:NameID></lasso:LocalNameIdentifier></lasso:Federation></Identity>";
7

    
8
while (1) {
9
    # Lasso::Identity allocated here
10
    my $identity = Lasso::Identity::new_from_dump($dump);
11

    
12
    # Dump string allocated here
13
    my $dumped = $identity->dump;
14

    
15
}
16
# $identity is deallocated, but not $dumped