]> git.0d.be Git - empathy.git/blobdiff - tests/mock-pkcs11.c
libempathy-gtk: fix uninitialized variable
[empathy.git] / tests / mock-pkcs11.c
index 4b1219f2c35a99eb54fa924d980990b534ae40cd..a2ee648bbc40caab87dd06867ba9b5f50f61b5fd 100644 (file)
  *
  * You should have received a copy of the GNU Lesser General
  * License along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
- * 02111-1307, USA.
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
  */
 
 #include "config.h"
-
 #include "mock-pkcs11.h"
 
-#include <gcr/gcr.h>
-
-#include <glib.h>
-
 #include <string.h>
 
 /*
@@ -75,7 +69,7 @@ typedef struct {
 static void
 free_session (gpointer data)
 {
-  Session *sess = (Session*)data;
+  Session *sess = (Session *) data;
   g_list_free (sess->matches);
   g_free (sess);
 }
@@ -124,7 +118,7 @@ mock_C_Initialize (CK_VOID_PTR init_args)
   args = (CK_C_INITIALIZE_ARGS_PTR)init_args;
   if (args)
     {
-      g_return_val_if_fail(
+      g_return_val_if_fail (
           (args->CreateMutex == NULL && args->DestroyMutex == NULL &&
            args->LockMutex == NULL && args->UnlockMutex == NULL) ||
           (args->CreateMutex != NULL && args->DestroyMutex != NULL &&
@@ -152,13 +146,13 @@ mock_C_Finalize (CK_VOID_PTR reserved)
 
   initialized = FALSE;
 
-  g_hash_table_destroy (the_certificates);
+  g_hash_table_unref (the_certificates);
   the_certificates = NULL;
 
-  g_hash_table_destroy (the_assertions);
+  g_hash_table_unref (the_assertions);
   the_assertions = NULL;
 
-  g_hash_table_destroy (the_sessions);
+  g_hash_table_unref (the_sessions);
   the_sessions = NULL;
 
   return CKR_OK;