You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@santuario.apache.org by Jesse Pelton <js...@PKC.com> on 2005/03/07 21:54:12 UTC

XML-Security-C memory leak

OpenSSLCryptoBase64::b642BN() leaks memory in the following line:

	return BN_dup(BN_bin2bn(buf, bufLen, NULL));

BN_bin2bn() allocates a BIGNUM, so there's no need to dup it, and doing
so causes the first one to leak.

This is not the only leak I'm seeing in my app, but it's the only one
I've managed to track down so far.  I'll be sure to post again if any of
the remaining leaks are in the library ;-).

Re: XML-Security-C memory leak

Posted by Berin Lautenbach <be...@wingsofhermes.org>.
Jesse Pelton wrote:
> OpenSSLCryptoBase64::b642BN() leaks memory in the following line:
> 
> 	return BN_dup(BN_bin2bn(buf, bufLen, NULL));
> 
> BN_bin2bn() allocates a BIGNUM, so there's no need to dup it, and doing
> so causes the first one to leak.

Thanks!  Will fix in CVS on the weekend.

Cheers,
	Berin