Fix a leak with a free before return.