Fixed memory leak coming from allocateGhostBuffer