Browse Source

Add missing throws for exception

It is not enough to create an exception object, you need to throw
it as well.
tags/v1.9.90
Pierre Ossman 5 years ago
parent
commit
78bdd1700c
2 changed files with 6 additions and 6 deletions
  1. 5
    5
      common/rfb/CSecurityTLS.cxx
  2. 1
    1
      win/rfb_win32/Registry.cxx

+ 5
- 5
common/rfb/CSecurityTLS.cxx View File

"authority:\n\n%s\n\nDo you want to save it and " "authority:\n\n%s\n\nDo you want to save it and "
"continue?\n ", info.data); "continue?\n ", info.data);
if (len < 0) if (len < 0)
AuthFailureException("certificate decoding error");
throw AuthFailureException("certificate decoding error");


vlog.debug("%s", info.data); vlog.debug("%s", info.data);




if (gnutls_x509_crt_export(crt, GNUTLS_X509_FMT_PEM, NULL, &out_size) if (gnutls_x509_crt_export(crt, GNUTLS_X509_FMT_PEM, NULL, &out_size)
== GNUTLS_E_SHORT_MEMORY_BUFFER) == GNUTLS_E_SHORT_MEMORY_BUFFER)
AuthFailureException("Out of memory");
throw AuthFailureException("Out of memory");


// Save cert // Save cert
out_buf = new char[out_size]; out_buf = new char[out_size];
if (out_buf == NULL) 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) 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; char *homeDir = NULL;
if (getvnchomedir(&homeDir) == -1) if (getvnchomedir(&homeDir) == -1)

+ 1
- 1
win/rfb_win32/Registry.cxx View File

TCharArray result(required); TCharArray result(required);
length = ExpandEnvironmentStrings(str.buf, result.buf, required); length = ExpandEnvironmentStrings(str.buf, result.buf, required);
if (required<length) if (required<length)
rdr::Exception("unable to expand environment strings");
throw rdr::Exception("unable to expand environment strings");
return result.takeBuf(); return result.takeBuf();
} else { } else {
return tstrDup(_T("")); return tstrDup(_T(""));

Loading…
Cancel
Save