--- th-lock.c.orig	2015-09-12 08:49:38.119000000 -0700
+++ th-lock.c	2015-09-12 08:52:19.356000000 -0700
@@ -177,6 +177,11 @@
         return;
     }
     lock_count = OPENSSL_malloc(CRYPTO_num_locks() * sizeof(long));
+    if (!lock_count) {
+	/* Nothing we can do about this...void function! */
+	OPENSSL_free(lock_cs);
+	return;
+    }
     for (i = 0; i < CRYPTO_num_locks(); i++) {
         lock_count[i] = 0;
 # ifdef USE_MUTEX
