That line means "if benc still points at something, free it". The problem is - more likely than not, somebody has already freed benc, but did not set benc to zero (or NULL). As a result, this check (line 640) says "benc is not zero, so it must be pointing at something that must be freed, so invoke the free()". Trace the use of benc and make sure whoever freed it before line 640, also set it to zero. Better way of freeing in the context would be: if (benc != NULL) { if (BIO_free(benc) == 0) abort_with_error("Cannot free benc!"); benc = 0; } where abort_with_error() is your own function.
_____ From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Pink Princess Sent: Monday, July 30, 2007 06:50 To: Brad Hards Cc: openssl-users@openssl.org Subject: Re: Error while encryption or Decrypting Dear brad Thanks for the advice and the hint I have been through the free commands to check where the error occured In APPS folder in enc.c file whenever I comment this line(640) if (benc != NULL) BIO_free(benc); the dump core disappear I am working in check what does this line mean and what is benc regards On 7/29/07, Brad Hards <[EMAIL PROTECTED]> wrote: On Saturday 28 July 2007 01:49, Pink Princess wrote: > *** glibc detected *** /home/noura/workspace/256OpenSSL/apps/openssl: > double free or corruption (!prev): 0x0820d170 *** This is the most likely problem - you are free()ing memory that has already been free()d. Maybe you are free()ing memory that openssl is cleaning up later. Try running under valgrind or a debugger. Brad