I'm not familar with GeoIP, but i think you should call ``geoip_close` before raise a exception.