--- gst-plugins-good-cvs/gst/udp/gstmultiudpsink.c	2005-09-09 07:09:49.000000000 -0400
+++ gst-plugins-good/gst/udp/gstmultiudpsink.c	2005-11-25 13:20:49.000000000 -0500
@@ -26,6 +26,8 @@
 GST_DEBUG_CATEGORY (multiudpsink_debug);
 #define GST_CAT_DEFAULT (multiudpsink_debug)
 
+#define GETHOSTBYNAME_BUFFERSIZE 1024
+
 static GstStaticPadTemplate sink_template = GST_STATIC_PAD_TEMPLATE ("sink",
     GST_PAD_SINK,
     GST_PAD_ALWAYS,
@@ -316,7 +318,11 @@
 void
 gst_multiudpsink_add (GstMultiUDPSink * sink, const gchar * host, gint port)
 {
-  struct hostent *he;
+  int herror = 0;
+  struct hostent* hresult = NULL;
+  struct hostent he;
+  char tmphostbuf[GETHOSTBYNAME_BUFFERSIZE];
+  
   struct in_addr addr;
   struct ip_mreq multi_addr;
   GstUDPClient *client;
@@ -354,9 +360,9 @@
   else if (strcmp (host, "localhost") == 0 && inet_aton ("127.0.0.1", &addr)) {
     client->theiraddr.sin_addr = *((struct in_addr *) &addr);
   }
-  /* if its a hostname */
-  else if ((he = gethostbyname (host))) {
-    client->theiraddr.sin_addr = *((struct in_addr *) he->h_addr);
+  /* if its a hostname */       
+  else if (gethostbyname_r(host, &he, tmphostbuf, GETHOSTBYNAME_BUFFERSIZE, &hresult, &herror)) {
+    client->theiraddr.sin_addr = *((struct in_addr *) hresult->h_addr);
   } else {
     goto host_error;
   }
@@ -370,7 +376,7 @@
   /* ERRORS */
 host_error:
   {
-    GST_DEBUG ("hostname lookup error?");
+    GST_DEBUG ("hostname lookup error? : Error No : %d", herror );
     g_free (client->host);
     g_free (client);
     return;
