Fixed memory leak when creating lookup prefix