  static void asn1_item_combine_free(ASN1_VALUE **pval, const ASN1_ITEM *it,
      int combine);
  
-@@ -79,6 +86,19 @@
+@@ -79,6 +86,18 @@
  	asn1_item_combine_free(pval, it, 0);
  }
  
 +static void smart_free(void* ptr) {
 +#ifdef COMPILE_WITH_INTEL_SGX
 +	if (sgx_is_within_enclave(ptr, 1)) {
-+#else
++#endif
 +		free(ptr);
-+#endif
 +#ifdef COMPILE_WITH_INTEL_SGX
 +	} else {
 +		ocall_free(ptr);

--- ./crypto/asn1/tasn_fre.c	2017-03-08 11:15:50.533468363 +0000
+++ ../talos/./crypto/asn1/tasn_fre.c	2017-03-08 11:13:57.219757093 +0000
@@ -62,6 +62,13 @@
 #include <openssl/asn1t.h>
 #include <openssl/objects.h>

 static void
 asn1_item_combine_free(ASN1_VALUE **pval, const ASN1_ITEM *it, int combine)
 {
@@ -122,7 +141,7 @@
 		if (asn1_cb)
 			asn1_cb(ASN1_OP_FREE_POST, pval, it, NULL);
 		if (!combine) {
