A NULL pointer could be freed if error handling occured. (cherry picked from commit 0378c05ba0)
0378c05ba0