c2ec8d4dba471a2a73d0f98d448cb8ea30444c13
larrym
  Fri Apr 13 11:24:11 2012 -0700
fix something per tim's code review
diff --git src/hg/lib/web.c src/hg/lib/web.c
index 6b4c66d..0e4eb1a 100644
--- src/hg/lib/web.c
+++ src/hg/lib/web.c
@@ -386,31 +386,31 @@
     puts("</TD></TR>\n");
 
 #endif
 
 if (endsWith(scriptName, "hgGateway") && geoMirrorEnabled())
     {
     // Show an opt-out alert if user is on a host to which user has been automatically redirected (just once, right after they have been redirected)
     char *source = cgiOptionalString("source");
     char *redirect = cgiOptionalString("redirect");
     if (source != NULL && redirect != NULL && sameString(redirect, "auto"))
 	{
 	char *domain = cgiServerName();
 	char *port = cgiServerPort();
         // We don't bother maintaining stuff in request URI, because it may contain items like hgsid and other host specific values
         int newUriSize = 2048;
-	char *newUri = needMem(2048);
+	char *newUri = needMem(newUriSize);
 	// TODO what about https?
 	safef(newUri, newUriSize, "http://%s:%s/cgi-bin/hgGateway?redirect=manual&source=%s", source, port, domain);
 
 	//empty TD disappears
 	/*
 	printf("<TR><TD COLSPAN=3 id='redirectTd' onclick=\"javascript:document.getElementById('redirectTd').innerHTML='';\">"
 	    "<center>"
 	    "You've been redirected to your nearest mirror - %s<br>"
 	    "<a href=\"%s\">Take me back to %s</a>"
 	    "</center>"
 	    "</TD></TR>\n"
 	    , domain, newUri, source );
 	    "<h3 style=\"background-color: #2636d1; text-align: center; color:#E0F0F0; margin-top:0px;\">"
 	*/