use strict;
use warnings;
use Lasso;


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>";

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

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

}
# $identity is deallocated, but not $dumped
