Note that if the `make_error_msg` memory is freed, this probably needs a `strdup()` for consistency.