Fixes memory leak in printEntry