]> source.dussan.org Git - tigervnc.git/commitdiff
Remove unneeded memory checks
authorPierre Ossman <ossman@cendio.se>
Mon, 30 Dec 2019 09:26:12 +0000 (10:26 +0100)
committerPierre Ossman <ossman@cendio.se>
Mon, 30 Dec 2019 09:26:12 +0000 (10:26 +0100)
new throws an exception on allocation errors rather than return NULL.

common/rfb/CSecurityTLS.cxx

index c1a00212a3dfeb29e4931dd2be55cb5b2081c72d..5c303a37c99d67eda010c44c739976b6723becdb 100644 (file)
@@ -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 "