Browse code

tls: removed useless checks

Daniel-Constantin Mierla authored on 30/07/2017 08:30:59
Showing 2 changed files
... ...
@@ -1086,12 +1086,12 @@ static int fix_domain(tls_domain_t* d, tls_domain_t* def)
1086 1086
  */
1087 1087
 static int passwd_cb(char *buf, int size, int rwflag, void *filename)
1088 1088
 {
1089
-#if OPENSSL_VERSION_NUMBER >= 0x00907000L	
1090
-	UI             *ui;
1091
-	const char     *prompt;
1092
-	
1089
+#if OPENSSL_VERSION_NUMBER >= 0x00907000L
1090
+	UI *ui;
1091
+	const char *prompt;
1092
+
1093 1093
 	ui = UI_new();
1094
-	if (ui == NULL)
1094
+	if(ui == NULL)
1095 1095
 		goto err;
1096 1096
 
1097 1097
 	prompt = UI_construct_prompt(ui, "passphrase", filename);
... ...
@@ -1099,16 +1099,13 @@ static int passwd_cb(char *buf, int size, int rwflag, void *filename)
1099 1099
 	UI_process(ui);
1100 1100
 	UI_free(ui);
1101 1101
 	return strlen(buf);
1102
- 
1103
- err:
1102
+
1103
+err:
1104 1104
 	ERR("passwd_cb: Error in passwd_cb\n");
1105
-	if (ui) {
1106
-		UI_free(ui);
1107
-	}
1108 1105
 	return 0;
1109
-	
1106
+
1110 1107
 #else
1111
-	if (des_read_pw_string(buf, size-1, "Enter Private Key password:", 0)) {
1108
+	if(des_read_pw_string(buf, size - 1, "Enter Private Key password:", 0)) {
1112 1109
 		ERR("Error in passwd_cb\n");
1113 1110
 		return 0;
1114 1111
 	}
... ...
@@ -461,7 +461,6 @@ static int check_cert(str* res, int* ires, int local, int err, sip_msg_t* msg)
461 461
 	return 0;
462 462
 
463 463
  error:
464
-	if (cert) X509_free(cert);
465 464
 	if (c) tcpconn_put(c);
466 465
 	return -1;
467 466
 }