Fix memory leak in SSL trust check.