Fix memory leak in filter support