searching for leaks

This commit is contained in:
chris2511 2003-12-10 16:01:06 +00:00
parent de21ec1e0f
commit 748e71a6e4
6 changed files with 23 additions and 5 deletions

View File

@ -111,10 +111,12 @@ QString a1int::toHex() const
return r;
}
BIGNUM *bn = ASN1_INTEGER_to_BN(in, NULL);
fprintf(stderr, "a1int 1:\n");
CRYPTO_mem_leaks_fp(stderr);
char *res = BN_bn2hex(bn);
r = res;
OPENSSL_free(bn);
OPENSSL_free(res);
OPENSSL_free(bn);
return r;
}

View File

@ -92,9 +92,12 @@ a1time &a1time::set(const ASN1_TIME *a)
set((time_t)0);
}
else {
time = ASN1_TIME_to_generalizedtime((ASN1_TIME *)a, &time);
if (!time)
ASN1_TIME *siko = time;
time = ASN1_TIME_to_generalizedtime((ASN1_TIME *)a, &siko);
if (!time) {
if (siko) ASN1_TIME_free(time);
time=M_ASN1_TIME_dup(a);
}
}
return *this;
}

View File

@ -250,6 +250,8 @@ void db_base::insertPKI(pki_base *pki)
void db_base::_writePKI(pki_base *pki, bool overwrite, DbTxn *tid)
{
CRYPTO_remove_all_info();
CRYPTO_mem_ctrl(CRYPTO_MEM_CHECK_ON);
int flags = 0;
if (!overwrite) flags = DB_NOOVERWRITE;
QString desc = pki->getIntName();
@ -279,10 +281,14 @@ void db_base::_writePKI(pki_base *pki, bool overwrite, DbTxn *tid)
catch (DbException &err) {
if (p)
OPENSSL_free(p);
CRYPTO_mem_leaks_fp(stderr);
throw errorEx(err.what(), "_writePKI");
}
if (p)
OPENSSL_free(p);
fprintf(stderr, "_writePKI:\n");
CRYPTO_mem_leaks_fp(stderr);
CRYPTO_mem_ctrl(CRYPTO_MEM_CHECK_OFF);
}

View File

@ -341,6 +341,7 @@ unsigned char *pki_x509::toData(int *size)
if (sRev) {
p1 = revoked.i2d(p1); // revokation date
}
// version 2
intToData(&p1, caSerial.getLong()); // the serial if this is a CA
stringToData(&p1, caTemplate); // the name of the template to use for signing
@ -641,6 +642,8 @@ void pki_x509::updateView()
pointer->setText(0, getIntName());
pointer->setText(1, getSubject().getEntryByNid(NID_commonName));
pointer->setText(2, getSerial().toHex() );
fprintf(stderr, "updV 3:\n");
CRYPTO_mem_leaks_fp(stderr);
pointer->setText(3, getNotAfter().toSortable() );
pointer->setText(4, truststatus[ getTrust() ]);
if (isRevoked())

View File

@ -11,7 +11,7 @@
<rect>
<x>0</x>
<y>0</y>
<width>527</width>
<width>523</width>
<height>590</height>
</rect>
</property>
@ -177,6 +177,10 @@
<name>name</name>
<cstring>startLabel_b</cstring>
</property>
<property stdset="1">
<name>alignment</name>
<set>WordBreak|AlignVCenter|AlignLeft</set>
</property>
<property>
<name>vAlign</name>
</property>

View File

@ -105,7 +105,7 @@ MainWindow::MainWindow(QWidget *parent, const char *name )
#ifdef MDEBUG
CRYPTO_malloc_debug_init();
CRYPTO_mem_ctrl(CRYPTO_MEM_CHECK_ON);
CRYPTO_mem_ctrl(CRYPTO_MEM_CHECK_OFF);
fprintf(stderr, "malloc() debugging on.\n");
#endif