xdiff/xprepare: fix a memory leak