From: Pierre Ossman Date: Mon, 30 Dec 2019 09:26:12 +0000 (+0100) Subject: Remove unneeded memory checks X-Git-Tag: v1.10.90~59 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=6208f47dcbf68ff1e751b0b526bb643f0da867a6;p=tigervnc.git Remove unneeded memory checks new throws an exception on allocation errors rather than return NULL. --- diff --git a/common/rfb/CSecurityTLS.cxx b/common/rfb/CSecurityTLS.cxx index c1a00212..5c303a37 100644 --- a/common/rfb/CSecurityTLS.cxx +++ b/common/rfb/CSecurityTLS.cxx @@ -396,8 +396,6 @@ void CSecurityTLS::checkSession() vlog.debug("%s", info.data); certinfo = new char[len]; - if (certinfo == NULL) - throw AuthFailureException("Out of memory"); snprintf(certinfo, len, "This certificate has been signed by an unknown " "authority:\n\n%s\n\nDo you want to save it and " @@ -422,8 +420,6 @@ void CSecurityTLS::checkSession() // Save cert out_buf = new char[out_size]; - if (out_buf == NULL) - throw AuthFailureException("Out of memory"); if (gnutls_x509_crt_export(crt, GNUTLS_X509_FMT_PEM, out_buf, &out_size) < 0) throw AuthFailureException("certificate issuer unknown, and certificate "