Fix double frees.
Fix use after free.
Merge pull request #5 from openssl/master

updates from source master