this should be out3 (and unrelated to your patch, the earlier ftruncate should goto out3 as well)