[Issue 10350] New: Free ch_calloc-allocated memory in error paths