--- apps/ts.c	2011-11-14 00:36:07.000000000 +0000
+++ apps/ts.patched.c	2012-12-10 11:50:55.022532988 +0000
@@ -1082,6 +1082,11 @@
 
 	/* Creating the X509_STORE object. */
 	cert_ctx = X509_STORE_new();
+	if (cert_ctx == NULL) 
+		{
+		BIO_printf(bio_err, "memory allocation failure\n");
+		goto err;
+		}
 
 	/* Setting the callback for certificate chain verification. */
 	X509_STORE_set_verify_cb(cert_ctx, verify_cb);
