Multiple memory leaks in error checking code.
Patch for this issue
It looks like this patch includes the modifications you made for AVRO-1084, so I'm going to merge that one first.
Committed to SVN. There was a missing cast in datafile.c which generated a compiler warning on Mac and an error on Windows. Added this and all tests pass.