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