This function is missing cleanup code in its error handling paths.