Multiple memory leaks in error checking code.
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.
It looks like this patch includes the modifications you made for AVRO-1084, so I'm going to merge that one first.
Patch for this issue