]> source.dussan.org Git - tigervnc.git/commitdiff
Add missing throws for exception
authorPierre Ossman <ossman@cendio.se>
Tue, 26 Mar 2019 10:10:28 +0000 (11:10 +0100)
committerPierre Ossman <ossman@cendio.se>
Tue, 26 Mar 2019 10:10:28 +0000 (11:10 +0100)
It is not enough to create an exception object, you need to throw
it as well.

common/rfb/CSecurityTLS.cxx
win/rfb_win32/Registry.cxx

index c6d1e3103698ef0aec123508313f700b901de20a..aa19109095ceebc4c40493a3df035dba6853971d 100644 (file)
@@ -391,7 +391,7 @@ void CSecurityTLS::checkSession()
                           "authority:\n\n%s\n\nDo you want to save it and "
                           "continue?\n ", info.data);
   if (len < 0)
-    AuthFailureException("certificate decoding error");
+    throw AuthFailureException("certificate decoding error");
 
   vlog.debug("%s", info.data);
 
@@ -417,16 +417,16 @@ void CSecurityTLS::checkSession()
 
   if (gnutls_x509_crt_export(crt, GNUTLS_X509_FMT_PEM, NULL, &out_size)
       == GNUTLS_E_SHORT_MEMORY_BUFFER)
-    AuthFailureException("Out of memory");
+    throw AuthFailureException("Out of memory");
 
   // Save cert
   out_buf =  new char[out_size];
   if (out_buf == NULL)
-    AuthFailureException("Out of memory");
+    throw AuthFailureException("Out of memory");
 
   if (gnutls_x509_crt_export(crt, GNUTLS_X509_FMT_PEM, out_buf, &out_size) < 0)
-    AuthFailureException("certificate issuer unknown, and certificate "
-                        "export failed");
+    throw AuthFailureException("certificate issuer unknown, and certificate "
+                               "export failed");
 
   char *homeDir = NULL;
   if (getvnchomedir(&homeDir) == -1)
index 963a36a29e1b80c2946ddaf8bb25017247f1bb3e..9cd501842fa4a5a8c617243c8814d9784d4b8201 100644 (file)
@@ -254,7 +254,7 @@ TCHAR* RegKey::getRepresentation(const TCHAR* valname) const {
       TCharArray result(required);
       length = ExpandEnvironmentStrings(str.buf, result.buf, required);
       if (required<length)
-        rdr::Exception("unable to expand environment strings");
+        throw rdr::Exception("unable to expand environment strings");
       return result.takeBuf();
     } else {
       return tstrDup(_T(""));