fix resource leak on bad user cert chain big buffer