enclave-tls: cleanup the environment context when transmitting data successfully
@@ -113,7 +113,11 @@ int enclave_tls_echo(int fd, enclave_tls_log_level_t log_level,
printf("Server: %s\n", buf);
}
- return 0;
+ ret = enclave_tls_cleanup(handle);
+ if (ret != ENCLAVE_TLS_ERR_NONE)
+ fprintf(stderr, "failed to cleanup %#x\n", ret);
+
+ return ret;
err:
ret = enclave_tls_cleanup(handle);
