Mailing List Archive

memory leak message at running "gcry_pk_genkey" function
I made a very simple example:


gcry_sexp_t s_key;
gcry_sexp_t s_keyparam;
int rc;
rc = FN_gcry_sexp_build(&s_keyparam, NULL,
"(genkey(rsa(nbits %d)(rsa-use-e 3:257)))",
HOSTKEY_LEN);
rc = FN_gcry_pk_genkey(&s_key, s_keyparam);

FN_gcry_pk_genkey is the gcry_pk_genkey function but
readed dinamicaly from library (I cannot add at
references of my project libgcrypt library).

1. The problem is that when FN_gcry_pk_genkey is
reached program is stopped, I get the following
message: Detected memory leaks! and my library is
deployed.

2. Another question is if there are some sources which
I can compile whitout minGW ? or a library for
windows?








__________________________________
Yahoo! Mail Mobile
Take Yahoo! Mail with you! Check email on your mobile phone.
http://mobile.yahoo.com/learn/mail
Re: memory leak message at running "gcry_pk_genkey" function [ In reply to ]
On Tue, 28 Jun 2005 03:17:22 -0700 (PDT), gabi uleia said:

> FN_gcry_pk_genkey is the gcry_pk_genkey function but
> readed dinamicaly from library (I cannot add at
> references of my project libgcrypt library).

Did you really make sure that libgcrypt has been properly initialized?

> 1. The problem is that when FN_gcry_pk_genkey is
> reached program is stopped, I get the following
> message: Detected memory leaks! and my library is
> deployed.

I suppose this due to one-time allocation done by libgcrypt. There is
currently no way of getting rid of these one-time allocations.
Dynamically removing libgcrypt from the process is not supported.

> 2. Another question is if there are some sources which
> I can compile whitout minGW ? or a library for

Don't know. In general we don't want to support this for ease of
maintenance.


Salam-Shalom,

Werner