Mailing List Archive

proper init and destruction
hello list,

i am currently debugging a library that uses libgrypt, ver 11.2.3.

running a sample program through valgrind, i noticed that some memory allocated when using function

gcry_randomize

is never released. the samle program follows:

#include "stdio.h"
#include "stdlib.h"

#include <gcrypt.h>

int main(){

char message[16];
memset(message, 0, sizeof(message));
int i =0;
for(;i<100;i++){
gcry_randomize(message, 16, GCRY_VERY_STRONG_RANDOM);
}
return 1;
}


this call uses only once some 1500 bytes that are never released. Is there something I can do about it? am i missing something on proper initialization and destruction of the library internal structures?

also, in some other part of the lib i am debugging, successive calls to

gcry_check_version

allocate up to 500 bytes that are never released. Do you have any clues on that?


thank you,

vasilis.

_________________________________________________________________
Express yourself instantly with MSN Messenger! Download today it's FREE!
http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/
Re: proper init and destruction [ In reply to ]
At Tue, 29 Jan 2008 11:43:39 +0000,
Vassilios Zafiropoulos <vasili3000@hotmail.com> wrote:
> this call uses only once some 1500 bytes that are never released. Is there something I can do about it? am i missing something on proper initialization and destruction of the library internal structures?
>
> also, in some other part of the lib i am debugging, successive calls to
>
> gcry_check_version
>
> allocate up to 500 bytes that are never released. Do you have any clues on that?

Some results are cached statically in libgcrypt. This is not a bug.

A bug would be unbounded growth of memory allocations.

Thanks,
Marcus


_______________________________________________
Gcrypt-devel mailing list
Gcrypt-devel@gnupg.org
http://lists.gnupg.org/mailman/listinfo/gcrypt-devel