Merged silc_1_1_branch to trunk.
[silc.git] / lib / silccrypt / silcpkcs.c
index f5ae7873274dcb762bb75d695820df6941122066..74fd6f03ab8b5a3ed35d106a288ec8853d05e7b9 100644 (file)
@@ -513,7 +513,7 @@ SilcUInt32 silc_pkcs_public_key_get_len(SilcPublicKey public_key)
 void *silc_pkcs_get_context(SilcPKCSType type, SilcPublicKey public_key)
 {
   if (public_key->pkcs->type != type)
-    return FALSE;
+    return NULL;
   return public_key->public_key;
 }
 
@@ -693,6 +693,7 @@ SilcBool silc_pkcs_load_public_key(const char *filename,
 
   silc_free(data);
   silc_free(public_key);
+  *ret_public_key = NULL;
   return FALSE;
 }
 
@@ -778,6 +779,7 @@ SilcBool silc_pkcs_load_private_key(const char *filename,
 
   silc_free(data);
   silc_free(private_key);
+  *ret_private_key = NULL;
   return FALSE;
 }