Fix some memory leaks
Create directory for symlink before creating symlink
Merge pull request #1581 from nulltoken/fix/leaks

Fix some memory leaks
Merge pull request #1582 from dmgctrl/checkout_symlink_fix

Create directory for symlink before creating symlink