Milan,

Those two are fine. The first also creates a new ref, the second works on a new reference that is created as the sig is loaded.

The only way I can see the the problem you have occuring is if these calls are happening somewhere and a reference is being re-used. I.e. createBlankReference() called on a reference that is already loaded or the like.

Are you able to send me some code that replicates the leak? I'm very curious!

Cheers,
        Berin

Milan Tomic wrote:

Berin,

        I'm not calling those functions from my code, but they are
called implicitly by XSEC 1.1 in those cases:

1. DSIGReference::createBlankReference() is called when
sig->createReference(MAKE_UNICODE_STRING(s)) is called and
2. DSIGReference::load() is called when sig->load() is called.

Best regards,
Milan



-----Original Message-----
From: Berin Lautenbach [mailto:[EMAIL PROTECTED] Sent: Wednesday, March 24, 2004 11:19 AM
To: [EMAIL PROTECTED]
Subject: Re: DSIGReference (free)



Milan,


I'm confused.

The memory leak you show below only makes sense if somehow the mp_transformsList variable is set to NULL prior to the Reference being deleted. If the Reference itself was not deleted, then a formatter object would also be left hanging around. So the reference is being deleted, but mp_transformList is either NULL or has been over-written and a new one is being deleted.

The only places mp_transformList is set to NULL or re-created is where DSIGReference::createBlankReference() is called - which would indicate a reference node being re-used, or DSIGReference::load() is called, which would also indicate a reference being re-used.

Does either of those scenarious sound possible?

Cheers,
        Berin


Milan Tomic wrote:



Berin,

Should I delete DSIGReference (and when?) returned from
DSIGSignature::CreateReference() function? I have this

peace of code:


} else {
       DSIGReference *ref;
       ref = sig->createReference(MAKE_UNICODE_STRING(""));

DSIGTransformEnvelope *env =
ref->appendEnvelopedSignatureTransform();
DSIGTransformC14n *c14 = ref->appendCanonicalizationTransform(CANON_C14NE_NOC);
}


I'm reading memory leaks here:

xml-security-c-1.1.0\src\dsig\dsigreference.cpp(254) : {2471} normal
block at 0x00F69628, 24 bytes long.
Data: < 8$ > F4 9C 90 00 38 24 F9 00 C8 0C FA

00 03 00 00 00


xml-security-c-1.1.0\src\dsig\dsigreference.cpp(189) :

{2469} normal


block at 0x00F61EF0, 16 bytes long.
Data: < > CC CD CD CD 80 96 F6 00 88 96 F6

00 88 96 F6 00


xml-security-c-1.1.0\src\dsig\dsigreference.cpp(211) :

{2464} normal


block at 0x00F61C78, 12 bytes long.
Data: <D           > 44 9F 90 00 C8 20 F9 00 C8 0C FA 00

I've tried to delete "ref" variable but failed.

Best regards,
Milan






Reply via email to