I have used those openssl functions you mentioned and did not see any 
leaking.
I have looked your code carefully and do not see any wrong either. 


 Heyun Zheng
[EMAIL PROTECTED]


-----Original Message-----
From: aslam [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, April 18, 2001 4:27 PM
To: openssl-users
Cc: aslam
Subject: Memory Leaks... in d2i_X509_CRL function...


Hi,

I'm just trying to obtain a X509_CRL* correcponding to  a crl obtained 
from
http://crl.verisign.com/class.crl which is DER encoded, by following 
code
and its giving me memory leaks and that too huge some MBytes. I didn't 
new
that OpenSSL is so leaky.. 
Does any one faced this problem.... ???? 


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;
}
 
Is there some problem in my code?

Any help is very much appriciated.

Thanks
Aslam
______________________________________________________________________
OpenSSL Project                                 http://www.openssl.org
User Support Mailing List                    [EMAIL PROTECTED]
Automated List Manager                           [EMAIL PROTECTED]

Reply via email to