ims_ipsec_pcscf: fixed possible use of uninitialized value in ipsec_forward()
authorAleksandar Yosifov <alexyosifov@gmail.com>
Thu, 13 Jun 2019 10:12:06 +0000 (13:12 +0300)
committerAleksandar Yosifov <alexyosifov@gmail.com>
Thu, 13 Jun 2019 10:22:58 +0000 (13:22 +0300)
- related to calling "*ul.unlock_udomain"

src/modules/ims_ipsec_pcscf/cmd.c

index 576bf56..f696ac9 100644 (file)
@@ -571,7 +571,7 @@ int ipsec_forward(struct sip_msg* m, udomain_t* d)
         struct cell *t = tmb.t_gett();
         if (!t) {
             LM_ERR("Error getting transaction\n");
         struct cell *t = tmb.t_gett();
         if (!t) {
             LM_ERR("Error getting transaction\n");
-            goto cleanup;
+            return ret;
         }
 
         req = t->uas.request;
         }
 
         req = t->uas.request;
@@ -662,7 +662,7 @@ int ipsec_forward(struct sip_msg* m, udomain_t* d)
     struct socket_info * client_sock = grep_sock_info(via_host.af == AF_INET ? &ipsec_listen_addr : &ipsec_listen_addr6, src_port, dst_proto);
     if(!client_sock) {
         LM_ERR("Error calling grep_sock_info() for ipsec client port\n");
     struct socket_info * client_sock = grep_sock_info(via_host.af == AF_INET ? &ipsec_listen_addr : &ipsec_listen_addr6, src_port, dst_proto);
     if(!client_sock) {
         LM_ERR("Error calling grep_sock_info() for ipsec client port\n");
-        return -1;
+        goto cleanup;
     }
     m->force_send_socket = client_sock;
 
     }
     m->force_send_socket = client_sock;