326 static PyObject * GeoIP_range_by_ip_Py(PyObject *self, PyObject *args) {
327 char * name;
328 char ** start_stop_ptr;
329 PyObject * retval;
330
331 GeoIP_GeoIPObject* GeoIP = (GeoIP_GeoIPObject*)self;
332 if (!PyArg_ParseTuple(args, "s", &name)) {
333 return NULL;
when PyArg_ParseTuple() succeeds
taking False path
334 }
335 start_stop_ptr = GeoIP_range_by_ip(GeoIP->gi, name);
336 if ( !start_stop_ptr ) {
337 return NULL;
when treating unknown char * * from py_GeoIP.c:336 as NULL
taking True path
338 }
339
340 retval = Py_BuildValue("ss", start_stop_ptr[0], start_stop_ptr[1]);
341
342 /* relplace this code with GeoIP_range_by_ip_delete in the next version
343 * otherwise the users need 1.4.5 instead of 1.4.4 */
344 if ( retval ) {
345 if ( start_stop_ptr[0] )
346 free(start_stop_ptr[0]);
347 if ( start_stop_ptr[1] )
348 free(start_stop_ptr[1]);
349 free(start_stop_ptr);
350 }
351 return retval;
352 }
353