[gnutls-dev] gnutls-1.6.1.auth_cert.mem-leak.awn.1.patch

Simon Josefsson simon at josefsson.org
Fri Apr 27 14:26:05 CEST 2007


"Andrew W. Nosenko" <andrew.w.nosenko at gmail.com> writes:

> 2007-04-26  Andrey Nosenko  <andrew.w.nosenko at gmail.com>
>
>        * lib/auth_cert.c (_gnutls_selected_certs_deinit):
>        Fix memory leak.

Thanks.  When do the mem leak happen?  In other words, how do I trigger
it?  I'd like to write a self-test that trigger it (which could be used
with valgrind) to improve our regression-testing, if it isn't too
difficult to do.

/Simon

> -- 
> Andrew W. Nosenko <andrew.w.nosenko at gmail.com>
> 2007-04-26  Andrey Nosenko  <andrew.w.nosenko at gmail.com>
>
> 	* lib/auth_cert.c (_gnutls_selected_certs_deinit):
> 	Fix memory leak.
>
> --- lib/auth_cert.c-	Fri Jun 16 19:25:06 2006
> +++ lib/auth_cert.c	Thu Apr 26 18:08:11 2007
> @@ -1652,10 +1652,16 @@ _gnutls_selected_certs_deinit (gnutls_se
>  	{
>  	  _gnutls_gcert_deinit (&session->internals.selected_cert_list[i]);
>  	}
> +      gnutls_free(session->internals.selected_cert_list);
>        session->internals.selected_cert_list = NULL;
>        session->internals.selected_cert_list_length = 0;
>  
>        _gnutls_gkey_deinit (session->internals.selected_key);
> +      if (session->internals.selected_key)
> +      {
> +          gnutls_free(session->internals.selected_key);
> +          session->internals.selected_key = NULL;
> +      }
>      }
>  
>    return;
> _______________________________________________
> Gnutls-dev mailing list
> Gnutls-dev at gnupg.org
> http://lists.gnupg.org/mailman/listinfo/gnutls-dev



More information about the Gnutls-dev mailing list