[xmlsec] FW: Free/Destroy versus Memory Leak

Aleksey Sanin aleksey at aleksey.com
Mon Feb 20 14:43:10 PST 2006


OK, I was able to reproduce the leak on Windows XP (before I tried
Win2K). The attached patch fixes the leak by reordering MSCrypto
key cleanup calls.

Thanks for reporting the problem!
Aleksey


-------------- next part --------------
Index: src/mscrypto/certkeys.c
===================================================================
RCS file: /cvs/gnome/xmlsec/src/mscrypto/certkeys.c,v
retrieving revision 1.11
diff -u -r1.11 certkeys.c
--- src/mscrypto/certkeys.c	10 Feb 2006 22:02:36 -0000	1.11
+++ src/mscrypto/certkeys.c	20 Feb 2006 22:39:48 -0000
@@ -670,9 +670,9 @@
     ctx = xmlSecMSCryptoKeyDataGetCtx(data);
     xmlSecAssert(ctx != NULL);
     
-    xmlSecMSCryptoKeyDataCtxDestroyProvider(ctx);
     xmlSecMSCryptoKeyDataCtxDestroyKey(ctx);
     xmlSecMSCryptoKeyDataCtxDestroyCert(ctx);
+    xmlSecMSCryptoKeyDataCtxDestroyProvider(ctx);
 
     memset(ctx, 0, sizeof(xmlSecMSCryptoKeyDataCtx));
 }


More information about the xmlsec mailing list