Hi,

I'm doing following code:

int main(int argc, char* argv[])
{
        BYTE* pData = 0;
        long nSize = 0; 

        FILE* fp = fopen("d:\\class1.crl", "rb");
        if(fp)
        {
                fseek(fp, 0, SEEK_END) ;
                nSize = ftell(fp);
                fseek(fp, 0, SEEK_SET);
                pData = new BYTE[nSize];
                fread(pData, sizeof(BYTE), nSize, fp);
                BYTE* pTmp = pData;
                X509_CRL* pX509Crl = d2i_X509_CRL(0, &pTmp, nSize);
                delete[] pData;
                fclose(fp);

                if(pX509Crl)
                        X509_CRL_free(pX509Crl);
        }

        return 0;
}

And I'm getting a memory leak (reported by Bounds Checker), with following
function call stack:

CRYPTO_malloc()         in .\crypto\mem.c
ERR_get_state() in .\crypto\err.c
ERR_clear_error()       in .\crypto\err.c       
ASN1_d2i_bio()          in .\crypto\asn1\a_d2i_fp.c     
d2iX509_CRL_bio()       in .\crypto\x509\x_all.c
main()                  
mainCRTStartup()



I'm using openssl-0.9.6a on Windows 2000 server and memory leaks r shown my
BoundsChecker

Thanks
Aslam


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

Reply via email to