Prevent memory leak when initialization failure