DVCS (see RFC 3029) was missing among the possible purposes.
[openssl.git] / ssl / s23_clnt.c
index ffaf3baff3eed8770064bb2ad9476f67f9b918c5..64ee4269ec1069828f7e7f03d29b7ed470956c54 100644 (file)
@@ -105,7 +105,7 @@ SSL_METHOD *SSLv23_client_method(void)
 
 int ssl23_connect(SSL *s)
        {
-       BUF_MEM *buf;
+       BUF_MEM *buf=NULL;
        unsigned long Time=time(NULL);
        void (*cb)(const SSL *ssl,int type,int val)=NULL;
        int ret= -1;
@@ -159,6 +159,7 @@ int ssl23_connect(SSL *s)
                                        goto end;
                                        }
                                s->init_buf=buf;
+                               buf=NULL;
                                }
 
                        if (!ssl3_setup_buffers(s)) { ret= -1; goto end; }
@@ -207,6 +208,8 @@ int ssl23_connect(SSL *s)
                }
 end:
        s->in_handshake--;
+       if (buf != NULL)
+               BUF_MEM_free(buf);
        if (cb != NULL)
                cb(s,SSL_CB_CONNECT_EXIT,ret);
        return(ret);