From: Adam Tkac Date: Wed, 19 Jan 2011 14:06:48 +0000 (+0000) Subject: [Bugfix] Use free() instead of gnutls_free() on Windows. X-Git-Tag: v1.0.90~80 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=5d4c6acf920cb7baba9c70137e3cbaa6d898830d;p=tigervnc.git [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 --- 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 } }