--- socketmodule.c~ 2006-02-20 04:42:37.000000000 -0500 +++ socketmodule.c 2006-06-22 16:44:33.000000000 -0400 @@ -2697,18 +2697,19 @@ if ((addr_list = PyList_New(0)) == NULL) goto err; - for (pch = h->h_aliases; *pch != NULL; pch++) { - int status; - tmp = PyString_FromString(*pch); - if (tmp == NULL) - goto err; - - status = PyList_Append(name_list, tmp); - Py_DECREF(tmp); - - if (status) - goto err; - } + if ( h->h_aliases != NULL ) + for (pch = h->h_aliases; *pch != NULL; pch++) { + int status; + tmp = PyString_FromString(*pch); + if (tmp == NULL) + goto err; + + status = PyList_Append(name_list, tmp); + Py_DECREF(tmp); + + if (status) + goto err; + }