From 5d4c6acf920cb7baba9c70137e3cbaa6d898830d Mon Sep 17 00:00:00 2001 From: Adam Tkac Date: Wed, 19 Jan 2011 14:06:48 +0000 Subject: [PATCH] [Bugfix] Use free() instead of gnutls_free() on Windows. git-svn-id: svn://svn.code.sf.net/p/tigervnc/code/trunk@4238 3789f03b-4d11-0410-bbf8-ca57d06f2519 --- common/rfb/CSecurityTLS.cxx | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/common/rfb/CSecurityTLS.cxx b/common/rfb/CSecurityTLS.cxx index 12273a60..7e694d1b 100644 --- a/common/rfb/CSecurityTLS.cxx +++ b/common/rfb/CSecurityTLS.cxx @@ -269,7 +269,16 @@ void CSecurityTLS::checkSession() throw AuthFailureException("decoding of certificate failed"); if (gnutls_x509_crt_print(crt, GNUTLS_CRT_PRINT_ONELINE, &info)) { + /* + * GNUTLS doesn't correctly export gnutls_free symbol which is + * a function pointer. Linking with Visual Studio 2008 Express will + * fail when you call gnutls_free(). + */ +#if WIN32 + free(info.data); +#else gnutls_free(info.data); +#endif throw AuthFailureException("Could not find certificate to display"); } @@ -354,7 +363,16 @@ void CSecurityTLS::checkSession() throw AuthFailureException("certificate not trusted"); gnutls_x509_crt_deinit(crt); + /* + * GNUTLS doesn't correctly export gnutls_free symbol which is + * a function pointer. Linking with Visual Studio 2008 Express will + * fail when you call gnutls_free(). + */ +#if WIN32 + free(info.data); +#else gnutls_free(info.data); +#endif } } -- 2.39.5