26f820467afa323064eb88e948348545e9dc010b
max
  Fri Jul 29 14:31:08 2016 -0700
Adding a "Download All" button to the CIRM CDW. No redmine.

diff --git src/hg/lib/hdb.c src/hg/lib/hdb.c
index 5371223..00ddd70 100644
--- src/hg/lib/hdb.c
+++ src/hg/lib/hdb.c
@@ -3225,31 +3225,32 @@
 if (hel == NULL)
     return NULL;
 else
     return slNameCloneList((struct slName *)(hel->val));
 }
 
 char* hHttpHost()
 /* return http host from apache or hostname if run from command line  */
 {
 char host[256];
 
 char *httpHost = getenv("HTTP_HOST");
 
 if (httpHost == NULL && !gethostname(host, sizeof(host)))
     // make sure this works when CGIs are run from the command line.
-    httpHost = host;
+    // small mem leak is acceptable when run from command line
+    httpHost = cloneString(host);
 
 return httpHost;
 }
 
 
 boolean hHostHasPrefix(char *prefix)
 /* Return TRUE if this is running on web-server with host name prefix */
 {
 if (prefix == NULL)
     return FALSE;
 
 char *httpHost = hHttpHost();
 if (httpHost == NULL)
     return FALSE;