[Opendnssec-commits] [keihatsu.kirei.se/svn/dnssec] r3744 - trunk/OpenDNSSEC/libhsm/src

Matthijs Mekking matthijs at nlnetlabs.nl
Thu Aug 12 10:34:07 CEST 2010


Author: matthijs
Date: 2010-08-12 10:34:07 +0200 (Thu, 12 Aug 2010)
New Revision: 3744

Modified:
   trunk/OpenDNSSEC/libhsm/src/libhsm.c
Log:
fix leaks in libhsm

Modified: trunk/OpenDNSSEC/libhsm/src/libhsm.c
===================================================================
--- trunk/OpenDNSSEC/libhsm/src/libhsm.c	2010-08-12 08:09:34 UTC (rev 3743)
+++ trunk/OpenDNSSEC/libhsm/src/libhsm.c	2010-08-12 08:34:07 UTC (rev 3744)
@@ -444,6 +444,7 @@
         if (module->name) free(module->name);
         if (module->token_label) free(module->token_label);
         if (module->path) free(module->path);
+        if (module->config) free(module->config);
 
         free(module);
     }
@@ -499,6 +500,7 @@
         hsm_ctx_set_error(ctx, HSM_MODULE_NOT_FOUND,
 	    "hsm_session_init()",
 	    "PKCS#11 module load failed: %s", module_path);
+        hsm_module_free(module);
         return HSM_MODULE_NOT_FOUND;
     }
     rv = ((CK_FUNCTION_LIST_PTR) module->sym)->C_Initialize((CK_VOID_PTR) &InitArgs);
@@ -537,6 +539,7 @@
                    C_CloseSession(session_handle);
             if (hsm_pkcs11_check_error(ctx, rv,
                 "finalize after failed login")) {
+                hsm_module_free(module);
                 return HSM_ERROR;
             }
         }




More information about the Opendnssec-commits mailing list