In some cases, buf is allocated, but the pointer isn't copied into the ret_file structure. This patch frees buf unless it's actually used.
Patch against current git.
I forgot to note--this bug was found with cppcheck.
Patch against current git.
I forgot to note--this bug was found with cppcheck.