Fix two memleaks in the encryption code