Hello,

when I call `BIO_free(a)' all memory used by this BIO should be
freed.  With the "socket connect" BIO this seems not to work as
expected:

static int conn_free(BIO *a)
        {
        BIO_CONNECT *data;

        if (a == NULL) return(0);
        data=(BIO_CONNECT *)a->ptr;

        if (a->shutdown)
                {
                conn_close_socket(a);
                BIO_CONNECT_free(data);
                a->ptr=NULL;
                a->flags=0;
                a->init=0;
                }
        return(1);
        }

If `a->shutdown' is not set, the socket won't be closed, which is
okay.  But additionally, the internal data structure of this BIO
won't be freed.

Small patch to correct this behaviour:

--- bss_conn.c-orig     Thu Sep 21 07:41:58 2000
+++ bss_conn.c  Sat Aug  4 06:15:11 2001
@@ -391,11 +391,13 @@
        if (a->shutdown)
                {
                conn_close_socket(a);
-               BIO_CONNECT_free(data);
-               a->ptr=NULL;
-               a->flags=0;
-               a->init=0;
                }
+
+       BIO_CONNECT_free(data);
+       a->ptr=NULL;
+       a->flags=0;
+       a->init=0;
+
        return(1);
        }

Best regards,
Niko









________________________________________
Urlaubsfotos online verwalten, Abzuege bestellen, Grusskarten verschicken
- mit den Fotoalben von http://www.epost.de 


______________________________________________________________________
OpenSSL Project                                 http://www.openssl.org
Development Mailing List                       [EMAIL PROTECTED]
Automated List Manager                           [EMAIL PROTECTED]

Reply via email to