close file on error path
axe uncharacteristic camelCasing of C symbols