From 68e1f0edb82cb86f42bcae0fc87d7aa800f255ee Mon Sep 17 00:00:00 2001 From: Kamil Dudka Date: Wed, 27 May 2009 16:30:12 +0200 Subject: Fix various memory leaks and free internal objects on module unload. Elio helped me to complete the patch. 501080 --- pinst.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'pinst.c') diff --git a/pinst.c b/pinst.c index 0a80803..c995b14 100644 --- a/pinst.c +++ b/pinst.c @@ -487,10 +487,22 @@ pem_Finalize NSSCKFWInstance * fwInstance ) { + int i; + plog("pem_Finalize\n"); if (!pemInitialized) return; + for (i = 0; i < pem_nobjs; ++i) + pem_DestroyInternalObject(gobj[i]); + + nss_ZFreeIf(gobj); + gobj = NULL; + + pem_nobjs = 0; + size = 0; + count = 0; + PR_AtomicSet(&pemInitialized, PR_FALSE); return; -- cgit