fix pkcs7 memory leaks and XMALLOC result verification.