silc-client: handle key load error correctly
[silc.git] / apps / irssi / src / silc / core / clientutil.c
index 0daceefff530e2952e227223e0271abc90067985..56854526514bc5988148243e6b9c869dbe04d026 100644 (file)
@@ -363,9 +363,10 @@ int silc_client_load_keys(SilcClient client)
   ret = silc_load_key_pair(pub, prv, "", &irssi_pubkey, &irssi_privkey);
   if (!ret)
     ret = silc_load_key_pair(pub, prv, NULL, &irssi_pubkey, &irssi_privkey);
-
-  if (!ret)
+  if (!ret) {
     SILC_LOG_ERROR(("Could not load key pair"));
+    return ret;
+  }
 
   if (silc_pkcs_private_key_get_len(irssi_privkey) < 4096) {
     fprintf(stdout,