]> source.dussan.org Git - tigervnc.git/commitdiff
[Bugfix] Use free() instead of gnutls_free() on Windows.
authorAdam Tkac <atkac@redhat.com>
Wed, 19 Jan 2011 14:06:48 +0000 (14:06 +0000)
committerAdam Tkac <atkac@redhat.com>
Wed, 19 Jan 2011 14:06:48 +0000 (14:06 +0000)
git-svn-id: svn://svn.code.sf.net/p/tigervnc/code/trunk@4238 3789f03b-4d11-0410-bbf8-ca57d06f2519

common/rfb/CSecurityTLS.cxx

index 12273a6023983bb58ed44cafcbf890043ffd63fa..7e694d1bf7bb4eeb3aebe795e62c846b204abe69 100644 (file)
@@ -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
   }
 }