Make sure to free buf before returning x2

It looks like this was copy/pasted :frowning: