Module: kamailio
Branch: master
Commit: 590c8d9d23e578df38d332ebcfa64421bbedb604
URL: 
https://github.com/kamailio/kamailio/commit/590c8d9d23e578df38d332ebcfa64421bbedb604

Author: Daniel-Constantin Mierla <[email protected]>
Committer: Daniel-Constantin Mierla <[email protected]>
Date: 2017-07-30T10:30:59+02:00

tls: removed useless checks

---

Modified: src/modules/tls/tls_domain.c
Modified: src/modules/tls/tls_select.c

---

Diff:  
https://github.com/kamailio/kamailio/commit/590c8d9d23e578df38d332ebcfa64421bbedb604.diff
Patch: 
https://github.com/kamailio/kamailio/commit/590c8d9d23e578df38d332ebcfa64421bbedb604.patch

---

diff --git a/src/modules/tls/tls_domain.c b/src/modules/tls/tls_domain.c
index a56c76e2b3..d515402cc9 100644
--- a/src/modules/tls/tls_domain.c
+++ b/src/modules/tls/tls_domain.c
@@ -1086,12 +1086,12 @@ static int fix_domain(tls_domain_t* d, tls_domain_t* 
def)
  */
 static int passwd_cb(char *buf, int size, int rwflag, void *filename)
 {
-#if OPENSSL_VERSION_NUMBER >= 0x00907000L      
-       UI             *ui;
-       const char     *prompt;
-       
+#if OPENSSL_VERSION_NUMBER >= 0x00907000L
+       UI *ui;
+       const char *prompt;
+
        ui = UI_new();
-       if (ui == NULL)
+       if(ui == NULL)
                goto err;
 
        prompt = UI_construct_prompt(ui, "passphrase", filename);
@@ -1099,16 +1099,13 @@ static int passwd_cb(char *buf, int size, int rwflag, 
void *filename)
        UI_process(ui);
        UI_free(ui);
        return strlen(buf);
- 
- err:
+
+err:
        ERR("passwd_cb: Error in passwd_cb\n");
-       if (ui) {
-               UI_free(ui);
-       }
        return 0;
-       
+
 #else
-       if (des_read_pw_string(buf, size-1, "Enter Private Key password:", 0)) {
+       if(des_read_pw_string(buf, size - 1, "Enter Private Key password:", 0)) 
{
                ERR("Error in passwd_cb\n");
                return 0;
        }
diff --git a/src/modules/tls/tls_select.c b/src/modules/tls/tls_select.c
index fd84506a36..c1c44c3763 100644
--- a/src/modules/tls/tls_select.c
+++ b/src/modules/tls/tls_select.c
@@ -461,7 +461,6 @@ static int check_cert(str* res, int* ires, int local, int 
err, sip_msg_t* msg)
        return 0;
 
  error:
-       if (cert) X509_free(cert);
        if (c) tcpconn_put(c);
        return -1;
 }


_______________________________________________
Kamailio (SER) - Development Mailing List
[email protected]
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-dev

Reply via email to