Hi Alex, Alexander Klink schrieb:
OpenXPKI::Crypto::Backend::OpenSSL::XS::get_object_function (line 120): function: pubkey_hash openxpkid: ()(13732) malloc: *** Deallocation of a pointer not malloced: 0x49cf62e; This could be a double free(), or free() called with the middle of an allocated block; Try setting environment variable MallocHelp to see tools to help debug I don't really get the code there, but line 103 has SAFEFREE(char_ptr), without char_ptr being used before, is that the correct way to do it!?
char_ptr is initialized with NULL. After this it is used to return strings. SAFEFREE always checks if char_ptr was in use and if this happens then it frees the memory, so that the pointer can be used again. The reason to do so is simply that we cannot free char_ptr in the local function because char_ptr contains the result.
I don't know a clean concept to return char * pointer in XS and avoid memory leaks.
Best regards Michael -- _______________________________________________________________ Michael Bell Humboldt-Universitaet zu Berlin Tel.: +49 (0)30-2093 2482 ZE Computer- und Medienservice Fax: +49 (0)30-2093 2704 Unter den Linden 6 [EMAIL PROTECTED] D-10099 Berlin _______________________________________________________________ X.509 CA Certificates / Wurzelzertifikate http://ra.pki.hu-berlin.de
smime.p7s
Description: S/MIME Cryptographic Signature
------------------------------------------------------------------------- This SF.net email is sponsored by DB2 Express Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now. http://sourceforge.net/powerbar/db2/
_______________________________________________ OpenXPKI-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/openxpki-devel
