Return error sooner if can’t create descriptor.
Fix chance of memory leaks when errors occur.