          m_eid(0),
          m_pencryptedppid(NULL)
      {
-@@ -193,7 +196,10 @@
+@@ -193,7 +198,10 @@
      }
  };
  

     sgx_enclave_id_t m_eid;
     sgx_misc_attribute_t m_attributes;
     sgx_launch_token_t m_launch_token;
@@ -170,6 +172,7 @@
 
     ql_global_data():
         m_load_policy(SGX_QL_DEFAULT),

+        goto CLEANUP;
+    }
+
+    memcpy(g_ql_global_data.m_qe_dirpath, dirpath_copy, dirpath_len);
+    g_ql_global_data.m_qe_dirpath[dirpath_len] = 0;
+    g_ql_global_data.m_qe_dirpath_length = dirpath_len;
+    refqt_ret = SGX_QL_SUCCESS;
