Minor optimizations (original by Peter Vaskovic, modified by Paul Bakker)

Move strlen out of for loop.
Remove redundant null checks before free.
4 files changed