login about faq

About the sample located here: http://www.example-code.com/vcpp/cert_listLocalMachineCerts.asp

Using VS10 in debug mode, I see that there are lots of leaks when exiting the application. I experimented with Dispose (in C++) with no success but, using delete, I eliminated the leaks. Do we need and is it safe to use delete on the returned objects?

Modified code:

cs = ccs.OpenLocalSystemStore();

if (!(cs == 0 )) {

    CkCert *cert = 0;
    int numCerts;
    numCerts = cs->get_NumCertificates();
    int i;
    //  Print the distinguished name of each certificate
    for (i = 0; i <= numCerts - 1; i++) {
        cert = cs->GetCertificate(i);
        m_cLsCert.InsertString(-1, cert->subjectCN());
        cert->dispose();
        **delete cert;**
    }       
cs->dispose();  
**delete cs;**
}
else {
    printf("%s\n",ccs.lastErrorText());
}

asked Sep 06 '12 at 12:03

Joff's gravatar image

Joff
0225

edited Sep 06 '12 at 13:32


All Chilkat objects returned by a Chilkat method must be deleted by the application.

I updated the online example.

link

answered Sep 06 '12 at 12:23

chilkat's gravatar image

chilkat ♦♦
11.8k316358421

edited Sep 06 '12 at 12:26

That's interesting, however doesn't the digital certificate should be hidden or at least decoded in way that it cannot be altered? i mean its a very sensitive topic that should have this kind of modification.

link

answered Feb 19 '13 at 04:48

Nadajredat's gravatar image

Nadajredat
0

Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or __italic__
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Tags:

×65
×48
×6

Asked: Sep 06 '12 at 12:03

Seen: 2,153 times

Last updated: Feb 19 '13 at 04:48

powered by OSQA