loader: Guard against potential memory leaks
Merge pull request #8 from lioncash/leak

loader: Guard against potential memory leaks